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 29, 2022
1 parent 4a0182a commit 5d6920c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 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,20 +488,17 @@ private void fixStoragePath() {
}

private void enableStrictMode() {
if (BuildConfig.DEBUG && BuildConfig.RUNTIME_PERF_ANALYSIS) {
Log_OC.d(TAG, "Enabling StrictMode");
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 5d6920c

Please sign in to comment.