Improve browser startup time
A number of optimizations are made to improve the time to interact with the UI quicker.
Steps are made to parallelize the web engine initialization while others removed
impediments to the UI bring up.
Changes:
- Engine Initialization is moved to an async task.
- A new NoShow BrowserLauncher activity is added to chain-load BrowserActivity at startup
obviating the blank white screen shown.
- Native libraries are loaded asynchronously in a background thread.
- ResourceExtractor is started much earlier than before.
- BrowserSettings is synced to native only after engine initialization.
- Other parts of UI are made aware of engine initialization state to throttle actions.
Change-Id: Icd4959769fa9813170baf7023c46b696b30dfed1
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 73940be..2bd09ba 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -200,7 +200,7 @@
// FIXME, temp address onPrepareMenu performance problem.
// When we move everything out of view, we should rewrite this.
private int mCurrentMenuState = 0;
- private int mMenuState = R.id.MAIN_MENU;
+ private int mMenuState = EMPTY_MENU;
private int mOldMenuState = EMPTY_MENU;
private Menu mCachedMenu;
@@ -279,6 +279,7 @@
@Override
public void start(final Intent intent) {
+ mMenuState = R.id.MAIN_MENU;
WebView.setShouldMonitorWebCoreThread();
// mCrashRecoverHandler has any previously saved state.
mCrashRecoveryHandler.startRecovery(intent);