Merge "Replace synchronous calls to shared prefs with async calls." into qt-dev

am: 61240f6c5a

Change-Id: Iaf133dc298fd7644abb41ef8f22c0317fa15f0cb
This commit is contained in:
Dave Mankoff
2019-04-19 22:05:32 -07:00
committed by android-build-merger

View File

@@ -42,12 +42,12 @@ public class PluginPrefs {
}
public Set<String> getPluginList() {
return mPluginActions;
return new ArraySet<>(mPluginActions);
}
public synchronized void addAction(String action) {
if (mPluginActions.add(action)){
mSharedPrefs.edit().putStringSet(PLUGIN_ACTIONS, mPluginActions).commit();
mSharedPrefs.edit().putStringSet(PLUGIN_ACTIONS, mPluginActions).apply();
}
}
@@ -56,6 +56,6 @@ public class PluginPrefs {
}
public static void setHasPlugins(Context context) {
context.getSharedPreferences(PREFS, 0).edit().putBoolean(HAS_PLUGINS, true).commit();
context.getSharedPreferences(PREFS, 0).edit().putBoolean(HAS_PLUGINS, true).apply();
}
}