mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-05 02:16:49 +00:00
Move SharedPreferences code to its own class.
Bug: 251502424 Test: Code compiled correctly. Change-Id: Iea0d6ab2999504117546ee0f7adc0c7b8b45c065
This commit is contained in:
@@ -29,7 +29,7 @@ import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.launcher3.InvariantDeviceProfile;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.LauncherPrefs;
|
||||
import com.android.launcher3.logging.StatsLogManager.LauncherEvent;
|
||||
|
||||
import java.util.Locale;
|
||||
@@ -58,7 +58,7 @@ public class DeviceGridState implements Comparable<DeviceGridState> {
|
||||
}
|
||||
|
||||
public DeviceGridState(Context context) {
|
||||
SharedPreferences prefs = Utilities.getPrefs(context);
|
||||
SharedPreferences prefs = LauncherPrefs.getPrefs(context);
|
||||
mGridSizeString = prefs.getString(KEY_WORKSPACE_SIZE, "");
|
||||
mNumHotseat = prefs.getInt(KEY_HOTSEAT_COUNT, -1);
|
||||
mDeviceType = prefs.getInt(KEY_DEVICE_TYPE, TYPE_PHONE);
|
||||
@@ -90,7 +90,7 @@ public class DeviceGridState implements Comparable<DeviceGridState> {
|
||||
* Stores the device state to shared preferences
|
||||
*/
|
||||
public void writeToPrefs(Context context) {
|
||||
Utilities.getPrefs(context).edit()
|
||||
LauncherPrefs.getPrefs(context).edit()
|
||||
.putString(KEY_WORKSPACE_SIZE, mGridSizeString)
|
||||
.putInt(KEY_HOTSEAT_COUNT, mNumHotseat)
|
||||
.putInt(KEY_DEVICE_TYPE, mDeviceType)
|
||||
|
||||
Reference in New Issue
Block a user