package c.i.a.f.e.h.j; import android.app.Activity; import android.os.Handler; import androidx.collection.ArraySet; import com.airbnb.lottie.parser.AnimatableValueParser; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.common.api.internal.LifecycleCallback; import java.util.Objects; /* compiled from: com.google.android.gms:play-services-base@@17.3.0 */ public class y0 extends r0 { public final ArraySet> n = new ArraySet<>(); public final g o; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public y0(j jVar, g gVar) { super(jVar, GoogleApiAvailability.d); Object obj = GoogleApiAvailability.f2298c; this.o = gVar; jVar.a("ConnectionlessLifecycleHelper", this); } public static void o(Activity activity, g gVar, b bVar) { j c2 = LifecycleCallback.c(activity); y0 y0Var = (y0) c2.d("ConnectionlessLifecycleHelper", y0.class); if (y0Var == null) { y0Var = new y0(c2, gVar); } AnimatableValueParser.z(bVar, "ApiKey cannot be null"); y0Var.n.add(bVar); gVar.b(y0Var); } @Override // com.google.android.gms.common.api.internal.LifecycleCallback public void g() { if (!this.n.isEmpty()) { this.o.b(this); } } @Override // c.i.a.f.e.h.j.r0, com.google.android.gms.common.api.internal.LifecycleCallback public void i() { this.j = true; if (!this.n.isEmpty()) { this.o.b(this); } } @Override // c.i.a.f.e.h.j.r0, com.google.android.gms.common.api.internal.LifecycleCallback public void j() { this.j = false; g gVar = this.o; Objects.requireNonNull(gVar); synchronized (g.k) { if (gVar.t == this) { gVar.t = null; gVar.u.clear(); } } } @Override // c.i.a.f.e.h.j.r0 public final void k() { Handler handler = this.o.w; handler.sendMessage(handler.obtainMessage(3)); } @Override // c.i.a.f.e.h.j.r0 public final void l(ConnectionResult connectionResult, int i) { g gVar = this.o; if (!gVar.c(connectionResult, i)) { Handler handler = gVar.w; handler.sendMessage(handler.obtainMessage(5, i, 0, connectionResult)); } } }