[android] #4283 - enable strict mode in test app + fix strict mode warning related to releasing the surface

This commit is contained in:
Tobrun
2016-03-11 17:26:54 -05:00
parent c39bd344b5
commit 45e6ee1372
2 changed files with 17 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.testapp;
import android.app.Application;
import android.os.StrictMode;
import com.squareup.leakcanary.LeakCanary;
@@ -10,5 +11,17 @@ public class MapboxApplication extends Application {
public void onCreate() {
super.onCreate();
LeakCanary.install(this);
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork() // or .detectAll() for all detectable problems
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
.detectLeakedClosableObjects()
.penaltyLog()
.penaltyDeath()
.build());
}
}