56 lines
2.0 KiB
Java
56 lines
2.0 KiB
Java
package com.google.android.gms.common.api;
|
|
|
|
import android.text.TextUtils;
|
|
import androidx.collection.ArrayMap;
|
|
import com.google.android.gms.common.ConnectionResult;
|
|
import com.google.android.gms.common.api.Api;
|
|
import com.google.android.gms.common.api.internal.zai;
|
|
import com.google.android.gms.common.internal.Preconditions;
|
|
import java.util.ArrayList;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class AvailabilityException extends Exception {
|
|
private final ArrayMap<zai<?>, ConnectionResult> zaay;
|
|
|
|
public AvailabilityException(ArrayMap<zai<?>, ConnectionResult> arrayMap) {
|
|
this.zaay = arrayMap;
|
|
}
|
|
|
|
public ConnectionResult getConnectionResult(GoogleApi<? extends Api.ApiOptions> googleApi) {
|
|
zai<? extends Api.ApiOptions> c = googleApi.c();
|
|
Preconditions.a(this.zaay.get(c) != null, "The given API was not part of the availability request.");
|
|
return this.zaay.get(c);
|
|
}
|
|
|
|
@Override // java.lang.Throwable
|
|
public String getMessage() {
|
|
ArrayList arrayList = new ArrayList();
|
|
boolean z = true;
|
|
for (zai<?> zaiVar : this.zaay.keySet()) {
|
|
ConnectionResult connectionResult = this.zaay.get(zaiVar);
|
|
if (connectionResult.isSuccess()) {
|
|
z = false;
|
|
}
|
|
String a = zaiVar.a();
|
|
String valueOf = String.valueOf(connectionResult);
|
|
StringBuilder sb = new StringBuilder(String.valueOf(a).length() + 2 + String.valueOf(valueOf).length());
|
|
sb.append(a);
|
|
sb.append(": ");
|
|
sb.append(valueOf);
|
|
arrayList.add(sb.toString());
|
|
}
|
|
StringBuilder sb2 = new StringBuilder();
|
|
if (z) {
|
|
sb2.append("None of the queried APIs are available. ");
|
|
} else {
|
|
sb2.append("Some of the queried APIs are unavailable. ");
|
|
}
|
|
sb2.append(TextUtils.join("; ", arrayList));
|
|
return sb2.toString();
|
|
}
|
|
|
|
public final ArrayMap<zai<?>, ConnectionResult> zaj() {
|
|
return this.zaay;
|
|
}
|
|
}
|