Startup optimization
Bug: 5019676
Save one thread by letting CrashRecoveryHandler re-use the BrowserSettings
startup thread
Lazy initialize the wake lock only if we need it (avoids IPC overhead at startup)
Slight ordering shuffle in BrowserActivity to maximize the usefulness of the
BrowserSettings startup thread
Change-Id: I1fc7412d492f93e0630008fa6030da9e0d726ebb
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index b2a83e1..3ab45f7 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -57,6 +57,13 @@
}
super.onCreate(icicle);
+ // If this was a web search request, pass it on to the default web
+ // search provider and finish this activity.
+ if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) {
+ finish();
+ return;
+ }
+
BrowserSettings settings = BrowserSettings.getInstance();
// render the browser in OpenGL
@@ -69,13 +76,6 @@
this.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
}
- // If this was a web search request, pass it on to the default web
- // search provider and finish this activity.
- if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) {
- finish();
- return;
- }
-
AccessibilityManager accessibilityManager = (AccessibilityManager)
getSystemService(ACCESSIBILITY_SERVICE);
if (accessibilityManager != null && accessibilityManager.isEnabled()) {