Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java

Issue 1874423002: 🍰 Migrate app shared preferences to ContextUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
index 32c8a236489bde7b688929e7b9d6bf9f9b9ebf97..44e8838341b16c7dc730d63d857e565bf488c85d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java
@@ -12,10 +12,10 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
-import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.util.SparseIntArray;
+import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.tab.Tab;
@@ -55,7 +55,7 @@ public class MediaCaptureNotificationService extends Service {
mContext = getApplicationContext();
mNotificationManager = (NotificationManager) mContext.getSystemService(
Context.NOTIFICATION_SERVICE);
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
+ mSharedPreferences = ContextUtils.getAppSharedPreferences();
super.onCreate();
}
@@ -244,7 +244,7 @@ public class MediaCaptureNotificationService extends Service {
private static boolean shouldStartService(Context context, int mediaType, int tabId) {
if (mediaType != MEDIATYPE_NO_MEDIA) return true;
SharedPreferences sharedPreferences =
- PreferenceManager.getDefaultSharedPreferences(context);
+ ContextUtils.getAppSharedPreferences();
Set<String> notificationIds =
sharedPreferences.getStringSet(WEBRTC_NOTIFICATION_IDS, null);
if (notificationIds != null
@@ -286,7 +286,7 @@ public class MediaCaptureNotificationService extends Service {
*/
public static void clearMediaNotifications(Context context) {
SharedPreferences sharedPreferences =
- PreferenceManager.getDefaultSharedPreferences(context);
+ ContextUtils.getAppSharedPreferences();
Set<String> notificationIds =
sharedPreferences.getStringSet(WEBRTC_NOTIFICATION_IDS, null);
if (notificationIds == null || notificationIds.isEmpty()) return;

Powered by Google App Engine
This is Rietveld 408576698