1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-22 04:11:14 +00:00

Use StrictMode VmPolicy only in debug build type (#2002)

`StrictMode` makes sense mainly in for debug build types, enabling
it for release does not provide any value as it can add additional overhead and its logs going to be removed (because R8 strips them).
This commit is contained in:
Adam Szewera 2023-12-05 23:17:41 +01:00 committed by GitHub
parent ae27e7bb4d
commit f4ccad8329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,12 @@ public class SyncthingApp extends Application {
new Languages(this).setLanguage(this);
if (BuildConfig.DEBUG) {
setStrictMode();
}
}
private void setStrictMode() {
// Set VM policy to avoid crash when sending folder URI to file manager.
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder()
.detectAll()