118 lines
3.9 KiB
Java
118 lines
3.9 KiB
Java
package c.i.a.f.e.h.j;
|
|
|
|
import android.app.PendingIntent;
|
|
import android.content.DialogInterface;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import c.i.a.f.h.e.c;
|
|
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.concurrent.atomic.AtomicReference;
|
|
/* compiled from: com.google.android.gms:play-services-base@@17.3.0 */
|
|
public abstract class r0 extends LifecycleCallback implements DialogInterface.OnCancelListener {
|
|
public volatile boolean j;
|
|
public final AtomicReference<q0> k = new AtomicReference<>(null);
|
|
public final Handler l = new c(Looper.getMainLooper());
|
|
public final GoogleApiAvailability m;
|
|
|
|
public r0(j jVar, GoogleApiAvailability googleApiAvailability) {
|
|
super(jVar);
|
|
this.m = googleApiAvailability;
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.api.internal.LifecycleCallback
|
|
public void d(int i, int i2, Intent intent) {
|
|
q0 q0Var = this.k.get();
|
|
boolean z2 = false;
|
|
if (i != 1) {
|
|
if (i == 2) {
|
|
int c2 = this.m.c(b());
|
|
if (c2 == 0) {
|
|
z2 = true;
|
|
}
|
|
if (q0Var != null) {
|
|
if (q0Var.b.k == 18 && c2 == 18) {
|
|
return;
|
|
}
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
} else if (i2 == -1) {
|
|
z2 = true;
|
|
} else if (i2 == 0) {
|
|
if (q0Var != null) {
|
|
int i3 = 13;
|
|
if (intent != null) {
|
|
i3 = intent.getIntExtra("<<ResolutionFailureErrorDetail>>", 13);
|
|
}
|
|
q0 q0Var2 = new q0(new ConnectionResult(i3, null, q0Var.b.toString()), q0Var.a);
|
|
this.k.set(q0Var2);
|
|
q0Var = q0Var2;
|
|
} else {
|
|
return;
|
|
}
|
|
}
|
|
if (z2) {
|
|
m();
|
|
} else if (q0Var != null) {
|
|
l(q0Var.b, q0Var.a);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.api.internal.LifecycleCallback
|
|
public void e(Bundle bundle) {
|
|
if (bundle != null) {
|
|
this.k.set(bundle.getBoolean("resolving_error", false) ? new q0(new ConnectionResult(bundle.getInt("failed_status"), (PendingIntent) bundle.getParcelable("failed_resolution")), bundle.getInt("failed_client_id", -1)) : null);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.api.internal.LifecycleCallback
|
|
public void h(Bundle bundle) {
|
|
q0 q0Var = this.k.get();
|
|
if (q0Var != null) {
|
|
bundle.putBoolean("resolving_error", true);
|
|
bundle.putInt("failed_client_id", q0Var.a);
|
|
bundle.putInt("failed_status", q0Var.b.k);
|
|
bundle.putParcelable("failed_resolution", q0Var.b.l);
|
|
}
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.api.internal.LifecycleCallback
|
|
public void i() {
|
|
this.j = true;
|
|
}
|
|
|
|
@Override // com.google.android.gms.common.api.internal.LifecycleCallback
|
|
public void j() {
|
|
this.j = false;
|
|
}
|
|
|
|
public abstract void k();
|
|
|
|
public abstract void l(ConnectionResult connectionResult, int i);
|
|
|
|
public final void m() {
|
|
this.k.set(null);
|
|
k();
|
|
}
|
|
|
|
public final void n(ConnectionResult connectionResult, int i) {
|
|
q0 q0Var = new q0(connectionResult, i);
|
|
if (this.k.compareAndSet(null, q0Var)) {
|
|
this.l.post(new t0(this, q0Var));
|
|
}
|
|
}
|
|
|
|
@Override // android.content.DialogInterface.OnCancelListener
|
|
public void onCancel(DialogInterface dialogInterface) {
|
|
ConnectionResult connectionResult = new ConnectionResult(13, null);
|
|
q0 q0Var = this.k.get();
|
|
l(connectionResult, q0Var == null ? -1 : q0Var.a);
|
|
m();
|
|
}
|
|
}
|