Skip to content

Commit

Permalink
always enable strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Nov 28, 2022
1 parent f9e500b commit f5e31d0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions app/src/main/java/com/owncloud/android/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public PowerManagementService getPowerManagementService() {

private String getAppProcessName() {
String processName = "";
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
ActivityManager manager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
final int ownPid = android.os.Process.myPid();
final List<ActivityManager.RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
Expand Down Expand Up @@ -488,19 +488,17 @@ private void fixStoragePath() {
}

private void enableStrictMode() {
if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectAll()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectAll()
.penaltyLog()
.build());
}
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.penaltyLog()
.build());
}

public static void initSyncOperations(
Expand Down

0 comments on commit f5e31d0

Please sign in to comment.