package com.google.android.gms.common;

import X.C36088vf;
import X.C38658zo;
import X.C38668zp;
import X.C394092l;
import android.app.PendingIntent;
import android.os.Parcel;
import android.os.Parcelable;
import com.bytedance.covode.number.Covode;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import java.util.Arrays;

public final class ConnectionResult extends AbstractSafeParcelable {
    public static final Parcelable.Creator<ConnectionResult> CREATOR = new C394092l();
    public static final ConnectionResult LIZ = new ConnectionResult(0);
    public final int LIZIZ;
    public final PendingIntent LIZJ;
    public final String LIZLLL;
    public final int LJ;

    public final boolean LIZIZ() {
        if (this.LIZIZ == 0) {
            return true;
        }
        return false;
    }

    public final boolean LIZ() {
        if (this.LIZIZ == 0 || this.LIZJ == null) {
            return false;
        }
        return true;
    }

    static {
        Covode.recordClassIndex(42580);
    }

    public final int hashCode() {
        return Arrays.hashCode(new Object[]{Integer.valueOf(this.LIZIZ), this.LIZJ, this.LIZLLL});
    }

    public final String toString() {
        C38658zo LIZ2 = C38668zp.LIZ((Object) this);
        LIZ2.LIZ("statusCode", LIZ(this.LIZIZ));
        LIZ2.LIZ("resolution", this.LIZJ);
        LIZ2.LIZ("message", this.LIZLLL);
        return LIZ2.toString();
    }

    public ConnectionResult(int i) {
        this(i, (PendingIntent) null, (String) null);
    }

    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof ConnectionResult)) {
            return false;
        }
        ConnectionResult connectionResult = (ConnectionResult) obj;
        if (this.LIZIZ != connectionResult.LIZIZ || !C38668zp.LIZ(this.LIZJ, connectionResult.LIZJ) || !C38668zp.LIZ(this.LIZLLL, connectionResult.LIZLLL)) {
            return false;
        }
        return true;
    }

    public static String LIZ(int i) {
        if (i == 99) {
            return "UNFINISHED";
        }
        if (i == 1500) {
            return "DRIVE_EXTERNAL_STORAGE_REQUIRED";
        }
        switch (i) {
            case -1:
                return "UNKNOWN";
            case 0:
                return "SUCCESS";
            case 1:
                return "SERVICE_MISSING";
            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 9:
                return "SERVICE_INVALID";
            case 10:
                return "DEVELOPER_ERROR";
            case 11:
                return "LICENSE_CHECK_FAILED";
            default:
                switch (i) {
                    case 13:
                        return "CANCELED";
                    case 14:
                        return "TIMEOUT";
                    case 15:
                        return "INTERRUPTED";
                    case 16:
                        return "API_UNAVAILABLE";
                    case 17:
                        return "SIGN_IN_FAILED";
                    case 18:
                        return "SERVICE_UPDATING";
                    case 19:
                        return "SERVICE_MISSING_PERMISSION";
                    case 20:
                        return "RESTRICTED_PROFILE";
                    case 21:
                        return "API_VERSION_UPDATE_REQUIRED";
                    default:
                        StringBuilder sb = new StringBuilder(31);
                        sb.append("UNKNOWN_ERROR_CODE(");
                        sb.append(i);
                        sb.append(")");
                        return sb.toString();
                }
        }
    }

    public ConnectionResult(int i, PendingIntent pendingIntent) {
        this(i, pendingIntent, (String) null);
    }

    public final void writeToParcel(Parcel parcel, int i) {
        int LIZ2 = C36088vf.LIZ(parcel, 20293);
        C36088vf.LIZIZ(parcel, 1, this.LJ);
        C36088vf.LIZIZ(parcel, 2, this.LIZIZ);
        C36088vf.LIZ(parcel, 3, (Parcelable) this.LIZJ, i);
        C36088vf.LIZ(parcel, 4, this.LIZLLL);
        C36088vf.LIZIZ(parcel, LIZ2);
    }

    public ConnectionResult(int i, PendingIntent pendingIntent, String str) {
        this(1, i, pendingIntent, str);
    }

    public ConnectionResult(int i, int i2, PendingIntent pendingIntent, String str) {
        this.LJ = i;
        this.LIZIZ = i2;
        this.LIZJ = pendingIntent;
        this.LIZLLL = str;
    }
}
