Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert using StrictMode VmPolicy only in debug build type (fixes #2032) #2033

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions app/src/main/java/com/nutomic/syncthingandroid/SyncthingApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ public void onCreate() {

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.
// 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()
Expand Down