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/AndroidManifest.xml b/AndroidManifest.xml
index fb5e875..e4d6dfd 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -77,6 +77,19 @@
android:readPermission="com.android.swe.browser.permission.READ_HOMEPAGE"
android:writePermission="com.android.swe.browser.permission.WRITE_HOMEPAGE" />
</provider>
+
+ <activity android:name="BrowserLauncher"
+ android:theme="@android:style/Theme.NoDisplay" >
+ <!-- We are the main entry point of the browser. -->
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <category android:name="android.intent.category.APP_BROWSER" />
+ </intent-filter>
+ </activity>
+
<activity android:name="BrowserActivity"
android:label="@string/application_name_swe"
android:launchMode="singleTask"
@@ -84,6 +97,7 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:theme="@style/BrowserTheme"
android:windowSoftInputMode="adjustResize" >
+
<intent-filter>
<action android:name="android.speech.action.VOICE_SEARCH_RESULTS" />
<category android:name="android.intent.category.DEFAULT" />
@@ -130,14 +144,6 @@
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
- <!-- We are also the main entry point of the browser. -->
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.LAUNCHER" />
- <category android:name="android.intent.category.BROWSABLE" />
- <category android:name="android.intent.category.APP_BROWSER" />
- </intent-filter>
<!-- The maps app is a much better experience, so it's not
worth having this at all... especially for a demo!
<intent-filter android:label="Map In Browser">