Skip to content

Commit 5d6920c

Browse files
always enable strict mode
1 parent 4a0182a commit 5d6920c

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

app/src/main/java/com/owncloud/android/MainApp.java

+10-13
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public PowerManagementService getPowerManagementService() {
217217

218218
private String getAppProcessName() {
219219
String processName = "";
220-
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
220+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
221221
ActivityManager manager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
222222
final int ownPid = android.os.Process.myPid();
223223
final List<ActivityManager.RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
@@ -488,20 +488,17 @@ private void fixStoragePath() {
488488
}
489489

490490
private void enableStrictMode() {
491-
if (BuildConfig.DEBUG && BuildConfig.RUNTIME_PERF_ANALYSIS) {
492-
Log_OC.d(TAG, "Enabling StrictMode");
493-
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
494-
.detectDiskReads()
495-
.detectDiskWrites()
496-
.detectAll()
497-
.penaltyLog()
498-
.build());
499-
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
500-
.detectLeakedSqlLiteObjects()
501-
.detectLeakedClosableObjects()
491+
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
492+
.detectDiskReads()
493+
.detectDiskWrites()
494+
.detectAll()
502495
.penaltyLog()
503496
.build());
504-
}
497+
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
498+
.detectLeakedSqlLiteObjects()
499+
.detectLeakedClosableObjects()
500+
.penaltyLog()
501+
.build());
505502
}
506503

507504
public static void initSyncOperations(

0 commit comments

Comments
 (0)