146 lines
5.1 KiB
Java
146 lines
5.1 KiB
Java
|
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.ConnectionResult;
|
||
|
import com.google.android.gms.common.internal.Objects;
|
||
|
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;
|
||
|
import com.huawei.hms.adapter.internal.CommonCode;
|
||
|
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class Status extends AbstractSafeParcelable implements Result, ReflectedParcelable {
|
||
|
final int zzb;
|
||
|
private final int zzc;
|
||
|
private final String zzd;
|
||
|
private final PendingIntent zze;
|
||
|
private final ConnectionResult zzf;
|
||
|
public static final Status RESULT_SUCCESS_CACHE = new Status(-1);
|
||
|
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);
|
||
|
public static final Status zza = new Status(17);
|
||
|
public static final Status RESULT_DEAD_CLIENT = new Status(18);
|
||
|
public static final Parcelable.Creator<Status> CREATOR = new zzb();
|
||
|
|
||
|
public Status(int i) {
|
||
|
this(i, (String) null);
|
||
|
}
|
||
|
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (!(obj instanceof Status)) {
|
||
|
return false;
|
||
|
}
|
||
|
Status status = (Status) obj;
|
||
|
return this.zzb == status.zzb && this.zzc == status.zzc && Objects.equal(this.zzd, status.zzd) && Objects.equal(this.zze, status.zze) && Objects.equal(this.zzf, status.zzf);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.Result
|
||
|
public final Status getStatus() {
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public final int hashCode() {
|
||
|
int i = this.zzb;
|
||
|
int i2 = this.zzc;
|
||
|
return Objects.hashCode(Integer.valueOf(i), Integer.valueOf(i2), this.zzd, this.zze, this.zzf);
|
||
|
}
|
||
|
|
||
|
public final void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
|
||
|
if (hasResolution()) {
|
||
|
PendingIntent pendingIntent = this.zze;
|
||
|
Preconditions.checkNotNull(pendingIntent);
|
||
|
activity.startIntentSenderForResult(pendingIntent.getIntentSender(), i, null, 0, 0, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public final String toString() {
|
||
|
Objects.ToStringHelper stringHelper = Objects.toStringHelper(this);
|
||
|
stringHelper.add(HiAnalyticsConstant.HaKey.BI_KEY_RESULT, zza());
|
||
|
stringHelper.add(CommonCode.MapKey.HAS_RESOLUTION, this.zze);
|
||
|
return stringHelper.toString();
|
||
|
}
|
||
|
|
||
|
@Override // android.os.Parcelable
|
||
|
public final void writeToParcel(Parcel parcel, int i) {
|
||
|
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||
|
SafeParcelWriter.writeInt(parcel, 1, getStatusCode());
|
||
|
SafeParcelWriter.writeString(parcel, 2, getStatusMessage(), false);
|
||
|
SafeParcelWriter.writeParcelable(parcel, 3, this.zze, i, false);
|
||
|
SafeParcelWriter.writeParcelable(parcel, 4, getConnectionResult(), i, false);
|
||
|
SafeParcelWriter.writeInt(parcel, 1000, this.zzb);
|
||
|
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
|
||
|
}
|
||
|
|
||
|
public final String zza() {
|
||
|
String str = this.zzd;
|
||
|
return str != null ? str : CommonStatusCodes.getStatusCodeString(this.zzc);
|
||
|
}
|
||
|
|
||
|
public Status(int i, String str) {
|
||
|
this(1, i, str, null, null);
|
||
|
}
|
||
|
|
||
|
public Status(int i, String str, PendingIntent pendingIntent) {
|
||
|
this(1, i, str, pendingIntent, null);
|
||
|
}
|
||
|
|
||
|
public Status(ConnectionResult connectionResult, String str) {
|
||
|
this(connectionResult, str, 17);
|
||
|
}
|
||
|
|
||
|
@Deprecated
|
||
|
public Status(ConnectionResult connectionResult, String str, int i) {
|
||
|
this(1, i, str, connectionResult.getResolution(), connectionResult);
|
||
|
}
|
||
|
|
||
|
public final boolean isSuccess() {
|
||
|
return this.zzc <= 0;
|
||
|
}
|
||
|
|
||
|
public final boolean isInterrupted() {
|
||
|
return this.zzc == 14;
|
||
|
}
|
||
|
|
||
|
public final boolean isCanceled() {
|
||
|
return this.zzc == 16;
|
||
|
}
|
||
|
|
||
|
public final boolean hasResolution() {
|
||
|
return this.zze != null;
|
||
|
}
|
||
|
|
||
|
public final String getStatusMessage() {
|
||
|
return this.zzd;
|
||
|
}
|
||
|
|
||
|
public final int getStatusCode() {
|
||
|
return this.zzc;
|
||
|
}
|
||
|
|
||
|
public final PendingIntent getResolution() {
|
||
|
return this.zze;
|
||
|
}
|
||
|
|
||
|
public final ConnectionResult getConnectionResult() {
|
||
|
return this.zzf;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public Status(int i, int i2, String str, PendingIntent pendingIntent, ConnectionResult connectionResult) {
|
||
|
this.zzb = i;
|
||
|
this.zzc = i2;
|
||
|
this.zzd = str;
|
||
|
this.zze = pendingIntent;
|
||
|
this.zzf = connectionResult;
|
||
|
}
|
||
|
}
|