public ec(Context context) {
   boolean z = true;
   AudioManager audioManager = (AudioManager) context.getSystemService("audio");
   ConnectivityManager connectivityManager =
       (ConnectivityManager) context.getSystemService("connectivity");
   DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
   Locale locale = Locale.getDefault();
   PackageManager packageManager = context.getPackageManager();
   TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
   Intent registerReceiver =
       context.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
   this.rb = audioManager.getMode();
   this.rc = m947a(packageManager, "geo:0,0?q=donuts") != null;
   this.rd = m947a(packageManager, "http://www.google.com") != null;
   this.re = telephonyManager.getNetworkOperator();
   this.rf = locale.getCountry();
   this.rg = et.bV();
   this.rh = audioManager.isMusicActive();
   this.ri = audioManager.isSpeakerphoneOn();
   this.rj = locale.getLanguage();
   this.rk = m948a(packageManager);
   this.rl = audioManager.getStreamVolume(3);
   this.rm = m946a(context, connectivityManager, packageManager);
   this.rn = telephonyManager.getNetworkType();
   this.ro = telephonyManager.getPhoneType();
   this.rp = audioManager.getRingerMode();
   this.rq = audioManager.getStreamVolume(2);
   this.rr = displayMetrics.density;
   this.rs = displayMetrics.widthPixels;
   this.rt = displayMetrics.heightPixels;
   if (registerReceiver != null) {
     int intExtra = registerReceiver.getIntExtra(NotificationCompatApi21.CATEGORY_STATUS, -1);
     this.ru =
         (double)
             (((float) registerReceiver.getIntExtra("level", -1))
                 / ((float) registerReceiver.getIntExtra("scale", -1)));
     if (!(intExtra == 2 || intExtra == 5)) {
       z = false;
     }
     this.rv = z;
   } else {
     this.ru = -1.0d;
     this.rv = false;
   }
   if (VERSION.SDK_INT >= 16) {
     this.rw = connectivityManager.isActiveNetworkMetered();
     if (connectivityManager.getActiveNetworkInfo() != null) {
       this.rx = connectivityManager.getActiveNetworkInfo().getDetailedState().ordinal();
       return;
     } else {
       this.rx = -1;
       return;
     }
   }
   this.rw = false;
   this.rx = -1;
 }
  @SuppressLint("NewApi")
  private static boolean downloadNeedsWarning(Context context) {
    ConnectivityManager cm =
        (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      return cm.isActiveNetworkMetered();
    }

    NetworkInfo info = cm.getActiveNetworkInfo();
    return info == null || info.getType() != ConnectivityManager.TYPE_WIFI;
  }
 public static boolean isActiveNetworkMetered(ConnectivityManager paramConnectivityManager) {
   return paramConnectivityManager.isActiveNetworkMetered();
 }
Exemple #4
0
 public ec(Context context)
 {
     boolean flag1 = true;
     super();
     AudioManager audiomanager = (AudioManager)context.getSystemService("audio");
     ConnectivityManager connectivitymanager = (ConnectivityManager)context.getSystemService("connectivity");
     DisplayMetrics displaymetrics = context.getResources().getDisplayMetrics();
     Locale locale = Locale.getDefault();
     PackageManager packagemanager = context.getPackageManager();
     TelephonyManager telephonymanager = (TelephonyManager)context.getSystemService("phone");
     Intent intent = context.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
     rb = audiomanager.getMode();
     boolean flag;
     if (a(packagemanager, "geo:0,0?q=donuts") != null)
     {
         flag = true;
     } else
     {
         flag = false;
     }
     rc = flag;
     if (a(packagemanager, "http://www.google.com") != null)
     {
         flag = true;
     } else
     {
         flag = false;
     }
     rd = flag;
     re = telephonymanager.getNetworkOperator();
     rf = locale.getCountry();
     rh = audiomanager.isMusicActive();
     ri = audiomanager.isSpeakerphoneOn();
     rj = locale.getLanguage();
     rk = a(packagemanager);
     rl = audiomanager.getStreamVolume(3);
     rm = a(context, connectivitymanager, packagemanager);
     rn = telephonymanager.getNetworkType();
     ro = telephonymanager.getPhoneType();
     rp = audiomanager.getRingerMode();
     rq = audiomanager.getStreamVolume(2);
     rr = displaymetrics.density;
     rs = displaymetrics.widthPixels;
     rt = displaymetrics.heightPixels;
     if (intent != null)
     {
         int i = intent.getIntExtra("status", -1);
         int j = intent.getIntExtra("level", -1);
         int k = intent.getIntExtra("scale", -1);
         ru = (float)j / (float)k;
         flag = flag1;
         if (i != 2)
         {
             if (i == 5)
             {
                 flag = flag1;
             } else
             {
                 flag = false;
             }
         }
         rv = flag;
     } else
     {
         ru = -1D;
         rv = false;
     }
     if (android.os.Build.VERSION.SDK_INT >= 16)
     {
         rw = connectivitymanager.isActiveNetworkMetered();
         if (connectivitymanager.getActiveNetworkInfo() != null)
         {
             rx = connectivitymanager.getActiveNetworkInfo().getDetailedState().ordinal();
             return;
         } else
         {
             rx = -1;
             return;
         }
     } else
     {
         rw = false;
         rx = -1;
         return;
     }
 }