Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move accounts initialization to Activity onCreate #2926

Merged
merged 2 commits into from
Mar 5, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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