Move SharedPreferences code to its own class.
Bug: 251502424 Test: Code compiled correctly. Change-Id: Iea0d6ab2999504117546ee0f7adc0c7b8b45c065
This commit is contained in:
1 parent
698239e16a
commit
146701ca3e
30 files changed
+88
-72
No files matched your search
@@ -27,7 +27,6 @@ import android.app.ActivityManager;
|
||||
import android.app.Person;
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.LauncherActivityInfo;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
@@ -509,18 +508,6 @@ public final class Utilities {
|
||||
return spanned;
|
||||
}
|
||||
|
||||
public static SharedPreferences getPrefs(Context context) {
|
||||
// Use application context for shared preferences, so that we use a single cached instance
|
||||
return context.getApplicationContext().getSharedPreferences(
|
||||
LauncherFiles.SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static SharedPreferences getDevicePrefs(Context context) {
|
||||
// Use application context for shared preferences, so that we use a single cached instance
|
||||
return context.getApplicationContext().getSharedPreferences(
|
||||
LauncherFiles.DEVICE_PREFERENCES_KEY, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static boolean isWallpaperSupported(Context context) {
|
||||
return context.getSystemService(WallpaperManager.class).isWallpaperSupported();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user