package o;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.util.Log;
import com.google.firebase.messaging.FirebaseMessaging;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Yb0 extends BroadcastReceiver {
    public Zb0 a;
    public Context b;

    public final void a() {
        Log.isLoggable("FirebaseMessaging", 3);
        IntentFilter intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
        Zb0 zb0 = this.a;
        if (zb0 != null) {
            Context context = ((FirebaseMessaging) zb0.f437o).b;
            this.b = context;
            context.registerReceiver(this, intentFilter);
        }
    }

    @Override // android.content.BroadcastReceiver
    public final void onReceive(Context context, Intent intent) {
        Zb0 zb0 = this.a;
        if (zb0 != null && zb0.a()) {
            Log.isLoggable("FirebaseMessaging", 3);
            Zb0 zb02 = this.a;
            ((FirebaseMessaging) zb02.f437o).getClass();
            FirebaseMessaging.b(zb02, 0L);
            Context context2 = this.b;
            if (context2 != null) {
                context2.unregisterReceiver(this);
            }
            this.a = null;
        }
    }
}
