package r3; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Build; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /* loaded from: classes2.dex */ public abstract class g0 { /* renamed from: a, reason: collision with root package name */ protected final h0 f13654a; /* renamed from: b, reason: collision with root package name */ private final IntentFilter f13655b; /* renamed from: c, reason: collision with root package name */ private final Context f13656c; /* renamed from: d, reason: collision with root package name */ protected final Set f13657d = new HashSet(); /* renamed from: e, reason: collision with root package name */ private f0 f13658e = null; /* renamed from: f, reason: collision with root package name */ private volatile boolean f13659f = false; protected g0(h0 h0Var, IntentFilter intentFilter, Context context) { this.f13654a = h0Var; this.f13655b = intentFilter; this.f13656c = f.a(context); } private final void a() { f0 f0Var; if ((this.f13659f || !this.f13657d.isEmpty()) && this.f13658e == null) { f0 f0Var2 = new f0(this, null); this.f13658e = f0Var2; if (Build.VERSION.SDK_INT >= 33) { this.f13656c.registerReceiver(f0Var2, this.f13655b, 2); } else { this.f13656c.registerReceiver(f0Var2, this.f13655b); } } if (this.f13659f || !this.f13657d.isEmpty() || (f0Var = this.f13658e) == null) { return; } this.f13656c.unregisterReceiver(f0Var); this.f13658e = null; } protected abstract void b(Context context, Intent intent); public final synchronized void c(boolean z10) { this.f13659f = z10; a(); } public final synchronized void d(Object obj) { Iterator it = new HashSet(this.f13657d).iterator(); if (it.hasNext()) { androidx.appcompat.app.m.a(it.next()); throw null; } } public final synchronized boolean e() { return this.f13658e != null; } }