Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3336 Hotfix: Coordinates of picture are not uploaded #3339

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
import android.text.Editable;
import android.text.TextWatcher;

import com.google.gson.reflect.TypeToken;
import com.karumi.dexter.Dexter;
import com.karumi.dexter.listener.PermissionGrantedResponse;
import com.karumi.dexter.listener.single.BasePermissionListener;

import java.lang.reflect.Type;
import java.util.Collections;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;

import javax.inject.Inject;
import javax.inject.Named;
Expand Down Expand Up @@ -70,10 +74,23 @@ public void onCreate(Bundle savedInstanceState) {
return true;
});

if (defaultKvStore.getBoolean("has_user_manually_removed_location")) {
Type setType = new TypeToken<Set<String>>() {
}.getType();
Set<String> defaultExifTagsSet = defaultKvStore.getJson(Prefs.MANAGED_EXIF_TAGS, setType);
if (null == defaultExifTagsSet) {
defaultExifTagsSet = new HashSet<>();
}
defaultExifTagsSet.add(getString(R.string.exif_tag_location));
defaultKvStore.putJson(Prefs.MANAGED_EXIF_TAGS, defaultExifTagsSet);
}
MultiSelectListPreference multiSelectListPref = (MultiSelectListPreference) findPreference("manageExifTags");
if (multiSelectListPref != null) {
multiSelectListPref.setOnPreferenceChangeListener((preference, newValue) -> {
defaultKvStore.putJson(Prefs.MANAGED_EXIF_TAGS, newValue);
if (newValue instanceof HashSet && !((HashSet) newValue).contains(getString(R.string.exif_tag_location))) {
defaultKvStore.putBoolean("has_user_manually_removed_location", true);
}
return true;
});
}
Expand Down