Small edit

This commit is contained in:
cepprice 2021-01-29 18:51:28 +05:00
parent 65facb4af3
commit 54763fc22d
2 changed files with 7 additions and 6 deletions

View file

@ -8,6 +8,7 @@ import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.profile.AExportSettingsType; import net.osmand.aidlapi.profile.AExportSettingsType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import static net.osmand.aidlapi.profile.ExportProfileParams.SETTINGS_TYPE_KEY; import static net.osmand.aidlapi.profile.ExportProfileParams.SETTINGS_TYPE_KEY;
@ -21,11 +22,11 @@ public class ProfileSettingsParams extends AidlParams {
private Uri profileSettingsUri; private Uri profileSettingsUri;
private String latestChanges; private String latestChanges;
private int version; private int version;
private ArrayList<String> settingsTypeKeyList = new ArrayList<>(); private List<String> settingsTypeKeyList = new ArrayList<>();
private boolean silent; private boolean silent;
private boolean replace; private boolean replace;
public ProfileSettingsParams(Uri profileSettingsUri, ArrayList<AExportSettingsType> settingsTypeList, boolean replace, public ProfileSettingsParams(Uri profileSettingsUri, List<AExportSettingsType> settingsTypeList, boolean replace,
boolean silent, String latestChanges, int version) { boolean silent, String latestChanges, int version) {
this.profileSettingsUri = profileSettingsUri; this.profileSettingsUri = profileSettingsUri;
for (AExportSettingsType settingsType : settingsTypeList) { for (AExportSettingsType settingsType : settingsTypeList) {
@ -65,7 +66,7 @@ public class ProfileSettingsParams extends AidlParams {
return profileSettingsUri; return profileSettingsUri;
} }
public ArrayList<String> getSettingsTypeKeys() { public List<String> getSettingsTypeKeys() {
return settingsTypeKeyList; return settingsTypeKeyList;
} }
@ -82,7 +83,7 @@ public class ProfileSettingsParams extends AidlParams {
bundle.putInt(VERSION_KEY, version); bundle.putInt(VERSION_KEY, version);
bundle.putString(LATEST_CHANGES_KEY, latestChanges); bundle.putString(LATEST_CHANGES_KEY, latestChanges);
bundle.putParcelable(PROFILE_SETTINGS_URI_KEY, profileSettingsUri); bundle.putParcelable(PROFILE_SETTINGS_URI_KEY, profileSettingsUri);
bundle.putStringArrayList(SETTINGS_TYPE_KEY, settingsTypeKeyList); bundle.putStringArrayList(SETTINGS_TYPE_KEY, new ArrayList<>(settingsTypeKeyList));
bundle.putBoolean(REPLACE_KEY, replace); bundle.putBoolean(REPLACE_KEY, replace);
bundle.putBoolean(SILENT_IMPORT_KEY, silent); bundle.putBoolean(SILENT_IMPORT_KEY, silent);
} }

View file

@ -2296,11 +2296,11 @@ public class OsmandAidlApi {
return false; return false;
} }
public boolean importProfileV2(final Uri profileUri, ArrayList<String> settingsTypeKeys, boolean replace, public boolean importProfileV2(final Uri profileUri, List<String> settingsTypeKeys, boolean replace,
boolean silent, String latestChanges, int version) { boolean silent, String latestChanges, int version) {
if (profileUri != null) { if (profileUri != null) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putStringArrayList(SettingsHelper.SETTINGS_TYPE_LIST_KEY, settingsTypeKeys); bundle.putStringArrayList(SettingsHelper.SETTINGS_TYPE_LIST_KEY, new ArrayList<>(settingsTypeKeys));
bundle.putBoolean(REPLACE_KEY, replace); bundle.putBoolean(REPLACE_KEY, replace);
bundle.putBoolean(SILENT_IMPORT_KEY, silent); bundle.putBoolean(SILENT_IMPORT_KEY, silent);
bundle.putString(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY, latestChanges); bundle.putString(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY, latestChanges);