package com.wkovacs64.mtorch;

import android.app.Application;
import android.os.Build;
import android.os.StrictMode;

import timber.log.Timber;

public final class CustomApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        if (BuildConfig.DEBUG) {
            // Initialize Timber logging library
            Timber.plant(new Timber.DebugTree());

            // Enable StrictMode for debug builds
            enabledStrictMode();
        }
    }

    private void enabledStrictMode() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                    .detectAll()
                    .penaltyLog()
                    .penaltyDialog()
                    .build());
        }
    }
}

@@ -246,35 +246,8 @@
 ) %7B%0A
-        super.onCreate();%0A%0A
     
@@ -271,24 +271,24 @@
 ig.DEBUG) %7B%0A
+
             
@@ -463,24 +463,51 @@
 );%0A        %7D
+%0A%0A        super.onCreate();
 %0A    %7D%0A%0A    
@@ -753,24 +753,24 @@
 enaltyLog()%0A
-
             
@@ -825,16 +825,183 @@
 ild());%0A
+            StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()%0A                    .detectAll()%0A                    .penaltyLog()%0A                    .build());%0A
         

Set VM policy for Strict Mode