parent
12f9386fac
commit
95ce3d333e
|
@ -33,7 +33,6 @@ import android.os.Build;
|
||||||
import android.os.Build.VERSION;
|
import android.os.Build.VERSION;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.ContactsContract.PhoneLookup;
|
import android.provider.ContactsContract.PhoneLookup;
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
@ -377,7 +376,7 @@ public class GBApplication extends Application {
|
||||||
if (blacklist.isEmpty()) {
|
if (blacklist.isEmpty()) {
|
||||||
editor.putStringSet(GBPrefs.PACKAGE_BLACKLIST, null);
|
editor.putStringSet(GBPrefs.PACKAGE_BLACKLIST, null);
|
||||||
} else {
|
} else {
|
||||||
editor.putStringSet(GBPrefs.PACKAGE_BLACKLIST, blacklist);
|
Prefs.putStringSet(editor, GBPrefs.PACKAGE_BLACKLIST, blacklist);
|
||||||
}
|
}
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ package nodomain.freeyourgadget.gadgetbridge.util;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -162,4 +163,16 @@ public class Prefs {
|
||||||
public SharedPreferences getPreferences() {
|
public SharedPreferences getPreferences() {
|
||||||
return preferences;
|
return preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ugly workaround for Set<String> preferences not consistently applying.
|
||||||
|
* @param editor
|
||||||
|
* @param preference
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
public static void putStringSet(SharedPreferences.Editor editor, String preference, HashSet<String> value) {
|
||||||
|
editor.putStringSet(preference, null);
|
||||||
|
editor.commit();
|
||||||
|
editor.putStringSet(preference, new HashSet<>(value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue