jimu-decompiled/sources/com/google/android/gms/measurement/internal/zzbb.java
2025-05-13 19:24:51 +02:00

64 lines
1.9 KiB
Java

package com.google.android.gms.measurement.internal;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.google.android.gms.common.internal.Preconditions;
/* loaded from: classes.dex */
class zzbb extends BroadcastReceiver {
private final zzfo a;
private boolean b;
private boolean c;
zzbb(zzfo zzfoVar) {
Preconditions.a(zzfoVar);
this.a = zzfoVar;
}
public final void a() {
this.a.o();
this.a.a().f();
this.a.a().f();
if (this.b) {
this.a.e().B().a("Unregistering connectivity change receiver");
this.b = false;
this.c = false;
try {
this.a.b().unregisterReceiver(this);
} catch (IllegalArgumentException e) {
this.a.e().t().a("Failed to unregister the network broadcast receiver", e);
}
}
}
public final void b() {
this.a.o();
this.a.a().f();
if (this.b) {
return;
}
this.a.b().registerReceiver(this, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
this.c = this.a.m().u();
this.a.e().B().a("Registering connectivity change receiver. Network connected", Boolean.valueOf(this.c));
this.b = true;
}
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
this.a.o();
String action = intent.getAction();
this.a.e().B().a("NetworkBroadcastReceiver received action", action);
if (!"android.net.conn.CONNECTIVITY_CHANGE".equals(action)) {
this.a.e().w().a("NetworkBroadcastReceiver received unknown action", action);
return;
}
boolean u = this.a.m().u();
if (this.c != u) {
this.c = u;
this.a.a().a(new zzbc(this, u));
}
}
}