jimu-decompiled/sources/com/google/android/gms/common/GoogleApiAvailabilityLight.java
2025-05-13 19:24:51 +02:00

94 lines
2.9 KiB
Java

package com.google.android.gms.common;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import com.google.android.gms.common.util.DeviceProperties;
import com.google.android.gms.common.wrappers.Wrappers;
/* loaded from: classes.dex */
public class GoogleApiAvailabilityLight {
public static final int a = GooglePlayServicesUtilLight.GOOGLE_PLAY_SERVICES_VERSION_CODE;
private static final GoogleApiAvailabilityLight b = new GoogleApiAvailabilityLight();
GoogleApiAvailabilityLight() {
}
public static GoogleApiAvailabilityLight a() {
return b;
}
public int b(Context context) {
return a(context, a);
}
public int a(Context context, int i) {
int isGooglePlayServicesAvailable = GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(context, i);
if (GooglePlayServicesUtilLight.isPlayServicesPossiblyUpdating(context, isGooglePlayServicesAvailable)) {
return 18;
}
return isGooglePlayServicesAvailable;
}
public boolean b(int i) {
return GooglePlayServicesUtilLight.isUserRecoverableError(i);
}
public Intent a(Context context, int i, String str) {
if (i != 1 && i != 2) {
if (i != 3) {
return null;
}
return com.google.android.gms.common.internal.zzg.a("com.google.android.gms");
}
if (context != null && DeviceProperties.c(context)) {
return com.google.android.gms.common.internal.zzg.a();
}
return com.google.android.gms.common.internal.zzg.a("com.google.android.gms", a(context, str));
}
public PendingIntent a(Context context, int i, int i2) {
return a(context, i, i2, null);
}
public PendingIntent a(Context context, int i, int i2, String str) {
Intent a2 = a(context, i, str);
if (a2 == null) {
return null;
}
return PendingIntent.getActivity(context, i2, a2, 134217728);
}
public int a(Context context) {
return GooglePlayServicesUtilLight.getApkVersion(context);
}
public String a(int i) {
return GooglePlayServicesUtilLight.getErrorString(i);
}
private static String a(Context context, String str) {
StringBuilder sb = new StringBuilder();
sb.append("gcore_");
sb.append(a);
sb.append("-");
if (!TextUtils.isEmpty(str)) {
sb.append(str);
}
sb.append("-");
if (context != null) {
sb.append(context.getPackageName());
}
sb.append("-");
if (context != null) {
try {
sb.append(Wrappers.a(context).b(context.getPackageName(), 0).versionCode);
} catch (PackageManager.NameNotFoundException unused) {
}
}
return sb.toString();
}
}