what-the-bank/sources/com/google/android/gms/auth/api/proxy/ProxyResponse.java

84 lines
3.1 KiB
Java

package com.google.android.gms.auth.api.proxy;
import android.app.PendingIntent;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes.dex */
public class ProxyResponse extends AbstractSafeParcelable {
public static final Parcelable.Creator<ProxyResponse> CREATOR = new zzb();
public static final int STATUS_CODE_NO_CONNECTION = -1;
public final byte[] body;
public final int googlePlayServicesStatusCode;
public final PendingIntent recoveryAction;
public final int statusCode;
private final int versionCode;
private final Bundle zzby;
public static ProxyResponse createErrorProxyResponse(int i, PendingIntent pendingIntent, int i2, Map<String, String> map, byte[] bArr) {
return new ProxyResponse(1, i, pendingIntent, i2, zza(map), bArr);
}
private static Bundle zza(Map<String, String> map) {
Bundle bundle = new Bundle();
if (map == null) {
return bundle;
}
for (Map.Entry<String, String> entry : map.entrySet()) {
bundle.putString(entry.getKey(), entry.getValue());
}
return bundle;
}
/* JADX INFO: Access modifiers changed from: package-private */
public ProxyResponse(int i, int i2, PendingIntent pendingIntent, int i3, Bundle bundle, byte[] bArr) {
this.versionCode = i;
this.googlePlayServicesStatusCode = i2;
this.statusCode = i3;
this.zzby = bundle;
this.body = bArr;
this.recoveryAction = pendingIntent;
}
public ProxyResponse(int i, PendingIntent pendingIntent, int i2, Bundle bundle, byte[] bArr) {
this(1, i, pendingIntent, i2, bundle, bArr);
}
private ProxyResponse(int i, Bundle bundle, byte[] bArr) {
this(1, 0, null, i, bundle, bArr);
}
public ProxyResponse(int i, Map<String, String> map, byte[] bArr) {
this(i, zza(map), bArr);
}
public Map<String, String> getHeaders() {
if (this.zzby == null) {
return Collections.emptyMap();
}
HashMap hashMap = new HashMap();
for (String str : this.zzby.keySet()) {
hashMap.put(str, this.zzby.getString(str));
}
return hashMap;
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeInt(parcel, 1, this.googlePlayServicesStatusCode);
SafeParcelWriter.writeParcelable(parcel, 2, this.recoveryAction, i, false);
SafeParcelWriter.writeInt(parcel, 3, this.statusCode);
SafeParcelWriter.writeBundle(parcel, 4, this.zzby, false);
SafeParcelWriter.writeByteArray(parcel, 5, this.body, false);
SafeParcelWriter.writeInt(parcel, 1000, this.versionCode);
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
}
}