|
1 | 1 | package oly.netpowerctrl;
|
2 | 2 |
|
3 | 3 | import android.app.Application;
|
4 |
| -import android.os.Build; |
5 | 4 | import android.os.Handler;
|
6 | 5 |
|
7 | 6 | import org.acra.ACRA;
|
|
25 | 24 | public class App extends Application {
|
26 | 25 | static final boolean isDebugFlag = BuildConfig.BUILD_TYPE.equals("debug");
|
27 | 26 | public static App instance;
|
28 |
| - public static boolean useErrorReporter = (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT); // Lollipop acra does not work; |
| 27 | + //public static boolean useErrorReporter = (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT); // Lollipop acra does not work; |
29 | 28 | private final GuiThreadHandler mainThreadHandler = new GuiThreadHandler();
|
30 | 29 | private LifecycleHandler lifecycleHandler;
|
31 | 30 |
|
@@ -76,23 +75,22 @@ public static void setErrorReportContentLogFile(String filename) {
|
76 | 75 | public void onCreate() {
|
77 | 76 | super.onCreate();
|
78 | 77 | LoadStoreIconData.onCreate(this);
|
79 |
| - if (useErrorReporter) { |
80 |
| - ACRAConfiguration config = ACRA.getNewDefaultConfig(this); |
81 |
| - config.setFormUri(getString(R.string.acralyzer_http_url)); |
82 |
| - config.setFormUriBasicAuthLogin(getString(R.string.acralyzer_http_login)); |
83 |
| - config.setFormUriBasicAuthPassword(getString(R.string.acralyzer_http_pwd)); |
84 |
| - config.setReportType(HttpSender.Type.JSON); |
85 |
| - config.setResToastText(R.string.crash_toast_text); |
86 |
| - config.setBuildConfigClass(BuildConfig.class); |
87 |
| - try { |
88 |
| - config.setMode(ReportingInteractionMode.TOAST); |
89 |
| - } catch (ACRAConfigurationException e) { |
90 |
| - e.printStackTrace(); |
91 |
| - } |
92 |
| - config.setCustomReportContent(new ReportField[]{ReportField.REPORT_ID, ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME, ReportField.PHONE_MODEL, ReportField.ANDROID_VERSION, ReportField.BUILD, ReportField.BRAND, ReportField.PRODUCT, ReportField.TOTAL_MEM_SIZE, ReportField.AVAILABLE_MEM_SIZE, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.USER_COMMENT, ReportField.USER_APP_START_DATE, ReportField.USER_CRASH_DATE, ReportField.USER_EMAIL, ReportField.IS_SILENT, ReportField.DEVICE_FEATURES, ReportField.SHARED_PREFERENCES, ReportField.THREAD_DETAILS}); |
93 |
| - ACRA.setConfig(config); |
94 |
| - ACRA.init(this); |
| 78 | + |
| 79 | + ACRAConfiguration config = ACRA.getNewDefaultConfig(this); |
| 80 | + config.setFormUri(getString(R.string.acralyzer_http_url)); |
| 81 | + config.setFormUriBasicAuthLogin(getString(R.string.acralyzer_http_login)); |
| 82 | + config.setFormUriBasicAuthPassword(getString(R.string.acralyzer_http_pwd)); |
| 83 | + config.setReportType(HttpSender.Type.JSON); |
| 84 | + config.setResToastText(R.string.crash_toast_text); |
| 85 | + config.setBuildConfigClass(BuildConfig.class); |
| 86 | + try { |
| 87 | + config.setMode(ReportingInteractionMode.TOAST); |
| 88 | + } catch (ACRAConfigurationException e) { |
| 89 | + e.printStackTrace(); |
95 | 90 | }
|
| 91 | + config.setCustomReportContent(new ReportField[]{ReportField.REPORT_ID, ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME, ReportField.PHONE_MODEL, ReportField.ANDROID_VERSION, ReportField.BUILD, ReportField.BRAND, ReportField.PRODUCT, ReportField.TOTAL_MEM_SIZE, ReportField.AVAILABLE_MEM_SIZE, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.USER_COMMENT, ReportField.USER_APP_START_DATE, ReportField.USER_CRASH_DATE, ReportField.USER_EMAIL, ReportField.IS_SILENT, ReportField.DEVICE_FEATURES, ReportField.SHARED_PREFERENCES, ReportField.THREAD_DETAILS}); |
| 92 | + ACRA.setConfig(config); |
| 93 | + ACRA.init(this); |
96 | 94 |
|
97 | 95 | lifecycleHandler = new LifecycleHandler();
|
98 | 96 | registerActivityLifecycleCallbacks(lifecycleHandler);
|
|
0 commit comments