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

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

Issue 2270563002: Expand the workaround for Strict Mode issues on L Consumer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just changed a comment. Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
index cd02595d8c2e8f70ba16068de3a6ef2c6eb40616..cb22264fd91a40aea2ddc59ddb74ddb3e23349cf 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -342,22 +342,21 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
WarmupManager.getInstance().transferViewHierarchyTo(contentParent);
contentParent.removeView(placeHolderView);
} else {
- // Allow disk access for the setContentView call.
- // On certain android configurations setContentView results in disk writes outside of
- // our control. So, we have to disable StrictMode to work. See crbug.com/639352.
- StrictMode.ThreadPolicy oldPolicy = StrictMode.getThreadPolicy();
- StrictMode.allowThreadDiskWrites();
+ // Allow disk access for the content view and toolbar container setup.
+ // On certain android devices this setup sequence results in disk writes outside
+ // of our control, so we have to disable StrictMode to work. See crbug.com/639352.
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
try {
setContentView(R.layout.main);
+ if (controlContainerLayoutId != NO_CONTROL_CONTAINER) {
+ ViewStub toolbarContainerStub =
+ ((ViewStub) findViewById(R.id.control_container_stub));
+ toolbarContainerStub.setLayoutResource(controlContainerLayoutId);
+ toolbarContainerStub.inflate();
+ }
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
- if (controlContainerLayoutId != NO_CONTROL_CONTAINER) {
- ViewStub toolbarContainerStub =
- ((ViewStub) findViewById(R.id.control_container_stub));
- toolbarContainerStub.setLayoutResource(controlContainerLayoutId);
- toolbarContainerStub.inflate();
- }
}
TraceEvent.end("onCreate->setContentView()");
mInflateInitialLayoutDurationMs = SystemClock.elapsedRealtime() - begin;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698