Force engine initialization during onCreate
- During stress test on browser we noticed that
registerActivityLifecycleCallbacks.onActivityCreated was not
getting called. This call was required to ensure that the engine was
initialized before launching an activity.Added code to ensure engine is
initialized in onCreate of activity that use engine API's directly.
- Added null check for ComboView.hide method
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java
index 9bb74b5..4840d43 100644
--- a/src/com/android/browser/BrowserPreferencesPage.java
+++ b/src/com/android/browser/BrowserPreferencesPage.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
+import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceActivity;
@@ -65,13 +66,12 @@
@Override
public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- if (icicle != null) {
- return;
- }
if (!EngineInitializer.isInitialized()) {
Log.e(LOGTAG, "Engine not Initialized");
- finish();
+ EngineInitializer.initializeSync((Context) getApplicationContext());
+ }
+ super.onCreate(icicle);
+ if (icicle != null) {
return;
}