Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Ensure the pref overrides are written out before GeckoRuntime is crea…
Browse files Browse the repository at this point in the history
…ted (#3546)
  • Loading branch information
bluemarvin committed Jun 25, 2020
1 parent 68128fb commit 15a71a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ protected void attachBaseContext(Context base) {

@Override
protected void onCreate(Bundle savedInstanceState) {
Bundle extras = getIntent() != null ? getIntent().getExtras() : null;
SessionStore.prefOverrides(this, extras);
((VRBrowserApplication)getApplication()).onActivityCreate();
SettingsStore.getInstance(getBaseContext()).setPid(Process.myPid());
// Fix for infinite restart on startup crashes.
Expand All @@ -251,8 +253,7 @@ protected void onCreate(Bundle savedInstanceState) {

BitmapCache.getInstance(this).onCreate();

Bundle extras = getIntent() != null ? getIntent().getExtras() : null;
SessionStore.get().initialize(this, extras);
SessionStore.get().initialize(this);
SessionStore.get().setLocales(LocaleUtils.getPreferredLanguageTags(this));

EngineProvider.INSTANCE.getOrCreateRuntime(this).appendAppNotesToCrashReport("Firefox Reality " + BuildConfig.VERSION_NAME + "-" + BuildConfig.VERSION_CODE + "-" + BuildConfig.FLAVOR + "-" + BuildConfig.BUILD_TYPE + " (" + BuildConfig.GIT_HASH + ")");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ private SessionStore() {
mSessions = new ArrayList<>();
}

public void initialize(Context context, Bundle aExtras) {
mContext = context;
mMainExecutor = ((VRBrowserApplication)context.getApplicationContext()).getExecutors().mainThread();

public static void prefOverrides(Context context, Bundle aExtras) {
// FIXME: Once GeckoView has a prefs API
SessionUtils.vrPrefsWorkAround(context, aExtras);
}

public void initialize(Context context) {
mContext = context;
mMainExecutor = ((VRBrowserApplication)context.getApplicationContext()).getExecutors().mainThread();

mRuntime = EngineProvider.INSTANCE.getOrCreateRuntime(context);

Expand Down

0 comments on commit 15a71a8

Please sign in to comment.