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

Commit

Permalink
Move accounts initialization to Activity onCreate (#2926)
Browse files Browse the repository at this point in the history
* Move accounts initialization to onActivityCreate

* Revert "Fixes an AC issue with FxA and the account state after rebooting (#2925)"

This reverts commit 83ebdc5.
  • Loading branch information
MortimerGoro authored Mar 5, 2020
1 parent 83ebdc5 commit 9688e63
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ protected void attachBaseContext(Context base) {

@Override
protected void onCreate(Bundle savedInstanceState) {
((VRBrowserApplication)getApplication()).onActivityCreate();
SettingsStore.getInstance(getBaseContext()).setPid(Process.myPid());
// Fix for infinite restart on startup crashes.
long count = SettingsStore.getInstance(getBaseContext()).getCrashRestartCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ public class VRBrowserApplication extends Application {
@Override
public void onCreate() {
super.onCreate();

mAppExecutors = new AppExecutors();
mPlaces = new Places(this);
mBitmapCache = new BitmapCache(this, mAppExecutors.diskIO(), mAppExecutors.mainThread());
mServices = new Services(this, mPlaces);
mAccounts = new Accounts(this);


TelemetryWrapper.init(this);
GleanMetricsService.init(this);
}

protected void onActivityCreate() {
mPlaces = new Places(this);
mServices = new Services(this, mPlaces);
mAccounts = new Accounts(this);
}

@Override
protected void attachBaseContext(Context base) {
Context context = LocaleUtils.init(base);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void init(Context aContext) {
GleanMetricsService.stop();
}
Configuration config = new Configuration(Configuration.DEFAULT_TELEMETRY_ENDPOINT, BuildConfig.BUILD_TYPE);
Glean.INSTANCE.initialize(aContext, config);
Glean.INSTANCE.initialize(aContext, true, config);
}

// It would be called when users turn on/off the setting of telemetry.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
addRepos(repositories)
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.mozilla.telemetry:glean-gradle-plugin:$versions.android_components"
classpath "org.mozilla.telemetry:glean-gradle-plugin:$versions.telemetry"
classpath "$deps.kotlin.plugin"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
6 changes: 3 additions & 3 deletions versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def versions = [:]
// GeckoView versions can be found here:
// https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/
versions.gecko_view = "75.0.20200304084140"
versions.android_components = "21.0.0"
versions.android_components = "28.0.1"
// Note that android-components also depends on application-services,
// and in fact is our main source of appservices-related functionality.
// The version number below tracks the application-services version
// that we depend on directly for its rustlog package, and it's important
// that it be kept insync with the version used by android-components above.
versions.mozilla_appservices = "0.42.2"
versions.mozilla_appservices = "0.48.2"
versions.mozilla_speech = "1.0.11"
versions.openwnn = "1.3.7"
versions.google_vr = "1.190.0"
Expand All @@ -52,7 +52,7 @@ versions.snakeyaml = "1.24"
versions.gson = "2.8.5"
versions.robolectric = "4.2.1"
versions.work = "2.2.0"
versions.telemetry = "22.0.0"
versions.telemetry = "24.1.0"
ext.versions = versions

def deps = [:]
Expand Down

0 comments on commit 9688e63

Please sign in to comment.