From 1d951f5f8af985248d207e6404d52be729bb0956 Mon Sep 17 00:00:00 2001 From: albendz <12453997+albendz@users.noreply.github.com> Date: Fri, 14 Dec 2018 06:34:37 -0800 Subject: [PATCH] Init ACRA when starting commons application (#2091) * Init ACRA when starting commons application * Remove redundant ACRA initialization function --- .../java/fr/free/nrw/commons/CommonsApplication.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java index 72518ad58..61beb9a6b 100644 --- a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java +++ b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java @@ -91,6 +91,7 @@ public class CommonsApplication extends Application { @Override public void onCreate() { super.onCreate(); + ACRA.init(this); if (BuildConfig.DEBUG) { //FIXME: Traceur should be disabled for release builds until error fixed //See https://github.com/commons-app/apps-android-commons/issues/1877 @@ -118,7 +119,6 @@ public class CommonsApplication extends Application { // Empty temp directory in case some temp files are created and never removed. ContributionUtils.emptyTemporaryDirectory(); - initAcra(); if (BuildConfig.DEBUG && !isRoboUnitTest()) { Stetho.initializeWithDefaults(this); } @@ -152,16 +152,6 @@ public class CommonsApplication extends Application { Timber.plant(new Timber.DebugTree()); } - /** - * Remove ACRA's UncaughtExceptionHandler - * We do this because ACRA's handler spawns a new process possibly screwing up with a few things - */ - private void initAcra() { - Thread.UncaughtExceptionHandler exceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); - ACRA.init(this); - Thread.setDefaultUncaughtExceptionHandler(exceptionHandler); - } - public static boolean isRoboUnitTest() { return "robolectric".equals(Build.FINGERPRINT); }