what-the-bank/sources/com/huawei/hms/api/ConnectionResult.java

209 lines
7.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.api;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.IntentSender;
import android.os.Parcel;
import android.os.Parcelable;
import com.huawei.hms.common.internal.Objects;
import com.huawei.hms.framework.network.grs.GrsBaseInfo;
/* loaded from: classes2.dex */
public final class ConnectionResult implements Parcelable {
public static final int API_UNAVAILABLE = 1000;
public static final int BINDFAIL_RESOLUTION_BACKGROUND = 7;
public static final int BINDFAIL_RESOLUTION_REQUIRED = 6;
public static final int CANCELED = 13;
public static final Parcelable.Creator<ConnectionResult> CREATOR = new a();
public static final int DEVELOPER_ERROR = 10;
public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 9002;
public static final int INTERNAL_ERROR = 8;
public static final int INTERRUPTED = 15;
public static final int INVALID_ACCOUNT = 5;
public static final int LICENSE_CHECK_FAILED = 11;
public static final int NETWORK_ERROR = 9000;
public static final int RESOLUTION_REQUIRED = 9001;
public static final int RESTRICTED_PROFILE = 9003;
public static final int SERVICE_DISABLED = 3;
public static final int SERVICE_INVALID = 9;
public static final int SERVICE_MISSING = 1;
public static final int SERVICE_MISSING_PERMISSION = 19;
public static final int SERVICE_UNSUPPORTED = 21;
public static final int SERVICE_UPDATING = 9004;
public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2;
public static final int SIGN_IN_FAILED = 9005;
public static final int SIGN_IN_REQUIRED = 4;
public static final int SUCCESS = 0;
public static final int TIMEOUT = 14;
private int apiVersion;
private int connectionErrorCode;
private String connectionErrorMessage;
private PendingIntent pendingIntent;
/* loaded from: classes2.dex */
class a implements Parcelable.Creator<ConnectionResult> {
@Override // android.os.Parcelable.Creator
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public ConnectionResult createFromParcel(Parcel parcel) {
return new ConnectionResult(parcel, (a) null);
}
@Override // android.os.Parcelable.Creator
/* renamed from: a, reason: merged with bridge method [inline-methods] */
public ConnectionResult[] newArray(int i) {
return new ConnectionResult[i];
}
a() {
}
}
/* synthetic */ ConnectionResult(Parcel parcel, a aVar) {
this(parcel);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static String getErrorString(int i) {
if (i == -1) {
return GrsBaseInfo.CountryCodeSource.UNKNOWN;
}
if (i == 0) {
return "SUCCESS";
}
if (i == 1) {
return "SERVICE_MISSING";
}
if (i == 2) {
return "SERVICE_VERSION_UPDATE_REQUIRED";
}
if (i == 3) {
return "SERVICE_DISABLED";
}
if (i == 13) {
return "CANCELED";
}
if (i == 14) {
return "TIMEOUT";
}
if (i == 19) {
return "SERVICE_MISSING_PERMISSION";
}
if (i == 21) {
return "API_VERSION_UPDATE_REQUIRED";
}
switch (i) {
case 6:
return "RESOLUTION_REQUIRED";
case 7:
return "NETWORK_ERROR";
case 8:
return "INTERNAL_ERROR";
case 9:
return "SERVICE_INVALID";
case 10:
return "DEVELOPER_ERROR";
case 11:
return "LICENSE_CHECK_FAILED";
default:
StringBuilder sb = new StringBuilder("UNKNOWN_ERROR_CODE(");
sb.append(i);
sb.append(")");
return sb.toString();
}
}
@Override // android.os.Parcelable
public final int describeContents() {
return 0;
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
try {
if ((obj instanceof ConnectionResult) && this.apiVersion == ((ConnectionResult) obj).apiVersion && this.connectionErrorCode == ((ConnectionResult) obj).connectionErrorCode && this.connectionErrorMessage.equals(((ConnectionResult) obj).connectionErrorMessage)) {
if (this.pendingIntent.equals(((ConnectionResult) obj).pendingIntent)) {
return true;
}
}
return false;
} catch (Exception unused) {
return false;
}
}
public final boolean hasResolution() {
return HuaweiApiAvailability.getInstance().isUserResolvableError(this.connectionErrorCode, this.pendingIntent);
}
public final int hashCode() {
return Objects.hashCode(Long.valueOf(this.apiVersion), Long.valueOf(getErrorCode()), getErrorMessage(), this.pendingIntent);
}
public final void startResolutionForResult(Activity activity, int i) throws IntentSender.SendIntentException {
if (hasResolution()) {
HuaweiApiAvailability.getInstance().resolveError(activity, this.connectionErrorCode, i, this.pendingIntent);
}
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
if (parcel == null) {
return;
}
parcel.writeInt(this.apiVersion);
parcel.writeInt(this.connectionErrorCode);
parcel.writeString(this.connectionErrorMessage);
this.pendingIntent.writeToParcel(parcel, i);
}
ConnectionResult(int i, int i2, PendingIntent pendingIntent, String str) {
this.apiVersion = i;
this.connectionErrorCode = i2;
this.pendingIntent = pendingIntent;
this.connectionErrorMessage = str;
}
public ConnectionResult(int i) {
this(i, (PendingIntent) null);
}
public ConnectionResult(int i, PendingIntent pendingIntent) {
this(i, pendingIntent, null);
}
public ConnectionResult(int i, PendingIntent pendingIntent, String str) {
this(1, i, pendingIntent, str);
}
private ConnectionResult(Parcel parcel) {
this.apiVersion = 1;
this.pendingIntent = null;
this.connectionErrorMessage = null;
this.apiVersion = parcel.readInt();
this.connectionErrorCode = parcel.readInt();
this.connectionErrorMessage = parcel.readString();
Parcelable parcelable = (Parcelable) PendingIntent.CREATOR.createFromParcel(parcel);
if (parcelable != null) {
this.pendingIntent = (PendingIntent) parcelable;
}
}
public final boolean isSuccess() {
return this.connectionErrorCode == 0;
}
public final PendingIntent getResolution() {
return this.pendingIntent;
}
public final String getErrorMessage() {
return this.connectionErrorMessage;
}
public final int getErrorCode() {
return this.connectionErrorCode;
}
}