blob: fb8c21883baa8c5bdc7bc72e27213c7307811962 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
package de.danoeh.antennapod;
import android.app.Application;
import android.os.StrictMode;
import com.google.android.material.color.DynamicColors;
import de.danoeh.antennapod.spa.SPAUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.EventBusException;
/** Main application class. */
public class PodcastApp extends Application {
@Override
public void onCreate() {
super.onCreate();
Thread.setDefaultUncaughtExceptionHandler(new CrashReportWriter());
RxJavaErrorHandlerSetup.setupRxJavaErrorHandler();
if (BuildConfig.DEBUG) {
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.penaltyLog()
.penaltyDropBox()
.detectActivityLeaks()
.detectLeakedClosableObjects()
.detectLeakedRegistrationObjects();
StrictMode.setVmPolicy(builder.build());
}
try {
// Robolectric calls onCreate for every test, which causes problems with static members
EventBus.builder()
.addIndex(new ApEventBusIndex())
.logNoSubscriberMessages(false)
.sendNoSubscriberEvent(false)
.installDefaultEventBus();
} catch (EventBusException e) {
e.printStackTrace();
}
DynamicColors.applyToActivitiesIfAvailable(this);
ClientConfigurator.initialize(this);
PreferenceUpgrader.checkUpgrades(this);
SPAUtil.sendSPAppsQueryFeedsIntent(this);
}
}
|