Android Open Source - AndroidRandomWallpaper Strict Mode Wrapper






From Project

Back to project page AndroidRandomWallpaper.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidRandomWallpaper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.elbauldelprogramador.randomwallpaper.util;
/*from  www  . java2s  . c  o m*/
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.StrictMode;

public class StrictModeWrapper {
  public static void init(Context context) {
    // check if android:debuggable is set to true
    int appFlags = context.getApplicationInfo().flags;
    if ((appFlags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
      StrictMode.setThreadPolicy(
      new StrictMode.ThreadPolicy.Builder()
        .detectDiskReads()
        .detectDiskWrites()
        .detectNetwork()
        .penaltyLog()
        .build());
      StrictMode.setVmPolicy(
      new StrictMode.VmPolicy.Builder()
        .detectLeakedSqlLiteObjects()
        .penaltyLog()
        .penaltyDeath()
        .build());
      }

  }
}




Java Source Code List

com.elbauldelprogramador.randomwallpaper.Service.java
com.elbauldelprogramador.randomwallpaper.activities.AboutTheApp.java
com.elbauldelprogramador.randomwallpaper.activities.MainActivity.java
com.elbauldelprogramador.randomwallpaper.reveivers.AlarmReceiver.java
com.elbauldelprogramador.randomwallpaper.reveivers.OnBootReceiver.java
com.elbauldelprogramador.randomwallpaper.util.RWGlobal.java
com.elbauldelprogramador.randomwallpaper.util.SimpleFileExplorer.java
com.elbauldelprogramador.randomwallpaper.util.StrictModeWrapper.java