mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Refactoring getPreferenceKey method
This method was returnning a constant and getting inlined by proguard. Change-Id: I87348e25b21483adc1b27d16f99dec4b73205701
This commit is contained in:
@@ -71,7 +71,7 @@ public class MigrateFromRestoreTask {
|
||||
public MigrateFromRestoreTask(Context context) {
|
||||
mContext = context;
|
||||
|
||||
SharedPreferences prefs = prefs(context);
|
||||
SharedPreferences prefs = Utilities.getPrefs(context);
|
||||
Point sourceSize = parsePoint(prefs.getString(KEY_MIGRATION_SOURCE_SIZE, ""));
|
||||
mSrcX = sourceSize.x;
|
||||
mSrcY = sourceSize.y;
|
||||
@@ -745,23 +745,19 @@ public class MigrateFromRestoreTask {
|
||||
|
||||
public static void markForMigration(Context context, int srcX, int srcY,
|
||||
HashSet<String> widgets) {
|
||||
prefs(context).edit()
|
||||
Utilities.getPrefs(context).edit()
|
||||
.putString(KEY_MIGRATION_SOURCE_SIZE, srcX + "," + srcY)
|
||||
.putStringSet(KEY_MIGRATION_WIDGET_MINSIZE, widgets)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public static boolean shouldRunTask(Context context) {
|
||||
return !TextUtils.isEmpty(prefs(context).getString(KEY_MIGRATION_SOURCE_SIZE, ""));
|
||||
return !TextUtils.isEmpty(Utilities.getPrefs(context).getString(KEY_MIGRATION_SOURCE_SIZE, ""));
|
||||
}
|
||||
|
||||
public static void clearFlags(Context context) {
|
||||
prefs(context).edit().remove(KEY_MIGRATION_SOURCE_SIZE)
|
||||
Utilities.getPrefs(context).edit().remove(KEY_MIGRATION_SOURCE_SIZE)
|
||||
.remove(KEY_MIGRATION_WIDGET_MINSIZE).commit();
|
||||
}
|
||||
|
||||
private static SharedPreferences prefs(Context context) {
|
||||
return context.getSharedPreferences(LauncherAppState.getSharedPreferencesKey(),
|
||||
Context.MODE_PRIVATE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user