forked from syncthing/syncthing-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSyncthingApp.java
45 lines (34 loc) · 1.38 KB
/
SyncthingApp.java
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
package com.nutomic.syncthingandroid;
import android.app.Application;
import android.os.StrictMode;
import com.google.android.material.color.DynamicColors;
import com.nutomic.syncthingandroid.di.DaggerComponent;
import com.nutomic.syncthingandroid.di.DaggerDaggerComponent;
import com.nutomic.syncthingandroid.di.SyncthingModule;
import com.nutomic.syncthingandroid.util.Languages;
import javax.inject.Inject;
public class SyncthingApp extends Application {
@Inject DaggerComponent mComponent;
@Override
public void onCreate() {
DynamicColors.applyToActivitiesIfAvailable(this);
super.onCreate();
DaggerDaggerComponent.builder()
.syncthingModule(new SyncthingModule(this))
.build()
.inject(this);
new Languages(this).setLanguage(this);
// The main point here is to use a VM policy without
// `detectFileUriExposure`, as that leads to exceptions when e.g.
// opening the ignores file. And it's enabled by default.
// We might want to disable `detectAll` and `penaltyLog` on release (non-RC) builds too.
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.build();
StrictMode.setVmPolicy(policy);
}
public DaggerComponent component() {
return mComponent;
}
}