120 lines
3.7 KiB
Java
120 lines
3.7 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.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);
|
|
}
|
|
}
|