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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java

Issue 1334533004: Hide existing StrictMode violations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes per review. Created 5 years, 3 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/externalnav/ExternalNavigationHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
index 61df77168c025271076ac1411a4b781a66d637ae..bcb7081cbf87efb6a95def5af52bceed5011691c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
@@ -8,6 +8,7 @@ import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
+import android.os.StrictMode;
import android.provider.Browser;
import android.text.TextUtils;
import android.webkit.WebView;
@@ -250,9 +251,18 @@ public class ExternalNavigationHandler {
return OverrideUrlLoadingResult.NO_OVERRIDE;
}
+ boolean canResolveActivity = false;
+ // Temporarily allowing disk access while fixing. TODO: http://crbug.com/527415
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ canResolveActivity = mDelegate.canResolveActivity(intent);
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
+
// check whether the intent can be resolved. If not, we will see
// whether we can download it from the Market.
- if (!mDelegate.canResolveActivity(intent)) {
+ if (!canResolveActivity) {
if (hasBrowserFallbackUrl) {
return clobberCurrentTabWithFallbackUrl(browserFallbackUrl, params);
}

Powered by Google App Engine
This is Rietveld 408576698