ik.java 2.81 KB
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build.VERSION;
import com.google.android.gms.common.internal.zzac;
import com.google.android.gms.internal.zzry;
import com.google.android.gms.internal.zzsc;
import com.google.android.gms.internal.zztd;

public class ik
  extends BroadcastReceiver
{
  static final String a = ik.class.getName();
  final zzsc b;
  boolean c;
  boolean d;
  
  public ik(zzsc paramzzsc)
  {
    zzac.zzw(paramzzsc);
    this.b = paramzzsc;
  }
  
  final void a()
  {
    this.b.zznS();
    this.b.zzmA();
  }
  
  public final void b()
  {
    if (!this.c) {
      return;
    }
    this.b.zznS().zzbP("Unregistering connectivity change receiver");
    this.c = false;
    this.d = false;
    Context localContext = this.b.getContext();
    try
    {
      localContext.unregisterReceiver(this);
      return;
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      this.b.zznS().zze("Failed to unregister the network broadcast receiver", localIllegalArgumentException);
    }
  }
  
  public final void c()
  {
    int i = Build.VERSION.SDK_INT;
    Context localContext = this.b.getContext();
    Intent localIntent = new Intent("com.google.analytics.RADIO_POWERED");
    localIntent.addCategory(localContext.getPackageName());
    localIntent.putExtra(a, true);
    localContext.sendOrderedBroadcast(localIntent, null);
  }
  
  final boolean d()
  {
    Object localObject = (ConnectivityManager)this.b.getContext().getSystemService("connectivity");
    try
    {
      localObject = ((ConnectivityManager)localObject).getActiveNetworkInfo();
      if (localObject != null)
      {
        boolean bool = ((NetworkInfo)localObject).isConnected();
        if (bool) {
          return true;
        }
      }
      return false;
    }
    catch (SecurityException localSecurityException) {}
    return false;
  }
  
  public void onReceive(Context paramContext, Intent paramIntent)
  {
    a();
    paramContext = paramIntent.getAction();
    this.b.zznS().zza("NetworkBroadcastReceiver received action", paramContext);
    if ("android.net.conn.CONNECTIVITY_CHANGE".equals(paramContext))
    {
      boolean bool = d();
      if (this.d != bool)
      {
        this.d = bool;
        this.b.zzmA().zzW(bool);
      }
    }
    do
    {
      return;
      if (!"com.google.analytics.RADIO_POWERED".equals(paramContext)) {
        break;
      }
    } while (paramIntent.hasExtra(a));
    this.b.zzmA().zznO();
    return;
    this.b.zznS().zzd("NetworkBroadcastReceiver received unknown action", paramContext);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/ik.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */