Initial commit
This commit is contained in:
108
sources/com/google/android/gms/common/api/Api.java
Normal file
108
sources/com/google/android/gms/common/api/Api.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Looper;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.Api.ApiOptions;
|
||||
import com.google.android.gms.common.internal.BaseGmsClient;
|
||||
import com.google.android.gms.common.internal.ClientSettings;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Api<O extends ApiOptions> {
|
||||
private final AbstractClientBuilder<?, O> a;
|
||||
private final String b;
|
||||
|
||||
public static abstract class AbstractClientBuilder<T extends Client, O> extends BaseClientBuilder<T, O> {
|
||||
public abstract T a(Context context, Looper looper, ClientSettings clientSettings, O o, GoogleApiClient$ConnectionCallbacks googleApiClient$ConnectionCallbacks, GoogleApiClient$OnConnectionFailedListener googleApiClient$OnConnectionFailedListener);
|
||||
}
|
||||
|
||||
public interface AnyClient {
|
||||
}
|
||||
|
||||
public static class AnyClientKey<C extends AnyClient> {
|
||||
}
|
||||
|
||||
public interface ApiOptions {
|
||||
|
||||
public interface HasAccountOptions extends HasOptions, NotRequiredOptions {
|
||||
Account a();
|
||||
}
|
||||
|
||||
public interface HasGoogleSignInAccountOptions extends HasOptions {
|
||||
GoogleSignInAccount b();
|
||||
}
|
||||
|
||||
public interface HasOptions extends ApiOptions {
|
||||
}
|
||||
|
||||
public interface NotRequiredOptions extends ApiOptions {
|
||||
}
|
||||
|
||||
public interface Optional extends HasOptions, NotRequiredOptions {
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class BaseClientBuilder<T extends AnyClient, O> {
|
||||
}
|
||||
|
||||
public interface Client extends AnyClient {
|
||||
void a();
|
||||
|
||||
void a(BaseGmsClient.ConnectionProgressReportCallbacks connectionProgressReportCallbacks);
|
||||
|
||||
void a(BaseGmsClient.SignOutCallbacks signOutCallbacks);
|
||||
|
||||
void a(IAccountAccessor iAccountAccessor, Set<Scope> set);
|
||||
|
||||
boolean b();
|
||||
|
||||
boolean d();
|
||||
|
||||
String e();
|
||||
|
||||
boolean f();
|
||||
|
||||
int g();
|
||||
|
||||
Feature[] h();
|
||||
|
||||
boolean i();
|
||||
}
|
||||
|
||||
public static final class ClientKey<C extends Client> extends AnyClientKey<C> {
|
||||
}
|
||||
|
||||
public interface SimpleClient<T extends IInterface> extends AnyClient {
|
||||
T a(IBinder iBinder);
|
||||
|
||||
void a(int i, T t);
|
||||
|
||||
String j();
|
||||
|
||||
String k();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public <C extends Client> Api(String str, AbstractClientBuilder<C, O> abstractClientBuilder, ClientKey<C> clientKey) {
|
||||
Preconditions.a(abstractClientBuilder, "Cannot construct an Api with a null ClientBuilder");
|
||||
Preconditions.a(clientKey, "Cannot construct an Api with a null ClientKey");
|
||||
this.b = str;
|
||||
this.a = abstractClientBuilder;
|
||||
}
|
||||
|
||||
public final String a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final AbstractClientBuilder<?, O> b() {
|
||||
Preconditions.b(this.a != null, "This API was constructed with a SimpleClientBuilder. Use getSimpleClientBuilder");
|
||||
return this.a;
|
||||
}
|
||||
}
|
48
sources/com/google/android/gms/common/api/ApiException.java
Normal file
48
sources/com/google/android/gms/common/api/ApiException.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ApiException extends Exception {
|
||||
protected final Status mStatus;
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public ApiException(com.google.android.gms.common.api.Status r5) {
|
||||
/*
|
||||
r4 = this;
|
||||
int r0 = r5.getStatusCode()
|
||||
java.lang.String r1 = r5.getStatusMessage()
|
||||
if (r1 == 0) goto Lf
|
||||
java.lang.String r1 = r5.getStatusMessage()
|
||||
goto L11
|
||||
Lf:
|
||||
java.lang.String r1 = ""
|
||||
L11:
|
||||
java.lang.String r2 = java.lang.String.valueOf(r1)
|
||||
int r2 = r2.length()
|
||||
int r2 = r2 + 13
|
||||
java.lang.StringBuilder r3 = new java.lang.StringBuilder
|
||||
r3.<init>(r2)
|
||||
r3.append(r0)
|
||||
java.lang.String r0 = ": "
|
||||
r3.append(r0)
|
||||
r3.append(r1)
|
||||
java.lang.String r0 = r3.toString()
|
||||
r4.<init>(r0)
|
||||
r4.mStatus = r5
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.common.api.ApiException.<init>(com.google.android.gms.common.api.Status):void");
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
return this.mStatus.getStatusCode();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getStatusMessage() {
|
||||
return this.mStatus.getStatusMessage();
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import androidx.collection.ArrayMap;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.internal.zai;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AvailabilityException extends Exception {
|
||||
private final ArrayMap<zai<?>, ConnectionResult> zaay;
|
||||
|
||||
public AvailabilityException(ArrayMap<zai<?>, ConnectionResult> arrayMap) {
|
||||
this.zaay = arrayMap;
|
||||
}
|
||||
|
||||
public ConnectionResult getConnectionResult(GoogleApi<? extends Api.ApiOptions> googleApi) {
|
||||
zai<? extends Api.ApiOptions> c = googleApi.c();
|
||||
Preconditions.a(this.zaay.get(c) != null, "The given API was not part of the availability request.");
|
||||
return this.zaay.get(c);
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getMessage() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
boolean z = true;
|
||||
for (zai<?> zaiVar : this.zaay.keySet()) {
|
||||
ConnectionResult connectionResult = this.zaay.get(zaiVar);
|
||||
if (connectionResult.isSuccess()) {
|
||||
z = false;
|
||||
}
|
||||
String a = zaiVar.a();
|
||||
String valueOf = String.valueOf(connectionResult);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 2 + String.valueOf(valueOf).length());
|
||||
sb.append(a);
|
||||
sb.append(": ");
|
||||
sb.append(valueOf);
|
||||
arrayList.add(sb.toString());
|
||||
}
|
||||
StringBuilder sb2 = new StringBuilder();
|
||||
if (z) {
|
||||
sb2.append("None of the queried APIs are available. ");
|
||||
} else {
|
||||
sb2.append("Some of the queried APIs are unavailable. ");
|
||||
}
|
||||
sb2.append(TextUtils.join("; ", arrayList));
|
||||
return sb2.toString();
|
||||
}
|
||||
|
||||
public final ArrayMap<zai<?>, ConnectionResult> zaj() {
|
||||
return this.zaay;
|
||||
}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CommonStatusCodes {
|
||||
public static String a(int i) {
|
||||
switch (i) {
|
||||
case -1:
|
||||
return "SUCCESS_CACHE";
|
||||
case 0:
|
||||
return "SUCCESS";
|
||||
case 1:
|
||||
case 9:
|
||||
case 11:
|
||||
case 12:
|
||||
default:
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append("unknown status code: ");
|
||||
sb.append(i);
|
||||
return sb.toString();
|
||||
case 2:
|
||||
return "SERVICE_VERSION_UPDATE_REQUIRED";
|
||||
case 3:
|
||||
return "SERVICE_DISABLED";
|
||||
case 4:
|
||||
return "SIGN_IN_REQUIRED";
|
||||
case 5:
|
||||
return "INVALID_ACCOUNT";
|
||||
case 6:
|
||||
return "RESOLUTION_REQUIRED";
|
||||
case 7:
|
||||
return "NETWORK_ERROR";
|
||||
case 8:
|
||||
return "INTERNAL_ERROR";
|
||||
case 10:
|
||||
return "DEVELOPER_ERROR";
|
||||
case 13:
|
||||
return "ERROR";
|
||||
case 14:
|
||||
return "INTERRUPTED";
|
||||
case 15:
|
||||
return "TIMEOUT";
|
||||
case 16:
|
||||
return "CANCELED";
|
||||
case 17:
|
||||
return "API_NOT_CONNECTED";
|
||||
case 18:
|
||||
return "DEAD_CLIENT";
|
||||
}
|
||||
}
|
||||
}
|
67
sources/com/google/android/gms/common/api/GoogleApi.java
Normal file
67
sources/com/google/android/gms/common/api/GoogleApi.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.ApiOptions;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.common.api.internal.zace;
|
||||
import com.google.android.gms.common.api.internal.zai;
|
||||
import com.google.android.gms.common.internal.ClientSettings;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApi<O extends Api.ApiOptions> {
|
||||
private final Context a;
|
||||
private final Api<O> b;
|
||||
private final O c;
|
||||
private final zai<O> d;
|
||||
private final int e;
|
||||
|
||||
/* JADX WARN: Type inference failed for: r9v1, types: [com.google.android.gms.common.api.Api$Client] */
|
||||
public Api.Client a(Looper looper, GoogleApiManager.zaa<O> zaaVar) {
|
||||
return this.b.b().a(this.a, looper, a().a(), this.c, zaaVar, zaaVar);
|
||||
}
|
||||
|
||||
public final int b() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public final zai<O> c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
protected ClientSettings.Builder a() {
|
||||
Account a;
|
||||
Set<Scope> emptySet;
|
||||
GoogleSignInAccount b;
|
||||
GoogleSignInAccount b2;
|
||||
ClientSettings.Builder builder = new ClientSettings.Builder();
|
||||
O o = this.c;
|
||||
if ((o instanceof Api.ApiOptions.HasGoogleSignInAccountOptions) && (b2 = ((Api.ApiOptions.HasGoogleSignInAccountOptions) o).b()) != null) {
|
||||
a = b2.getAccount();
|
||||
} else {
|
||||
O o2 = this.c;
|
||||
a = o2 instanceof Api.ApiOptions.HasAccountOptions ? ((Api.ApiOptions.HasAccountOptions) o2).a() : null;
|
||||
}
|
||||
builder.a(a);
|
||||
O o3 = this.c;
|
||||
if ((o3 instanceof Api.ApiOptions.HasGoogleSignInAccountOptions) && (b = ((Api.ApiOptions.HasGoogleSignInAccountOptions) o3).b()) != null) {
|
||||
emptySet = b.getRequestedScopes();
|
||||
} else {
|
||||
emptySet = Collections.emptySet();
|
||||
}
|
||||
builder.a(emptySet);
|
||||
builder.a(this.a.getClass().getName());
|
||||
builder.b(this.a.getPackageName());
|
||||
return builder;
|
||||
}
|
||||
|
||||
public zace a(Context context, Handler handler) {
|
||||
return new zace(context, handler, a().a());
|
||||
}
|
||||
}
|
102
sources/com/google/android/gms/common/api/GoogleApiActivity.java
Normal file
102
sources/com/google/android/gms/common/api/GoogleApiActivity.java
Normal file
@@ -0,0 +1,102 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.common.annotation.KeepName;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
@KeepName
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApiActivity extends Activity implements DialogInterface.OnCancelListener {
|
||||
private int a = 0;
|
||||
|
||||
public static PendingIntent a(Context context, PendingIntent pendingIntent, int i) {
|
||||
return PendingIntent.getActivity(context, 0, a(context, pendingIntent, i, true), 134217728);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (i == 1) {
|
||||
boolean booleanExtra = getIntent().getBooleanExtra("notify_manager", true);
|
||||
this.a = 0;
|
||||
setResult(i2, intent);
|
||||
if (booleanExtra) {
|
||||
GoogleApiManager a = GoogleApiManager.a(this);
|
||||
if (i2 == -1) {
|
||||
a.a();
|
||||
} else if (i2 == 0) {
|
||||
a.a(new ConnectionResult(13, null), getIntent().getIntExtra("failing_client_id", -1));
|
||||
}
|
||||
}
|
||||
} else if (i == 2) {
|
||||
this.a = 0;
|
||||
setResult(i2, intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // android.content.DialogInterface.OnCancelListener
|
||||
public void onCancel(DialogInterface dialogInterface) {
|
||||
this.a = 0;
|
||||
setResult(0);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
if (bundle != null) {
|
||||
this.a = bundle.getInt("resolution");
|
||||
}
|
||||
if (this.a != 1) {
|
||||
Bundle extras = getIntent().getExtras();
|
||||
if (extras == null) {
|
||||
Log.e("GoogleApiActivity", "Activity started without extras");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
PendingIntent pendingIntent = (PendingIntent) extras.get("pending_intent");
|
||||
Integer num = (Integer) extras.get("error_code");
|
||||
if (pendingIntent == null && num == null) {
|
||||
Log.e("GoogleApiActivity", "Activity started without resolution");
|
||||
finish();
|
||||
} else {
|
||||
if (pendingIntent == null) {
|
||||
GoogleApiAvailability.a().b(this, num.intValue(), 2, this);
|
||||
this.a = 1;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
startIntentSenderForResult(pendingIntent.getIntentSender(), 1, null, 0, 0, 0);
|
||||
this.a = 1;
|
||||
} catch (IntentSender.SendIntentException e) {
|
||||
Log.e("GoogleApiActivity", "Failed to launch pendingIntent", e);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
bundle.putInt("resolution", this.a);
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
public static Intent a(Context context, PendingIntent pendingIntent, int i, boolean z) {
|
||||
Intent intent = new Intent(context, (Class<?>) GoogleApiActivity.class);
|
||||
intent.putExtra("pending_intent", pendingIntent);
|
||||
intent.putExtra("failing_client_id", i);
|
||||
intent.putExtra("notify_manager", z);
|
||||
return intent;
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface GoogleApiClient$ConnectionCallbacks {
|
||||
void d(Bundle bundle);
|
||||
|
||||
void i(int i);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface GoogleApiClient$OnConnectionFailedListener {
|
||||
void a(ConnectionResult connectionResult);
|
||||
}
|
11
sources/com/google/android/gms/common/api/PendingResult.java
Normal file
11
sources/com/google/android/gms/common/api/PendingResult.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.api.Result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class PendingResult<R extends Result> {
|
||||
|
||||
public interface StatusListener {
|
||||
void a(Status status);
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Releasable {
|
||||
void release();
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.IntentSender;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ResolvableApiException extends ApiException {
|
||||
public ResolvableApiException(Status status) {
|
||||
super(status);
|
||||
}
|
||||
|
||||
public PendingIntent getResolution() {
|
||||
return this.mStatus.getResolution();
|
||||
}
|
||||
|
||||
public void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
|
||||
this.mStatus.startResolutionForResult(activity, i);
|
||||
}
|
||||
}
|
6
sources/com/google/android/gms/common/api/Result.java
Normal file
6
sources/com/google/android/gms/common/api/Result.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface Result {
|
||||
Status getStatus();
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.api.Result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ResultCallback<R extends Result> {
|
||||
void a(R r);
|
||||
}
|
55
sources/com/google/android/gms/common/api/Scope.java
Normal file
55
sources/com/google/android/gms/common/api/Scope.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Scope extends AbstractSafeParcelable implements ReflectedParcelable {
|
||||
public static final Parcelable.Creator<Scope> CREATOR = new zza();
|
||||
private final String zzap;
|
||||
private final int zzg;
|
||||
|
||||
Scope(int i, String str) {
|
||||
Preconditions.a(str, (Object) "scopeUri must not be null or empty");
|
||||
this.zzg = i;
|
||||
this.zzap = str;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof Scope) {
|
||||
return this.zzap.equals(((Scope) obj).zzap);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final String getScopeUri() {
|
||||
return this.zzap;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.zzap.hashCode();
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return this.zzap;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, this.zzg);
|
||||
SafeParcelWriter.a(parcel, 2, getScopeUri(), false);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public Scope(String str) {
|
||||
this(1, str);
|
||||
}
|
||||
}
|
119
sources/com/google/android/gms/common/api/Status.java
Normal file
119
sources/com/google/android/gms/common/api/Status.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Status extends AbstractSafeParcelable implements Result, ReflectedParcelable {
|
||||
private final int zzg;
|
||||
private final int zzh;
|
||||
private final PendingIntent zzi;
|
||||
private final String zzj;
|
||||
public static final Status RESULT_SUCCESS = new Status(0);
|
||||
public static final Status RESULT_INTERRUPTED = new Status(14);
|
||||
public static final Status RESULT_INTERNAL_ERROR = new Status(8);
|
||||
public static final Status RESULT_TIMEOUT = new Status(15);
|
||||
public static final Status RESULT_CANCELED = new Status(16);
|
||||
private static final Status zzaq = new Status(17);
|
||||
public static final Status RESULT_DEAD_CLIENT = new Status(18);
|
||||
public static final Parcelable.Creator<Status> CREATOR = new zzb();
|
||||
|
||||
Status(int i, int i2, String str, PendingIntent pendingIntent) {
|
||||
this.zzg = i;
|
||||
this.zzh = i2;
|
||||
this.zzj = str;
|
||||
this.zzi = pendingIntent;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (!(obj instanceof Status)) {
|
||||
return false;
|
||||
}
|
||||
Status status = (Status) obj;
|
||||
return this.zzg == status.zzg && this.zzh == status.zzh && Objects.a(this.zzj, status.zzj) && Objects.a(this.zzi, status.zzi);
|
||||
}
|
||||
|
||||
public final PendingIntent getResolution() {
|
||||
return this.zzi;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.Result
|
||||
public final Status getStatus() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public final int getStatusCode() {
|
||||
return this.zzh;
|
||||
}
|
||||
|
||||
public final String getStatusMessage() {
|
||||
return this.zzj;
|
||||
}
|
||||
|
||||
public final boolean hasResolution() {
|
||||
return this.zzi != null;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(Integer.valueOf(this.zzg), Integer.valueOf(this.zzh), this.zzj, this.zzi);
|
||||
}
|
||||
|
||||
public final boolean isCanceled() {
|
||||
return this.zzh == 16;
|
||||
}
|
||||
|
||||
public final boolean isInterrupted() {
|
||||
return this.zzh == 14;
|
||||
}
|
||||
|
||||
public final boolean isSuccess() {
|
||||
return this.zzh <= 0;
|
||||
}
|
||||
|
||||
public final void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
|
||||
if (hasResolution()) {
|
||||
activity.startIntentSenderForResult(this.zzi.getIntentSender(), i, null, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a("statusCode", zzg());
|
||||
a.a("resolution", this.zzi);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int a = SafeParcelWriter.a(parcel);
|
||||
SafeParcelWriter.a(parcel, 1, getStatusCode());
|
||||
SafeParcelWriter.a(parcel, 2, getStatusMessage(), false);
|
||||
SafeParcelWriter.a(parcel, 3, (Parcelable) this.zzi, i, false);
|
||||
SafeParcelWriter.a(parcel, 1000, this.zzg);
|
||||
SafeParcelWriter.a(parcel, a);
|
||||
}
|
||||
|
||||
public final String zzg() {
|
||||
String str = this.zzj;
|
||||
return str != null ? str : CommonStatusCodes.a(this.zzh);
|
||||
}
|
||||
|
||||
public Status(int i) {
|
||||
this(i, null);
|
||||
}
|
||||
|
||||
public Status(int i, String str) {
|
||||
this(1, i, str, null);
|
||||
}
|
||||
|
||||
public Status(int i, String str, PendingIntent pendingIntent) {
|
||||
this(1, i, str, pendingIntent);
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import com.google.android.gms.common.Feature;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class UnsupportedApiCallException extends UnsupportedOperationException {
|
||||
private final Feature zzar;
|
||||
|
||||
public UnsupportedApiCallException(Feature feature) {
|
||||
this.zzar = feature;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public final String getMessage() {
|
||||
String valueOf = String.valueOf(this.zzar);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 8);
|
||||
sb.append("Missing ");
|
||||
sb.append(valueOf);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,134 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Application;
|
||||
import android.content.ComponentCallbacks2;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class BackgroundDetector implements Application.ActivityLifecycleCallbacks, ComponentCallbacks2 {
|
||||
private static final BackgroundDetector e = new BackgroundDetector();
|
||||
private final AtomicBoolean a = new AtomicBoolean();
|
||||
private final AtomicBoolean b = new AtomicBoolean();
|
||||
private final ArrayList<BackgroundStateChangeListener> c = new ArrayList<>();
|
||||
private boolean d = false;
|
||||
|
||||
public interface BackgroundStateChangeListener {
|
||||
void a(boolean z);
|
||||
}
|
||||
|
||||
private BackgroundDetector() {
|
||||
}
|
||||
|
||||
public static void a(Application application) {
|
||||
synchronized (e) {
|
||||
if (!e.d) {
|
||||
application.registerActivityLifecycleCallbacks(e);
|
||||
application.registerComponentCallbacks(e);
|
||||
e.d = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static BackgroundDetector b() {
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
boolean compareAndSet = this.a.compareAndSet(true, false);
|
||||
this.b.set(true);
|
||||
if (compareAndSet) {
|
||||
b(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityResumed(Activity activity) {
|
||||
boolean compareAndSet = this.a.compareAndSet(true, false);
|
||||
this.b.set(true);
|
||||
if (compareAndSet) {
|
||||
b(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.content.ComponentCallbacks
|
||||
public final void onConfigurationChanged(Configuration configuration) {
|
||||
}
|
||||
|
||||
@Override // android.content.ComponentCallbacks
|
||||
public final void onLowMemory() {
|
||||
}
|
||||
|
||||
@Override // android.content.ComponentCallbacks2
|
||||
public final void onTrimMemory(int i) {
|
||||
if (i == 20 && this.a.compareAndSet(false, true)) {
|
||||
this.b.set(true);
|
||||
b(true);
|
||||
}
|
||||
}
|
||||
|
||||
private final void b(boolean z) {
|
||||
synchronized (e) {
|
||||
ArrayList<BackgroundStateChangeListener> arrayList = this.c;
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
BackgroundStateChangeListener backgroundStateChangeListener = arrayList.get(i);
|
||||
i++;
|
||||
backgroundStateChangeListener.a(z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(16)
|
||||
public final boolean a(boolean z) {
|
||||
if (!this.b.get()) {
|
||||
if (!PlatformVersion.c()) {
|
||||
return z;
|
||||
}
|
||||
ActivityManager.RunningAppProcessInfo runningAppProcessInfo = new ActivityManager.RunningAppProcessInfo();
|
||||
ActivityManager.getMyMemoryState(runningAppProcessInfo);
|
||||
if (!this.b.getAndSet(true) && runningAppProcessInfo.importance > 100) {
|
||||
this.a.set(true);
|
||||
}
|
||||
}
|
||||
return a();
|
||||
}
|
||||
|
||||
public final boolean a() {
|
||||
return this.a.get();
|
||||
}
|
||||
|
||||
public final void a(BackgroundStateChangeListener backgroundStateChangeListener) {
|
||||
synchronized (e) {
|
||||
this.c.add(backgroundStateChangeListener);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,181 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
import com.google.android.gms.common.annotation.KeepName;
|
||||
import com.google.android.gms.common.api.PendingResult;
|
||||
import com.google.android.gms.common.api.Releasable;
|
||||
import com.google.android.gms.common.api.Result;
|
||||
import com.google.android.gms.common.api.ResultCallback;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@KeepName
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BasePendingResult<R extends Result> extends PendingResult<R> {
|
||||
private ResultCallback<? super R> e;
|
||||
private R g;
|
||||
private Status h;
|
||||
private volatile boolean i;
|
||||
private boolean j;
|
||||
private boolean k;
|
||||
private final Object a = new Object();
|
||||
private final CountDownLatch c = new CountDownLatch(1);
|
||||
private final ArrayList<PendingResult.StatusListener> d = new ArrayList<>();
|
||||
private final AtomicReference<zacs> f = new AtomicReference<>();
|
||||
private final CallbackHandler<R> b = new CallbackHandler<>(Looper.getMainLooper());
|
||||
|
||||
public static class CallbackHandler<R extends Result> extends com.google.android.gms.internal.base.zal {
|
||||
public CallbackHandler(Looper looper) {
|
||||
super(looper);
|
||||
}
|
||||
|
||||
public final void a(ResultCallback<? super R> resultCallback, R r) {
|
||||
sendMessage(obtainMessage(1, new Pair(resultCallback, r)));
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i != 1) {
|
||||
if (i == 2) {
|
||||
((BasePendingResult) message.obj).b(Status.RESULT_TIMEOUT);
|
||||
return;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(45);
|
||||
sb.append("Don't know how to handle message: ");
|
||||
sb.append(i);
|
||||
Log.wtf("BasePendingResult", sb.toString(), new Exception());
|
||||
return;
|
||||
}
|
||||
Pair pair = (Pair) message.obj;
|
||||
ResultCallback resultCallback = (ResultCallback) pair.first;
|
||||
Result result = (Result) pair.second;
|
||||
try {
|
||||
resultCallback.a(result);
|
||||
} catch (RuntimeException e) {
|
||||
BasePendingResult.c(result);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class zaa {
|
||||
private zaa() {
|
||||
}
|
||||
|
||||
protected final void finalize() throws Throwable {
|
||||
BasePendingResult.c(BasePendingResult.this.g);
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
/* synthetic */ zaa(BasePendingResult basePendingResult, zap zapVar) {
|
||||
this();
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
new zap();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
BasePendingResult() {
|
||||
new WeakReference(null);
|
||||
}
|
||||
|
||||
public static void c(Result result) {
|
||||
if (result instanceof Releasable) {
|
||||
try {
|
||||
((Releasable) result).release();
|
||||
} catch (RuntimeException e) {
|
||||
String valueOf = String.valueOf(result);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 18);
|
||||
sb.append("Unable to release ");
|
||||
sb.append(valueOf);
|
||||
Log.w("BasePendingResult", sb.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract R a(Status status);
|
||||
|
||||
public final boolean a() {
|
||||
return this.c.getCount() == 0;
|
||||
}
|
||||
|
||||
public final void b(Status status) {
|
||||
synchronized (this.a) {
|
||||
if (!a()) {
|
||||
a((BasePendingResult<R>) a(status));
|
||||
this.k = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(R r) {
|
||||
synchronized (this.a) {
|
||||
if (this.k || this.j) {
|
||||
c(r);
|
||||
return;
|
||||
}
|
||||
a();
|
||||
boolean z = true;
|
||||
Preconditions.b(!a(), "Results have already been set");
|
||||
if (this.i) {
|
||||
z = false;
|
||||
}
|
||||
Preconditions.b(z, "Result has already been consumed");
|
||||
b((BasePendingResult<R>) r);
|
||||
}
|
||||
}
|
||||
|
||||
private final R b() {
|
||||
R r;
|
||||
synchronized (this.a) {
|
||||
Preconditions.b(!this.i, "Result has already been consumed.");
|
||||
Preconditions.b(a(), "Result is not ready.");
|
||||
r = this.g;
|
||||
this.g = null;
|
||||
this.e = null;
|
||||
this.i = true;
|
||||
}
|
||||
zacs andSet = this.f.getAndSet(null);
|
||||
if (andSet != null) {
|
||||
andSet.a(this);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
private final void b(R r) {
|
||||
this.g = r;
|
||||
this.c.countDown();
|
||||
this.h = this.g.getStatus();
|
||||
zap zapVar = null;
|
||||
if (this.j) {
|
||||
this.e = null;
|
||||
} else if (this.e == null) {
|
||||
if (this.g instanceof Releasable) {
|
||||
new zaa(this, zapVar);
|
||||
}
|
||||
} else {
|
||||
this.b.removeMessages(2);
|
||||
this.b.a(this.e, b());
|
||||
}
|
||||
ArrayList<PendingResult.StatusListener> arrayList = this.d;
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
PendingResult.StatusListener statusListener = arrayList.get(i);
|
||||
i++;
|
||||
statusListener.a(this.h);
|
||||
}
|
||||
this.d.clear();
|
||||
}
|
||||
}
|
@@ -0,0 +1,768 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.collection.ArraySet;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.GoogleApi;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.api.UnsupportedApiCallException;
|
||||
import com.google.android.gms.common.internal.BaseGmsClient;
|
||||
import com.google.android.gms.common.internal.GoogleApiAvailabilityCache;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.SimpleClientAdapter;
|
||||
import com.google.android.gms.common.util.ArrayUtils;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GoogleApiManager implements Handler.Callback {
|
||||
public static final Status m = new Status(4, "Sign-out occurred while this API call was in progress.");
|
||||
private static final Status n = new Status(4, "The user must be signed in to make this API call.");
|
||||
private static final Object o = new Object();
|
||||
private static GoogleApiManager p;
|
||||
private long a = 5000;
|
||||
private long b = 120000;
|
||||
private long c = 10000;
|
||||
private final Context d;
|
||||
private final GoogleApiAvailability e;
|
||||
private final GoogleApiAvailabilityCache f;
|
||||
private final AtomicInteger g;
|
||||
private final Map<zai<?>, zaa<?>> h;
|
||||
private zaae i;
|
||||
private final Set<zai<?>> j;
|
||||
private final Set<zai<?>> k;
|
||||
private final Handler l;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
class zac implements zach, BaseGmsClient.ConnectionProgressReportCallbacks {
|
||||
private final Api.Client a;
|
||||
private final zai<?> b;
|
||||
private IAccountAccessor c = null;
|
||||
private Set<Scope> d = null;
|
||||
private boolean e = false;
|
||||
|
||||
public zac(Api.Client client, zai<?> zaiVar) {
|
||||
this.a = client;
|
||||
this.b = zaiVar;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.internal.BaseGmsClient.ConnectionProgressReportCallbacks
|
||||
public final void a(ConnectionResult connectionResult) {
|
||||
GoogleApiManager.this.l.post(new zabo(this, connectionResult));
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zach
|
||||
public final void b(ConnectionResult connectionResult) {
|
||||
((zaa) GoogleApiManager.this.h.get(this.b)).b(connectionResult);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zach
|
||||
public final void a(IAccountAccessor iAccountAccessor, Set<Scope> set) {
|
||||
if (iAccountAccessor == null || set == null) {
|
||||
Log.wtf("GoogleApiManager", "Received null response from onSignInSuccess", new Exception());
|
||||
b(new ConnectionResult(4));
|
||||
} else {
|
||||
this.c = iAccountAccessor;
|
||||
this.d = set;
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void a() {
|
||||
IAccountAccessor iAccountAccessor;
|
||||
if (!this.e || (iAccountAccessor = this.c) == null) {
|
||||
return;
|
||||
}
|
||||
this.a.a(iAccountAccessor, this.d);
|
||||
}
|
||||
|
||||
static /* synthetic */ boolean a(zac zacVar, boolean z) {
|
||||
zacVar.e = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private GoogleApiManager(Context context, Looper looper, GoogleApiAvailability googleApiAvailability) {
|
||||
new AtomicInteger(1);
|
||||
this.g = new AtomicInteger(0);
|
||||
this.h = new ConcurrentHashMap(5, 0.75f, 1);
|
||||
this.i = null;
|
||||
this.j = new ArraySet();
|
||||
this.k = new ArraySet();
|
||||
this.d = context;
|
||||
this.l = new com.google.android.gms.internal.base.zal(looper, this);
|
||||
this.e = googleApiAvailability;
|
||||
this.f = new GoogleApiAvailabilityCache(googleApiAvailability);
|
||||
Handler handler = this.l;
|
||||
handler.sendMessage(handler.obtainMessage(6));
|
||||
}
|
||||
|
||||
public static GoogleApiManager a(Context context) {
|
||||
GoogleApiManager googleApiManager;
|
||||
synchronized (o) {
|
||||
if (p == null) {
|
||||
HandlerThread handlerThread = new HandlerThread("GoogleApiHandler", 9);
|
||||
handlerThread.start();
|
||||
p = new GoogleApiManager(context.getApplicationContext(), handlerThread.getLooper(), GoogleApiAvailability.a());
|
||||
}
|
||||
googleApiManager = p;
|
||||
}
|
||||
return googleApiManager;
|
||||
}
|
||||
|
||||
final boolean b(ConnectionResult connectionResult, int i) {
|
||||
return this.e.a(this.d, connectionResult, i);
|
||||
}
|
||||
|
||||
@Override // android.os.Handler.Callback
|
||||
public boolean handleMessage(Message message) {
|
||||
zaa<?> zaaVar;
|
||||
int i = message.what;
|
||||
switch (i) {
|
||||
case 1:
|
||||
this.c = ((Boolean) message.obj).booleanValue() ? 10000L : 300000L;
|
||||
this.l.removeMessages(12);
|
||||
for (zai<?> zaiVar : this.h.keySet()) {
|
||||
Handler handler = this.l;
|
||||
handler.sendMessageDelayed(handler.obtainMessage(12, zaiVar), this.c);
|
||||
}
|
||||
return true;
|
||||
case 2:
|
||||
zak zakVar = (zak) message.obj;
|
||||
Iterator<zai<?>> it = zakVar.a().iterator();
|
||||
while (true) {
|
||||
if (it.hasNext()) {
|
||||
zai<?> next = it.next();
|
||||
zaa<?> zaaVar2 = this.h.get(next);
|
||||
if (zaaVar2 == null) {
|
||||
zakVar.a(next, new ConnectionResult(13), null);
|
||||
} else if (zaaVar2.c()) {
|
||||
zakVar.a(next, ConnectionResult.RESULT_SUCCESS, zaaVar2.f().e());
|
||||
} else if (zaaVar2.k() != null) {
|
||||
zakVar.a(next, zaaVar2.k(), null);
|
||||
} else {
|
||||
zaaVar2.a(zakVar);
|
||||
zaaVar2.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case 3:
|
||||
for (zaa<?> zaaVar3 : this.h.values()) {
|
||||
zaaVar3.j();
|
||||
zaaVar3.a();
|
||||
}
|
||||
return true;
|
||||
case 4:
|
||||
case 8:
|
||||
case 13:
|
||||
zabv zabvVar = (zabv) message.obj;
|
||||
zaa<?> zaaVar4 = this.h.get(zabvVar.c.c());
|
||||
if (zaaVar4 == null) {
|
||||
a(zabvVar.c);
|
||||
zaaVar4 = this.h.get(zabvVar.c.c());
|
||||
}
|
||||
if (!zaaVar4.d() || this.g.get() == zabvVar.b) {
|
||||
zaaVar4.a(zabvVar.a);
|
||||
} else {
|
||||
zabvVar.a.a(m);
|
||||
zaaVar4.h();
|
||||
}
|
||||
return true;
|
||||
case 5:
|
||||
int i2 = message.arg1;
|
||||
ConnectionResult connectionResult = (ConnectionResult) message.obj;
|
||||
Iterator<zaa<?>> it2 = this.h.values().iterator();
|
||||
while (true) {
|
||||
if (it2.hasNext()) {
|
||||
zaaVar = it2.next();
|
||||
if (zaaVar.b() == i2) {
|
||||
}
|
||||
} else {
|
||||
zaaVar = null;
|
||||
}
|
||||
}
|
||||
if (zaaVar != null) {
|
||||
String a = this.e.a(connectionResult.getErrorCode());
|
||||
String errorMessage = connectionResult.getErrorMessage();
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 69 + String.valueOf(errorMessage).length());
|
||||
sb.append("Error resolution was canceled by the user, original error message: ");
|
||||
sb.append(a);
|
||||
sb.append(": ");
|
||||
sb.append(errorMessage);
|
||||
zaaVar.a(new Status(17, sb.toString()));
|
||||
} else {
|
||||
StringBuilder sb2 = new StringBuilder(76);
|
||||
sb2.append("Could not find API instance ");
|
||||
sb2.append(i2);
|
||||
sb2.append(" while trying to fail enqueued calls.");
|
||||
Log.wtf("GoogleApiManager", sb2.toString(), new Exception());
|
||||
}
|
||||
return true;
|
||||
case 6:
|
||||
if (PlatformVersion.a() && (this.d.getApplicationContext() instanceof Application)) {
|
||||
BackgroundDetector.a((Application) this.d.getApplicationContext());
|
||||
BackgroundDetector.b().a(new zabi(this));
|
||||
if (!BackgroundDetector.b().a(true)) {
|
||||
this.c = 300000L;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case 7:
|
||||
a((GoogleApi<?>) message.obj);
|
||||
return true;
|
||||
case 9:
|
||||
if (this.h.containsKey(message.obj)) {
|
||||
this.h.get(message.obj).e();
|
||||
}
|
||||
return true;
|
||||
case 10:
|
||||
Iterator<zai<?>> it3 = this.k.iterator();
|
||||
while (it3.hasNext()) {
|
||||
this.h.remove(it3.next()).h();
|
||||
}
|
||||
this.k.clear();
|
||||
return true;
|
||||
case 11:
|
||||
if (this.h.containsKey(message.obj)) {
|
||||
this.h.get(message.obj).g();
|
||||
}
|
||||
return true;
|
||||
case 12:
|
||||
if (this.h.containsKey(message.obj)) {
|
||||
this.h.get(message.obj).l();
|
||||
}
|
||||
return true;
|
||||
case 14:
|
||||
zaaf zaafVar = (zaaf) message.obj;
|
||||
zai<?> b = zaafVar.b();
|
||||
if (this.h.containsKey(b)) {
|
||||
zaafVar.a().a((TaskCompletionSource<Boolean>) Boolean.valueOf(zaa.a((zaa) this.h.get(b), false)));
|
||||
} else {
|
||||
zaafVar.a().a((TaskCompletionSource<Boolean>) false);
|
||||
}
|
||||
return true;
|
||||
case 15:
|
||||
zab zabVar = (zab) message.obj;
|
||||
if (this.h.containsKey(zabVar.a)) {
|
||||
this.h.get(zabVar.a).a(zabVar);
|
||||
}
|
||||
return true;
|
||||
case 16:
|
||||
zab zabVar2 = (zab) message.obj;
|
||||
if (this.h.containsKey(zabVar2.a)) {
|
||||
this.h.get(zabVar2.a).b(zabVar2);
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
StringBuilder sb3 = new StringBuilder(31);
|
||||
sb3.append("Unknown message id: ");
|
||||
sb3.append(i);
|
||||
Log.w("GoogleApiManager", sb3.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class zaa<O extends Api.ApiOptions> implements GoogleApiClient$ConnectionCallbacks, GoogleApiClient$OnConnectionFailedListener, zar {
|
||||
private final Api.Client b;
|
||||
private final Api.AnyClient c;
|
||||
private final zai<O> d;
|
||||
private final zaab e;
|
||||
private final int h;
|
||||
private final zace i;
|
||||
private boolean j;
|
||||
private final Queue<com.google.android.gms.common.api.internal.zab> a = new LinkedList();
|
||||
private final Set<zak> f = new HashSet();
|
||||
private final Map<ListenerHolder$ListenerKey<?>, zabw> g = new HashMap();
|
||||
private final List<zab> k = new ArrayList();
|
||||
private ConnectionResult l = null;
|
||||
|
||||
public zaa(GoogleApi<O> googleApi) {
|
||||
this.b = googleApi.a(GoogleApiManager.this.l.getLooper(), this);
|
||||
Api.Client client = this.b;
|
||||
if (client instanceof SimpleClientAdapter) {
|
||||
this.c = ((SimpleClientAdapter) client).x();
|
||||
} else {
|
||||
this.c = client;
|
||||
}
|
||||
this.d = googleApi.c();
|
||||
this.e = new zaab();
|
||||
this.h = googleApi.b();
|
||||
if (this.b.i()) {
|
||||
this.i = googleApi.a(GoogleApiManager.this.d, GoogleApiManager.this.l);
|
||||
} else {
|
||||
this.i = null;
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean c(ConnectionResult connectionResult) {
|
||||
synchronized (GoogleApiManager.o) {
|
||||
if (GoogleApiManager.this.i != null && GoogleApiManager.this.j.contains(this.d)) {
|
||||
GoogleApiManager.this.i.a(connectionResult, this.h);
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void m() {
|
||||
j();
|
||||
d(ConnectionResult.RESULT_SUCCESS);
|
||||
p();
|
||||
Iterator<zabw> it = this.g.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
zabw next = it.next();
|
||||
if (a(next.a.b()) != null) {
|
||||
it.remove();
|
||||
} else {
|
||||
try {
|
||||
next.a.a(this.c, new TaskCompletionSource<>());
|
||||
} catch (DeadObjectException unused) {
|
||||
i(1);
|
||||
this.b.a();
|
||||
} catch (RemoteException unused2) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
o();
|
||||
q();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void n() {
|
||||
j();
|
||||
this.j = true;
|
||||
this.e.c();
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 9, this.d), GoogleApiManager.this.a);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 11, this.d), GoogleApiManager.this.b);
|
||||
GoogleApiManager.this.f.a();
|
||||
}
|
||||
|
||||
private final void o() {
|
||||
ArrayList arrayList = new ArrayList(this.a);
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
Object obj = arrayList.get(i);
|
||||
i++;
|
||||
com.google.android.gms.common.api.internal.zab zabVar = (com.google.android.gms.common.api.internal.zab) obj;
|
||||
if (!this.b.b()) {
|
||||
return;
|
||||
}
|
||||
if (b(zabVar)) {
|
||||
this.a.remove(zabVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void p() {
|
||||
if (this.j) {
|
||||
GoogleApiManager.this.l.removeMessages(11, this.d);
|
||||
GoogleApiManager.this.l.removeMessages(9, this.d);
|
||||
this.j = false;
|
||||
}
|
||||
}
|
||||
|
||||
private final void q() {
|
||||
GoogleApiManager.this.l.removeMessages(12, this.d);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(GoogleApiManager.this.l.obtainMessage(12, this.d), GoogleApiManager.this.c);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener
|
||||
public final void a(ConnectionResult connectionResult) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
zace zaceVar = this.i;
|
||||
if (zaceVar != null) {
|
||||
zaceVar.i();
|
||||
}
|
||||
j();
|
||||
GoogleApiManager.this.f.a();
|
||||
d(connectionResult);
|
||||
if (connectionResult.getErrorCode() == 4) {
|
||||
a(GoogleApiManager.n);
|
||||
return;
|
||||
}
|
||||
if (this.a.isEmpty()) {
|
||||
this.l = connectionResult;
|
||||
return;
|
||||
}
|
||||
if (c(connectionResult) || GoogleApiManager.this.b(connectionResult, this.h)) {
|
||||
return;
|
||||
}
|
||||
if (connectionResult.getErrorCode() == 18) {
|
||||
this.j = true;
|
||||
}
|
||||
if (this.j) {
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 9, this.d), GoogleApiManager.this.a);
|
||||
return;
|
||||
}
|
||||
String a = this.d.a();
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 38);
|
||||
sb.append("API: ");
|
||||
sb.append(a);
|
||||
sb.append(" is not available on this device.");
|
||||
a(new Status(17, sb.toString()));
|
||||
}
|
||||
|
||||
public final void b(ConnectionResult connectionResult) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
this.b.a();
|
||||
a(connectionResult);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void d(Bundle bundle) {
|
||||
if (Looper.myLooper() == GoogleApiManager.this.l.getLooper()) {
|
||||
m();
|
||||
} else {
|
||||
GoogleApiManager.this.l.post(new zabj(this));
|
||||
}
|
||||
}
|
||||
|
||||
public final void e() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.j) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
public final Api.Client f() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final void g() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.j) {
|
||||
p();
|
||||
a(GoogleApiManager.this.e.b(GoogleApiManager.this.d) == 18 ? new Status(8, "Connection timed out while waiting for Google Play services update to complete.") : new Status(8, "API failed to connect while resuming due to an unknown error."));
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
|
||||
public final void h() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
a(GoogleApiManager.m);
|
||||
this.e.b();
|
||||
for (ListenerHolder$ListenerKey listenerHolder$ListenerKey : (ListenerHolder$ListenerKey[]) this.g.keySet().toArray(new ListenerHolder$ListenerKey[this.g.size()])) {
|
||||
a(new zah(listenerHolder$ListenerKey, new TaskCompletionSource()));
|
||||
}
|
||||
d(new ConnectionResult(4));
|
||||
if (this.b.b()) {
|
||||
this.b.a(new zabm(this));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void i(int i) {
|
||||
if (Looper.myLooper() == GoogleApiManager.this.l.getLooper()) {
|
||||
n();
|
||||
} else {
|
||||
GoogleApiManager.this.l.post(new zabk(this));
|
||||
}
|
||||
}
|
||||
|
||||
public final void j() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
this.l = null;
|
||||
}
|
||||
|
||||
public final ConnectionResult k() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
return this.l;
|
||||
}
|
||||
|
||||
public final boolean l() {
|
||||
return a(true);
|
||||
}
|
||||
|
||||
private final boolean b(com.google.android.gms.common.api.internal.zab zabVar) {
|
||||
if (!(zabVar instanceof com.google.android.gms.common.api.internal.zac)) {
|
||||
c(zabVar);
|
||||
return true;
|
||||
}
|
||||
com.google.android.gms.common.api.internal.zac zacVar = (com.google.android.gms.common.api.internal.zac) zabVar;
|
||||
Feature a = a(zacVar.b((zaa<?>) this));
|
||||
if (a == null) {
|
||||
c(zabVar);
|
||||
return true;
|
||||
}
|
||||
if (zacVar.c(this)) {
|
||||
zab zabVar2 = new zab(this.d, a, null);
|
||||
int indexOf = this.k.indexOf(zabVar2);
|
||||
if (indexOf >= 0) {
|
||||
zab zabVar3 = this.k.get(indexOf);
|
||||
GoogleApiManager.this.l.removeMessages(15, zabVar3);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 15, zabVar3), GoogleApiManager.this.a);
|
||||
return false;
|
||||
}
|
||||
this.k.add(zabVar2);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 15, zabVar2), GoogleApiManager.this.a);
|
||||
GoogleApiManager.this.l.sendMessageDelayed(Message.obtain(GoogleApiManager.this.l, 16, zabVar2), GoogleApiManager.this.b);
|
||||
ConnectionResult connectionResult = new ConnectionResult(2, null);
|
||||
if (c(connectionResult)) {
|
||||
return false;
|
||||
}
|
||||
GoogleApiManager.this.b(connectionResult, this.h);
|
||||
return false;
|
||||
}
|
||||
zacVar.a(new UnsupportedApiCallException(a));
|
||||
return false;
|
||||
}
|
||||
|
||||
private final void d(ConnectionResult connectionResult) {
|
||||
for (zak zakVar : this.f) {
|
||||
String str = null;
|
||||
if (Objects.a(connectionResult, ConnectionResult.RESULT_SUCCESS)) {
|
||||
str = this.b.e();
|
||||
}
|
||||
zakVar.a(this.d, connectionResult, str);
|
||||
}
|
||||
this.f.clear();
|
||||
}
|
||||
|
||||
public final Map<ListenerHolder$ListenerKey<?>, zabw> i() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
private final void c(com.google.android.gms.common.api.internal.zab zabVar) {
|
||||
zabVar.a(this.e, d());
|
||||
try {
|
||||
zabVar.a((zaa<?>) this);
|
||||
} catch (DeadObjectException unused) {
|
||||
i(1);
|
||||
this.b.a();
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean d() {
|
||||
return this.b.i();
|
||||
}
|
||||
|
||||
final boolean c() {
|
||||
return this.b.b();
|
||||
}
|
||||
|
||||
public final void a(com.google.android.gms.common.api.internal.zab zabVar) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.b.b()) {
|
||||
if (b(zabVar)) {
|
||||
q();
|
||||
return;
|
||||
} else {
|
||||
this.a.add(zabVar);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.a.add(zabVar);
|
||||
ConnectionResult connectionResult = this.l;
|
||||
if (connectionResult != null && connectionResult.hasResolution()) {
|
||||
a(this.l);
|
||||
} else {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
public final int b() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void b(zab zabVar) {
|
||||
Feature[] b;
|
||||
if (this.k.remove(zabVar)) {
|
||||
GoogleApiManager.this.l.removeMessages(15, zabVar);
|
||||
GoogleApiManager.this.l.removeMessages(16, zabVar);
|
||||
Feature feature = zabVar.b;
|
||||
ArrayList arrayList = new ArrayList(this.a.size());
|
||||
for (com.google.android.gms.common.api.internal.zab zabVar2 : this.a) {
|
||||
if ((zabVar2 instanceof com.google.android.gms.common.api.internal.zac) && (b = ((com.google.android.gms.common.api.internal.zac) zabVar2).b((zaa<?>) this)) != null && ArrayUtils.a(b, feature)) {
|
||||
arrayList.add(zabVar2);
|
||||
}
|
||||
}
|
||||
int size = arrayList.size();
|
||||
int i = 0;
|
||||
while (i < size) {
|
||||
Object obj = arrayList.get(i);
|
||||
i++;
|
||||
com.google.android.gms.common.api.internal.zab zabVar3 = (com.google.android.gms.common.api.internal.zab) obj;
|
||||
this.a.remove(zabVar3);
|
||||
zabVar3.a(new UnsupportedApiCallException(feature));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void a(Status status) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
Iterator<com.google.android.gms.common.api.internal.zab> it = this.a.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(status);
|
||||
}
|
||||
this.a.clear();
|
||||
}
|
||||
|
||||
private final boolean a(boolean z) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (!this.b.b() || this.g.size() != 0) {
|
||||
return false;
|
||||
}
|
||||
if (!this.e.a()) {
|
||||
this.b.a();
|
||||
return true;
|
||||
}
|
||||
if (z) {
|
||||
q();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void a() {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
if (this.b.b() || this.b.d()) {
|
||||
return;
|
||||
}
|
||||
int a = GoogleApiManager.this.f.a(GoogleApiManager.this.d, this.b);
|
||||
if (a != 0) {
|
||||
a(new ConnectionResult(a, null));
|
||||
return;
|
||||
}
|
||||
zac zacVar = GoogleApiManager.this.new zac(this.b, this.d);
|
||||
if (this.b.i()) {
|
||||
this.i.a(zacVar);
|
||||
}
|
||||
this.b.a(zacVar);
|
||||
}
|
||||
|
||||
public final void a(zak zakVar) {
|
||||
Preconditions.a(GoogleApiManager.this.l);
|
||||
this.f.add(zakVar);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private final Feature a(Feature[] featureArr) {
|
||||
if (featureArr != null && featureArr.length != 0) {
|
||||
Feature[] h = this.b.h();
|
||||
if (h == null) {
|
||||
h = new Feature[0];
|
||||
}
|
||||
ArrayMap arrayMap = new ArrayMap(h.length);
|
||||
for (Feature feature : h) {
|
||||
arrayMap.put(feature.getName(), Long.valueOf(feature.getVersion()));
|
||||
}
|
||||
for (Feature feature2 : featureArr) {
|
||||
if (!arrayMap.containsKey(feature2.getName()) || ((Long) arrayMap.get(feature2.getName())).longValue() < feature2.getVersion()) {
|
||||
return feature2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void a(zab zabVar) {
|
||||
if (this.k.contains(zabVar) && !this.j) {
|
||||
if (!this.b.b()) {
|
||||
a();
|
||||
} else {
|
||||
o();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static /* synthetic */ boolean a(zaa zaaVar, boolean z) {
|
||||
return zaaVar.a(false);
|
||||
}
|
||||
}
|
||||
|
||||
private static class zab {
|
||||
private final zai<?> a;
|
||||
private final Feature b;
|
||||
|
||||
private zab(zai<?> zaiVar, Feature feature) {
|
||||
this.a = zaiVar;
|
||||
this.b = feature;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (obj != null && (obj instanceof zab)) {
|
||||
zab zabVar = (zab) obj;
|
||||
if (Objects.a(this.a, zabVar.a) && Objects.a(this.b, zabVar.b)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return Objects.a(this.a, this.b);
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
Objects.ToStringHelper a = Objects.a(this);
|
||||
a.a("key", this.a);
|
||||
a.a("feature", this.b);
|
||||
return a.toString();
|
||||
}
|
||||
|
||||
/* synthetic */ zab(zai zaiVar, Feature feature, zabi zabiVar) {
|
||||
this(zaiVar, feature);
|
||||
}
|
||||
}
|
||||
|
||||
private final void a(GoogleApi<?> googleApi) {
|
||||
zai<?> c = googleApi.c();
|
||||
zaa<?> zaaVar = this.h.get(c);
|
||||
if (zaaVar == null) {
|
||||
zaaVar = new zaa<>(googleApi);
|
||||
this.h.put(c, zaaVar);
|
||||
}
|
||||
if (zaaVar.d()) {
|
||||
this.k.add(c);
|
||||
}
|
||||
zaaVar.a();
|
||||
}
|
||||
|
||||
public final void a() {
|
||||
Handler handler = this.l;
|
||||
handler.sendMessage(handler.obtainMessage(3));
|
||||
}
|
||||
|
||||
public final void a(ConnectionResult connectionResult, int i) {
|
||||
if (b(connectionResult, i)) {
|
||||
return;
|
||||
}
|
||||
Handler handler = this.l;
|
||||
handler.sendMessage(handler.obtainMessage(5, i, 0, connectionResult));
|
||||
}
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.R$string;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.StringResourceValueReader;
|
||||
import com.google.android.gms.common.internal.zzp;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public final class GoogleServices {
|
||||
private static final Object d = new Object();
|
||||
private static GoogleServices e;
|
||||
private final String a;
|
||||
private final Status b;
|
||||
private final boolean c;
|
||||
|
||||
GoogleServices(Context context) {
|
||||
Resources resources = context.getResources();
|
||||
int identifier = resources.getIdentifier("google_app_measurement_enable", "integer", resources.getResourcePackageName(R$string.common_google_play_services_unknown_issue));
|
||||
if (identifier != 0) {
|
||||
this.c = !(resources.getInteger(identifier) != 0);
|
||||
} else {
|
||||
this.c = false;
|
||||
}
|
||||
String a = zzp.a(context);
|
||||
a = a == null ? new StringResourceValueReader(context).a("google_app_id") : a;
|
||||
if (TextUtils.isEmpty(a)) {
|
||||
this.b = new Status(10, "Missing google app id value from from string resources with name google_app_id.");
|
||||
this.a = null;
|
||||
} else {
|
||||
this.a = a;
|
||||
this.b = Status.RESULT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
public static Status a(Context context) {
|
||||
Status status;
|
||||
Preconditions.a(context, "Context must not be null.");
|
||||
synchronized (d) {
|
||||
if (e == null) {
|
||||
e = new GoogleServices(context);
|
||||
}
|
||||
status = e.b;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
public static boolean b() {
|
||||
return a("isMeasurementExplicitlyDisabled").c;
|
||||
}
|
||||
|
||||
public static String a() {
|
||||
return a("getGoogleAppId").a;
|
||||
}
|
||||
|
||||
private static GoogleServices a(String str) {
|
||||
GoogleServices googleServices;
|
||||
synchronized (d) {
|
||||
if (e != null) {
|
||||
googleServices = e;
|
||||
} else {
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 34);
|
||||
sb.append("Initialize must be called before ");
|
||||
sb.append(str);
|
||||
sb.append(".");
|
||||
throw new IllegalStateException(sb.toString());
|
||||
}
|
||||
}
|
||||
return googleServices;
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LifecycleActivity {
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Keep;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LifecycleCallback {
|
||||
@Keep
|
||||
private static LifecycleFragment getChimeraLifecycleFragmentImpl(LifecycleActivity lifecycleActivity) {
|
||||
throw new IllegalStateException("Method not available in SDK.");
|
||||
}
|
||||
|
||||
public void a() {
|
||||
}
|
||||
|
||||
public void a(int i, int i2, Intent intent) {
|
||||
}
|
||||
|
||||
public void a(Bundle bundle) {
|
||||
}
|
||||
|
||||
public void a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
}
|
||||
|
||||
public void b() {
|
||||
}
|
||||
|
||||
public void b(Bundle bundle) {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
}
|
||||
|
||||
public void d() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface LifecycleFragment {
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ListenerHolder$ListenerKey<L> {
|
||||
private final L a;
|
||||
private final String b;
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof ListenerHolder$ListenerKey)) {
|
||||
return false;
|
||||
}
|
||||
ListenerHolder$ListenerKey listenerHolder$ListenerKey = (ListenerHolder$ListenerKey) obj;
|
||||
return this.a == listenerHolder$ListenerKey.a && this.b.equals(listenerHolder$ListenerKey.b);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return (System.identityHashCode(this.a) * 31) + this.b.hashCode();
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.AnyClient;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class RegisterListenerMethod<A extends Api.AnyClient, L> {
|
||||
public abstract void a();
|
||||
|
||||
protected abstract void a(A a, TaskCompletionSource<Void> taskCompletionSource) throws RemoteException;
|
||||
|
||||
public abstract Feature[] b();
|
||||
|
||||
public final boolean c() {
|
||||
throw null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.AnyClient;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class UnregisterListenerMethod<A extends Api.AnyClient, L> {
|
||||
protected abstract void a(A a, TaskCompletionSource<Boolean> taskCompletionSource) throws RemoteException;
|
||||
}
|
48
sources/com/google/android/gms/common/api/internal/zaab.java
Normal file
48
sources/com/google/android/gms/common/api/internal/zaab.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zaab {
|
||||
private final Map<BasePendingResult<?>, Boolean> a = Collections.synchronizedMap(new WeakHashMap());
|
||||
private final Map<TaskCompletionSource<?>, Boolean> b = Collections.synchronizedMap(new WeakHashMap());
|
||||
|
||||
final boolean a() {
|
||||
return (this.a.isEmpty() && this.b.isEmpty()) ? false : true;
|
||||
}
|
||||
|
||||
public final void b() {
|
||||
a(false, GoogleApiManager.m);
|
||||
}
|
||||
|
||||
public final void c() {
|
||||
a(true, zacp.a);
|
||||
}
|
||||
|
||||
private final void a(boolean z, Status status) {
|
||||
HashMap hashMap;
|
||||
HashMap hashMap2;
|
||||
synchronized (this.a) {
|
||||
hashMap = new HashMap(this.a);
|
||||
}
|
||||
synchronized (this.b) {
|
||||
hashMap2 = new HashMap(this.b);
|
||||
}
|
||||
for (Map.Entry entry : hashMap.entrySet()) {
|
||||
if (z || ((Boolean) entry.getValue()).booleanValue()) {
|
||||
((BasePendingResult) entry.getKey()).b(status);
|
||||
}
|
||||
}
|
||||
for (Map.Entry entry2 : hashMap2.entrySet()) {
|
||||
if (z || ((Boolean) entry2.getValue()).booleanValue()) {
|
||||
((TaskCompletionSource) entry2.getKey()).b((Exception) new ApiException(status));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class zaae extends zal {
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zaaf.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zaaf.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zaaf {
|
||||
private final zai<?> a;
|
||||
private final TaskCompletionSource<Boolean> b;
|
||||
|
||||
public final TaskCompletionSource<Boolean> a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public final zai<?> b() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
32
sources/com/google/android/gms/common/api/internal/zab.java
Normal file
32
sources/com/google/android/gms/common/api/internal/zab.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.RemoteException;
|
||||
import android.os.TransactionTooLargeException;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zab {
|
||||
public zab(int i) {
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static Status a(RemoteException remoteException) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (PlatformVersion.b() && (remoteException instanceof TransactionTooLargeException)) {
|
||||
sb.append("TransactionTooLargeException: ");
|
||||
}
|
||||
sb.append(remoteException.getLocalizedMessage());
|
||||
return new Status(8, sb.toString());
|
||||
}
|
||||
|
||||
public abstract void a(Status status);
|
||||
|
||||
public abstract void a(GoogleApiManager.zaa<?> zaaVar) throws DeadObjectException;
|
||||
|
||||
public abstract void a(zaab zaabVar, boolean z);
|
||||
|
||||
public abstract void a(RuntimeException runtimeException);
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zabi.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zabi.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.BackgroundDetector;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabi implements BackgroundDetector.BackgroundStateChangeListener {
|
||||
private final /* synthetic */ GoogleApiManager a;
|
||||
|
||||
zabi(GoogleApiManager googleApiManager) {
|
||||
this.a = googleApiManager;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.BackgroundDetector.BackgroundStateChangeListener
|
||||
public final void a(boolean z) {
|
||||
this.a.l.sendMessage(this.a.l.obtainMessage(1, Boolean.valueOf(z)));
|
||||
}
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zabj.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zabj.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabj implements Runnable {
|
||||
private final /* synthetic */ GoogleApiManager.zaa a;
|
||||
|
||||
zabj(GoogleApiManager.zaa zaaVar) {
|
||||
this.a = zaaVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.m();
|
||||
}
|
||||
}
|
17
sources/com/google/android/gms/common/api/internal/zabk.java
Normal file
17
sources/com/google/android/gms/common/api/internal/zabk.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabk implements Runnable {
|
||||
private final /* synthetic */ GoogleApiManager.zaa a;
|
||||
|
||||
zabk(GoogleApiManager.zaa zaaVar) {
|
||||
this.a = zaaVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.a.n();
|
||||
}
|
||||
}
|
18
sources/com/google/android/gms/common/api/internal/zabm.java
Normal file
18
sources/com/google/android/gms/common/api/internal/zabm.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.common.internal.BaseGmsClient;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabm implements BaseGmsClient.SignOutCallbacks {
|
||||
final /* synthetic */ GoogleApiManager.zaa a;
|
||||
|
||||
zabm(GoogleApiManager.zaa zaaVar) {
|
||||
this.a = zaaVar;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.internal.BaseGmsClient.SignOutCallbacks
|
||||
public final void a() {
|
||||
GoogleApiManager.this.l.post(new zabn(this));
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/common/api/internal/zabn.java
Normal file
19
sources/com/google/android/gms/common/api/internal/zabn.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabn implements Runnable {
|
||||
private final /* synthetic */ zabm a;
|
||||
|
||||
zabn(zabm zabmVar) {
|
||||
this.a = zabmVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
Api.Client client;
|
||||
client = this.a.a.b;
|
||||
client.a();
|
||||
}
|
||||
}
|
46
sources/com/google/android/gms/common/api/internal/zabo.java
Normal file
46
sources/com/google/android/gms/common/api/internal/zabo.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zabo implements Runnable {
|
||||
private final /* synthetic */ ConnectionResult a;
|
||||
private final /* synthetic */ GoogleApiManager.zac b;
|
||||
|
||||
zabo(GoogleApiManager.zac zacVar, ConnectionResult connectionResult) {
|
||||
this.b = zacVar;
|
||||
this.a = connectionResult;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
zai zaiVar;
|
||||
Api.Client client;
|
||||
zai zaiVar2;
|
||||
Api.Client client2;
|
||||
if (!this.a.isSuccess()) {
|
||||
Map map = GoogleApiManager.this.h;
|
||||
zaiVar = this.b.b;
|
||||
((GoogleApiManager.zaa) map.get(zaiVar)).a(this.a);
|
||||
return;
|
||||
}
|
||||
GoogleApiManager.zac.a(this.b, true);
|
||||
client = this.b.a;
|
||||
if (client.i()) {
|
||||
this.b.a();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
client2 = this.b.a;
|
||||
client2.a(null, Collections.emptySet());
|
||||
} catch (SecurityException unused) {
|
||||
Map map2 = GoogleApiManager.this.h;
|
||||
zaiVar2 = this.b.b;
|
||||
((GoogleApiManager.zaa) map2.get(zaiVar2)).a(new ConnectionResult(10));
|
||||
}
|
||||
}
|
||||
}
|
28
sources/com/google/android/gms/common/api/internal/zabq.java
Normal file
28
sources/com/google/android/gms/common/api/internal/zabq.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zabq extends BroadcastReceiver {
|
||||
private Context a;
|
||||
private final zabr b;
|
||||
|
||||
public final synchronized void a() {
|
||||
if (this.a != null) {
|
||||
this.a.unregisterReceiver(this);
|
||||
}
|
||||
this.a = null;
|
||||
}
|
||||
|
||||
@Override // android.content.BroadcastReceiver
|
||||
public final void onReceive(Context context, Intent intent) {
|
||||
Uri data = intent.getData();
|
||||
if ("com.google.android.gms".equals(data != null ? data.getSchemeSpecificPart() : null)) {
|
||||
this.b.a();
|
||||
a();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zabr {
|
||||
public abstract void a();
|
||||
}
|
10
sources/com/google/android/gms/common/api/internal/zabv.java
Normal file
10
sources/com/google/android/gms/common/api/internal/zabv.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.GoogleApi;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zabv {
|
||||
public final zab a;
|
||||
public final int b;
|
||||
public final GoogleApi<?> c;
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zabw {
|
||||
public final RegisterListenerMethod<Api.AnyClient, ?> a;
|
||||
public final UnregisterListenerMethod<Api.AnyClient, ?> b;
|
||||
}
|
15
sources/com/google/android/gms/common/api/internal/zac.java
Normal file
15
sources/com/google/android/gms/common/api/internal/zac.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zac extends zab {
|
||||
public zac(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
public abstract Feature[] b(GoogleApiManager.zaa<?> zaaVar);
|
||||
|
||||
public abstract boolean c(GoogleApiManager.zaa<?> zaaVar);
|
||||
}
|
114
sources/com/google/android/gms/common/api/internal/zace.java
Normal file
114
sources/com/google/android/gms/common/api/internal/zace.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks;
|
||||
import com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.ClientSettings;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.ResolveAccountResponse;
|
||||
import com.google.android.gms.signin.SignInOptions;
|
||||
import com.google.android.gms.signin.internal.zaj;
|
||||
import com.google.android.gms.signin.zaa;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zace extends com.google.android.gms.signin.internal.zac implements GoogleApiClient$ConnectionCallbacks, GoogleApiClient$OnConnectionFailedListener {
|
||||
private static Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> h = zaa.c;
|
||||
private final Context a;
|
||||
private final Handler b;
|
||||
private final Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> c;
|
||||
private Set<Scope> d;
|
||||
private ClientSettings e;
|
||||
private com.google.android.gms.signin.zad f;
|
||||
private zach g;
|
||||
|
||||
public zace(Context context, Handler handler, ClientSettings clientSettings) {
|
||||
this(context, handler, clientSettings, h);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void b(zaj zajVar) {
|
||||
ConnectionResult connectionResult = zajVar.getConnectionResult();
|
||||
if (connectionResult.isSuccess()) {
|
||||
ResolveAccountResponse zacw = zajVar.zacw();
|
||||
ConnectionResult connectionResult2 = zacw.getConnectionResult();
|
||||
if (!connectionResult2.isSuccess()) {
|
||||
String valueOf = String.valueOf(connectionResult2);
|
||||
StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 48);
|
||||
sb.append("Sign-in succeeded with resolve account failure: ");
|
||||
sb.append(valueOf);
|
||||
Log.wtf("SignInCoordinator", sb.toString(), new Exception());
|
||||
this.g.b(connectionResult2);
|
||||
this.f.a();
|
||||
return;
|
||||
}
|
||||
this.g.a(zacw.getAccountAccessor(), this.d);
|
||||
} else {
|
||||
this.g.b(connectionResult);
|
||||
}
|
||||
this.f.a();
|
||||
}
|
||||
|
||||
public final void a(zach zachVar) {
|
||||
com.google.android.gms.signin.zad zadVar = this.f;
|
||||
if (zadVar != null) {
|
||||
zadVar.a();
|
||||
}
|
||||
this.e.a(Integer.valueOf(System.identityHashCode(this)));
|
||||
Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> abstractClientBuilder = this.c;
|
||||
Context context = this.a;
|
||||
Looper looper = this.b.getLooper();
|
||||
ClientSettings clientSettings = this.e;
|
||||
this.f = abstractClientBuilder.a(context, looper, clientSettings, clientSettings.h(), this, this);
|
||||
this.g = zachVar;
|
||||
Set<Scope> set = this.d;
|
||||
if (set == null || set.isEmpty()) {
|
||||
this.b.post(new zacf(this));
|
||||
} else {
|
||||
this.f.c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void d(Bundle bundle) {
|
||||
this.f.a(this);
|
||||
}
|
||||
|
||||
public final void i() {
|
||||
com.google.android.gms.signin.zad zadVar = this.f;
|
||||
if (zadVar != null) {
|
||||
zadVar.a();
|
||||
}
|
||||
}
|
||||
|
||||
public zace(Context context, Handler handler, ClientSettings clientSettings, Api.AbstractClientBuilder<? extends com.google.android.gms.signin.zad, SignInOptions> abstractClientBuilder) {
|
||||
this.a = context;
|
||||
this.b = handler;
|
||||
Preconditions.a(clientSettings, "ClientSettings must not be null");
|
||||
this.e = clientSettings;
|
||||
this.d = clientSettings.g();
|
||||
this.c = abstractClientBuilder;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks
|
||||
public final void i(int i) {
|
||||
this.f.a();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener
|
||||
public final void a(ConnectionResult connectionResult) {
|
||||
this.g.b(connectionResult);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.signin.internal.zad
|
||||
public final void a(zaj zajVar) {
|
||||
this.b.post(new zacg(this, zajVar));
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/common/api/internal/zacf.java
Normal file
19
sources/com/google/android/gms/common/api/internal/zacf.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zacf implements Runnable {
|
||||
private final /* synthetic */ zace a;
|
||||
|
||||
zacf(zace zaceVar) {
|
||||
this.a = zaceVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
zach zachVar;
|
||||
zachVar = this.a.g;
|
||||
zachVar.b(new ConnectionResult(4));
|
||||
}
|
||||
}
|
19
sources/com/google/android/gms/common/api/internal/zacg.java
Normal file
19
sources/com/google/android/gms/common/api/internal/zacg.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.signin.internal.zaj;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zacg implements Runnable {
|
||||
private final /* synthetic */ zaj a;
|
||||
private final /* synthetic */ zace b;
|
||||
|
||||
zacg(zace zaceVar, zaj zajVar) {
|
||||
this.b = zaceVar;
|
||||
this.a = zajVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
this.b.b(this.a);
|
||||
}
|
||||
}
|
13
sources/com/google/android/gms/common/api/internal/zach.java
Normal file
13
sources/com/google/android/gms/common/api/internal/zach.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
import com.google.android.gms.common.internal.IAccountAccessor;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface zach {
|
||||
void a(IAccountAccessor iAccountAccessor, Set<Scope> set);
|
||||
|
||||
void b(ConnectionResult connectionResult);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Status;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zacp {
|
||||
public static final Status a = new Status(8, "The connection to Google Play services was lost");
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface zacs {
|
||||
void a(BasePendingResult<?> basePendingResult);
|
||||
}
|
48
sources/com/google/android/gms/common/api/internal/zad.java
Normal file
48
sources/com/google/android/gms/common/api/internal/zad.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.DeadObjectException;
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class zad<T> extends zac {
|
||||
protected final TaskCompletionSource<T> a;
|
||||
|
||||
public zad(int i, TaskCompletionSource<T> taskCompletionSource) {
|
||||
super(i);
|
||||
this.a = taskCompletionSource;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public void a(Status status) {
|
||||
this.a.b(new ApiException(status));
|
||||
}
|
||||
|
||||
protected abstract void d(GoogleApiManager.zaa<?> zaaVar) throws RemoteException;
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public void a(RuntimeException runtimeException) {
|
||||
this.a.b(runtimeException);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public final void a(GoogleApiManager.zaa<?> zaaVar) throws DeadObjectException {
|
||||
Status a;
|
||||
Status a2;
|
||||
try {
|
||||
d(zaaVar);
|
||||
} catch (DeadObjectException e) {
|
||||
a2 = zab.a(e);
|
||||
a(a2);
|
||||
throw e;
|
||||
} catch (RemoteException e2) {
|
||||
a = zab.a(e2);
|
||||
a(a);
|
||||
} catch (RuntimeException e3) {
|
||||
a(e3);
|
||||
}
|
||||
}
|
||||
}
|
46
sources/com/google/android/gms/common/api/internal/zah.java
Normal file
46
sources/com/google/android/gms/common/api/internal/zah.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import com.google.android.gms.common.Feature;
|
||||
import com.google.android.gms.common.api.internal.GoogleApiManager;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zah extends zad<Boolean> {
|
||||
private final ListenerHolder$ListenerKey<?> b;
|
||||
|
||||
public zah(ListenerHolder$ListenerKey<?> listenerHolder$ListenerKey, TaskCompletionSource<Boolean> taskCompletionSource) {
|
||||
super(4, taskCompletionSource);
|
||||
this.b = listenerHolder$ListenerKey;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zab
|
||||
public final /* bridge */ /* synthetic */ void a(zaab zaabVar, boolean z) {
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zac
|
||||
public final Feature[] b(GoogleApiManager.zaa<?> zaaVar) {
|
||||
zabw zabwVar = zaaVar.i().get(this.b);
|
||||
if (zabwVar == null) {
|
||||
return null;
|
||||
}
|
||||
return zabwVar.a.b();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zac
|
||||
public final boolean c(GoogleApiManager.zaa<?> zaaVar) {
|
||||
zabw zabwVar = zaaVar.i().get(this.b);
|
||||
return zabwVar != null && zabwVar.a.c();
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.api.internal.zad
|
||||
public final void d(GoogleApiManager.zaa<?> zaaVar) throws RemoteException {
|
||||
zabw remove = zaaVar.i().remove(this.b);
|
||||
if (remove == null) {
|
||||
this.a.b((TaskCompletionSource<T>) false);
|
||||
} else {
|
||||
remove.b.a(zaaVar.f(), this.a);
|
||||
remove.a.a();
|
||||
}
|
||||
}
|
||||
}
|
32
sources/com/google/android/gms/common/api/internal/zai.java
Normal file
32
sources/com/google/android/gms/common/api/internal/zai.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.Api;
|
||||
import com.google.android.gms.common.api.Api.ApiOptions;
|
||||
import com.google.android.gms.common.internal.Objects;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zai<O extends Api.ApiOptions> {
|
||||
private final boolean a;
|
||||
private final int b;
|
||||
private final Api<O> c;
|
||||
private final O d;
|
||||
|
||||
public final String a() {
|
||||
return this.c.a();
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof zai)) {
|
||||
return false;
|
||||
}
|
||||
zai zaiVar = (zai) obj;
|
||||
return !this.a && !zaiVar.a && Objects.a(this.c, zaiVar.c) && Objects.a(this.d, zaiVar.d);
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
37
sources/com/google/android/gms/common/api/internal/zak.java
Normal file
37
sources/com/google/android/gms/common/api/internal/zak.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import androidx.collection.ArrayMap;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.api.AvailabilityException;
|
||||
import com.google.android.gms.tasks.TaskCompletionSource;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zak {
|
||||
private final ArrayMap<zai<?>, ConnectionResult> a;
|
||||
private final ArrayMap<zai<?>, String> b;
|
||||
private final TaskCompletionSource<Map<zai<?>, String>> c;
|
||||
private int d;
|
||||
private boolean e;
|
||||
|
||||
public final Set<zai<?>> a() {
|
||||
return this.a.keySet();
|
||||
}
|
||||
|
||||
public final void a(zai<?> zaiVar, ConnectionResult connectionResult, String str) {
|
||||
this.a.put(zaiVar, connectionResult);
|
||||
this.b.put(zaiVar, str);
|
||||
this.d--;
|
||||
if (!connectionResult.isSuccess()) {
|
||||
this.e = true;
|
||||
}
|
||||
if (this.d == 0) {
|
||||
if (!this.e) {
|
||||
this.c.a((TaskCompletionSource<Map<zai<?>, String>>) this.b);
|
||||
} else {
|
||||
this.c.a(new AvailabilityException(this.a));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
sources/com/google/android/gms/common/api/internal/zal.java
Normal file
11
sources/com/google/android/gms/common/api/internal/zal.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class zal extends LifecycleCallback implements DialogInterface.OnCancelListener {
|
||||
public final void a(ConnectionResult connectionResult, int i) {
|
||||
throw null;
|
||||
}
|
||||
}
|
12
sources/com/google/android/gms/common/api/internal/zap.java
Normal file
12
sources/com/google/android/gms/common/api/internal/zap.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class zap extends ThreadLocal<Boolean> {
|
||||
zap() {
|
||||
}
|
||||
|
||||
@Override // java.lang.ThreadLocal
|
||||
protected final /* synthetic */ Boolean initialValue() {
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface zar extends GoogleApiClient$ConnectionCallbacks {
|
||||
}
|
95
sources/com/google/android/gms/common/api/internal/zza.java
Normal file
95
sources/com/google/android/gms/common/api/internal/zza.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.google.android.gms.common.api.internal;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.collection.ArrayMap;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zza extends Fragment implements LifecycleFragment {
|
||||
private Map<String, LifecycleCallback> a = new ArrayMap();
|
||||
|
||||
static {
|
||||
new WeakHashMap();
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
|
||||
super.dump(str, fileDescriptor, printWriter, strArr);
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(str, fileDescriptor, printWriter, strArr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(i, i2, intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
for (Map.Entry<String, LifecycleCallback> entry : this.a.entrySet()) {
|
||||
entry.getValue().a(bundle != null ? bundle.getBundle(entry.getKey()) : null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onDestroy() {
|
||||
super.onDestroy();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onResume() {
|
||||
super.onResume();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().b();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onSaveInstanceState(Bundle bundle) {
|
||||
super.onSaveInstanceState(bundle);
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<String, LifecycleCallback> entry : this.a.entrySet()) {
|
||||
Bundle bundle2 = new Bundle();
|
||||
entry.getValue().b(bundle2);
|
||||
bundle.putBundle(entry.getKey(), bundle2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onStart() {
|
||||
super.onStart();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().c();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public final void onStop() {
|
||||
super.onStop();
|
||||
Iterator<LifecycleCallback> it = this.a.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().d();
|
||||
}
|
||||
}
|
||||
}
|
33
sources/com/google/android/gms/common/api/zza.java
Normal file
33
sources/com/google/android/gms/common/api/zza.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zza implements Parcelable.Creator<Scope> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Scope createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
String str = null;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 != 2) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
str = SafeParcelReader.n(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new Scope(i, str);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Scope[] newArray(int i) {
|
||||
return new Scope[i];
|
||||
}
|
||||
}
|
40
sources/com/google/android/gms/common/api/zzb.java
Normal file
40
sources/com/google/android/gms/common/api/zzb.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.google.android.gms.common.api;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class zzb implements Parcelable.Creator<Status> {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Status createFromParcel(Parcel parcel) {
|
||||
int b = SafeParcelReader.b(parcel);
|
||||
int i = 0;
|
||||
String str = null;
|
||||
PendingIntent pendingIntent = null;
|
||||
int i2 = 0;
|
||||
while (parcel.dataPosition() < b) {
|
||||
int a = SafeParcelReader.a(parcel);
|
||||
int a2 = SafeParcelReader.a(a);
|
||||
if (a2 == 1) {
|
||||
i2 = SafeParcelReader.x(parcel, a);
|
||||
} else if (a2 == 2) {
|
||||
str = SafeParcelReader.n(parcel, a);
|
||||
} else if (a2 == 3) {
|
||||
pendingIntent = (PendingIntent) SafeParcelReader.a(parcel, a, PendingIntent.CREATOR);
|
||||
} else if (a2 != 1000) {
|
||||
SafeParcelReader.C(parcel, a);
|
||||
} else {
|
||||
i = SafeParcelReader.x(parcel, a);
|
||||
}
|
||||
}
|
||||
SafeParcelReader.q(parcel, b);
|
||||
return new Status(i, i2, str, pendingIntent);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Status[] newArray(int i) {
|
||||
return new Status[i];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user