package o;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.google.android.gms.common.internal.Preconditions;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.br0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0853br0 extends BroadcastReceiver {
    public final C1051dv0 a;
    public boolean b;
    public boolean c;

    public C0853br0(C1051dv0 c1051dv0) {
        Preconditions.checkNotNull(c1051dv0);
        this.a = c1051dv0;
    }

    public final void a() {
        C1051dv0 c1051dv0 = this.a;
        c1051dv0.k0();
        c1051dv0.c().r();
        c1051dv0.c().r();
        if (this.b) {
            c1051dv0.b().n.b("Unregistering connectivity change receiver");
            this.b = false;
            this.c = false;
            try {
                c1051dv0.l.a.unregisterReceiver(this);
            } catch (IllegalArgumentException e) {
                c1051dv0.b().f.c(e, "Failed to unregister the network broadcast receiver");
            }
        }
    }

    @Override // android.content.BroadcastReceiver
    public final void onReceive(Context context, Intent intent) {
        C1051dv0 c1051dv0 = this.a;
        c1051dv0.k0();
        String action = intent.getAction();
        c1051dv0.b().n.c(action, "NetworkBroadcastReceiver received action");
        if (!"android.net.conn.CONNECTIVITY_CHANGE".equals(action)) {
            c1051dv0.b().i.c(action, "NetworkBroadcastReceiver received unknown action");
            return;
        }
        Uq0 uq0 = c1051dv0.b;
        C1051dv0.T(uq0);
        boolean zW = uq0.w();
        if (this.c != zW) {
            this.c = zW;
            c1051dv0.c().B(new RunnableC2017o3(this, zW));
        }
    }
}
