0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-20 03:52:27 +02:00

Workaround the save set bug

This commit is contained in:
Arne Schwabe 2017-01-08 17:06:36 +01:00
parent db3fa686e9
commit 02c96933fc

View File

@ -22,7 +22,7 @@ public class ExternalAppDatabase {
mContext =c;
}
private final String PREFERENCES_KEY = "PREFERENCES_KEY";
private final String PREFERENCES_KEY = "allowed_apps";
boolean isAllowed(String packagename) {
Set<String> allowedapps = getExtAppList();
@ -46,7 +46,11 @@ public class ExternalAppDatabase {
private void saveExtAppList( Set<String> allowedapps) {
SharedPreferences prefs = Preferences.getDefaultSharedPreferences(mContext);
Editor prefedit = prefs.edit();
// Workaround for bug
prefedit.putStringSet(PREFERENCES_KEY, allowedapps);
int counter = prefs.getInt("counter", 0);
prefedit.putInt("counter", counter + 1);
prefedit.apply();
}