Bug 1075644 - Move more things to after Gecko start; r=mfinkle
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1172,34 +1172,25 @@ public abstract class GeckoApp
}
});
// Workaround for <http://code.google.com/p/android/issues/detail?id=20915>.
try {
Class.forName("android.os.AsyncTask");
} catch (ClassNotFoundException e) {}
- MemoryMonitor.getInstance().init(getApplicationContext());
-
// GeckoAppShell is tightly coupled to us, rather than
// the app context, because various parts of Fennec (e.g.,
// GeckoScreenOrientation) use GAS to access the Activity in
// the guise of fetching a Context.
// When that's fixed, `this` can change to
// `(GeckoApplication) getApplication()` here.
GeckoAppShell.setContextGetter(this);
GeckoAppShell.setGeckoInterface(this);
- Tabs.getInstance().attachToContext(this);
- try {
- Favicons.initializeWithContext(this);
- } catch (Exception e) {
- Log.e(LOGTAG, "Exception starting favicon cache. Corrupt resources?", e);
- }
-
// Did the OS locale change while we were backgrounded? If so,
// we need to die so that Gecko will re-init add-ons that touch
// the UI.
// This is using a sledgehammer to crack a nut, but it'll do for
// now.
if (BrowserLocaleManager.getInstance().systemLocaleDidChange()) {
Log.i(LOGTAG, "System locale changed. Restarting.");
doRestart();
@@ -1233,16 +1224,25 @@ public abstract class GeckoApp
@Override
public void run() {
GeckoThread.setLaunchState(GeckoThread.LaunchState.Launched);
GeckoThread.createAndStart();
}
}, 1000 * 5 /* 5 seconds */);
}
+ MemoryMonitor.getInstance().init(getApplicationContext());
+
+ Tabs.getInstance().attachToContext(this);
+ try {
+ Favicons.initializeWithContext(this);
+ } catch (Exception e) {
+ Log.e(LOGTAG, "Exception starting favicon cache. Corrupt resources?", e);
+ }
+
Bundle stateBundle = getIntent().getBundleExtra(EXTRA_STATE_BUNDLE);
if (stateBundle != null) {
// Use the state bundle if it was given as an intent extra. This is
// only intended to be used internally via Robocop, so a boolean
// is read from a private shared pref to prevent other apps from
// injecting states.
final SharedPreferences prefs = getSharedPreferences();
if (prefs.getBoolean(PREFS_ALLOW_STATE_BUNDLE, false)) {