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

Ensure the pref overrides are written out before GeckoRuntime is created #3546

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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