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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java

Issue 1580813005: Whitelist known StrictMode violations to be fixed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/preferences/PrefServiceBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
index 81abafafc0b3adf65fef38cd4d3603fa47fed88c..6721711a59c4f0d7f92267cf3d2a24520bb7345b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.preferences;
import android.content.Context;
import android.content.SharedPreferences;
+import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.util.Log;
@@ -123,7 +124,14 @@ public final class PrefServiceBridge {
// images disabled.
setContentSettingEnabled(ContentSettingsType.CONTENT_SETTINGS_TYPE_IMAGES, true);
}
- preferences.edit().putInt(MIGRATION_PREF_KEY, MIGRATION_CURRENT_VERSION).commit();
+ // Temporarily allowing disk access. TODO: Fix. See http://crbug.com/577183
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ StrictMode.allowThreadDiskWrites();
+ try {
+ preferences.edit().putInt(MIGRATION_PREF_KEY, MIGRATION_CURRENT_VERSION).commit();
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698