@Override public void onCreate() { ACRA.init(this); ACRA.getErrorReporter().setReportSender( new TomahawkHttpSender(ACRA.getConfig().httpMethod(), ACRA.getConfig().reportType(), null)); StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder().detectCustomSlowCalls().detectDiskReads() .detectDiskWrites().detectNetwork().penaltyLog().build()); try { StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects() .detectLeakedClosableObjects() .setClassInstanceLimit(Class.forName(PlaybackService.class.getName()), 1) .penaltyLog().build()); } catch (ClassNotFoundException e) { Log.e(TAG, e.toString()); } super.onCreate(); sApplicationContext = getApplicationContext(); }
@Override public void onCreate() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectCustomSlowCalls() .detectNetwork() .penaltyLog() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .detectLeakedRegistrationObjects() .detectLeakedClosableObjects() .detectActivityLeaks() .detectFileUriExposure() .penaltyLog() .penaltyDeath() .build()); } super.onCreate(); DeveloperTools.setup(this); mDefaultExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); Thread.setDefaultUncaughtExceptionHandler(this); }
@Override public void onCreate() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectCustomSlowCalls() .detectNetwork() .penaltyLog() .penaltyDeath() .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectActivityLeaks() .detectLeakedClosableObjects() .detectLeakedRegistrationObjects() .detectLeakedSqlLiteObjects() .penaltyLog() .penaltyDeath() .build()); } super.onCreate(); if (Settings.getVersion(this) != BuildConfig.VERSION_CODE) { Settings.setVersion(this); } DeveloperTools.setup(this); }
private static StrictMode.ThreadPolicy.Builder newThreadPolicyBuilder() { return new StrictMode.ThreadPolicy.Builder() .detectCustomSlowCalls() .penaltyLog(); }