[DataStore] Migrate LocaleNotification SharedPreferences to BackupRestoreStorage
Bug: 325144964 Test: Manual tests Change-Id: I195ee91f29030fcfe7176ed0c18fb2e2d0d40257
This commit is contained in:
@@ -19,8 +19,11 @@ package com.android.settings.localepicker;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.settingslib.datastore.SharedPreferencesStorage;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -43,6 +46,12 @@ public class LocaleNotificationDataManager {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
/** Returns the underlying {@link SharedPreferences} storage. */
|
||||
@NonNull
|
||||
public static SharedPreferencesStorage getSharedPreferencesStorage(@NonNull Context context) {
|
||||
return new SharedPreferencesStorage(context, LOCALE_NOTIFICATION, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
private static SharedPreferences getSharedPreferences(Context context) {
|
||||
return context.getSharedPreferences(LOCALE_NOTIFICATION, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user