| Index: chrome/android/java/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsController.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsController.java b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsController.java
|
| index beb00e1ed8c38b41521199e430ffef28a5f7477d..00703af4faa9cc1a271a94865514e845c97ea6a9 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsController.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsController.java
|
| @@ -10,9 +10,9 @@ import android.content.Context;
|
| import android.content.SharedPreferences;
|
| import android.os.AsyncTask;
|
| import android.os.Bundle;
|
| -import android.preference.PreferenceManager;
|
|
|
| import org.chromium.base.ApplicationStatus;
|
| +import org.chromium.base.ContextUtils;
|
| import org.chromium.base.Log;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.components.invalidation.PendingInvalidation;
|
| @@ -51,7 +51,7 @@ public class DelayedInvalidationsController {
|
| * @return whether there were any invalidations pending to be notified.
|
| */
|
| public boolean notifyPendingInvalidations(final Context context) {
|
| - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
| + SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
|
| String accountName = prefs.getString(DELAYED_ACCOUNT_NAME, null);
|
| if (accountName == null) {
|
| Log.d(TAG, "No pending invalidations.");
|
| @@ -89,7 +89,7 @@ public class DelayedInvalidationsController {
|
| */
|
| @VisibleForTesting
|
| void addPendingInvalidation(Context context, String account, PendingInvalidation invalidation) {
|
| - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
| + SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
|
| String oldAccount = prefs.getString(DELAYED_ACCOUNT_NAME, null);
|
| // Make sure to construct a new set so it can be modified safely. See crbug.com/568369.
|
| Set<String> invals = new HashSet<String>(
|
| @@ -110,7 +110,7 @@ public class DelayedInvalidationsController {
|
| }
|
|
|
| private List<Bundle> popPendingInvalidations(final Context context) {
|
| - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
| + SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
|
| assert prefs.contains(DELAYED_ACCOUNT_NAME);
|
| Set<String> savedInvalidations = prefs.getStringSet(DELAYED_INVALIDATIONS, null);
|
| clearPendingInvalidations(context);
|
| @@ -135,7 +135,7 @@ public class DelayedInvalidationsController {
|
| @VisibleForTesting
|
| public void clearPendingInvalidations(Context context) {
|
| SharedPreferences.Editor editor =
|
| - PreferenceManager.getDefaultSharedPreferences(context).edit();
|
| + ContextUtils.getAppSharedPreferences().edit();
|
| editor.putString(DELAYED_ACCOUNT_NAME, null);
|
| editor.putStringSet(DELAYED_INVALIDATIONS, null);
|
| editor.apply();
|
|
|