Initial version -- added millennium read funcionality
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import com.google.android.gms.common.internal.zzt;
|
||||
import com.google.android.gms.common.util.PlatformVersion;
|
||||
import com.google.android.gms.common.wrappers.Wrappers;
|
||||
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executor;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public class ConnectionTracker {
|
||||
private static final Object zzb = new Object();
|
||||
|
||||
@Nullable
|
||||
private static volatile ConnectionTracker zzc;
|
||||
public final ConcurrentHashMap zza = new ConcurrentHashMap();
|
||||
|
||||
private ConnectionTracker() {
|
||||
}
|
||||
|
||||
public static ConnectionTracker getInstance() {
|
||||
if (zzc == null) {
|
||||
synchronized (zzb) {
|
||||
if (zzc == null) {
|
||||
zzc = new ConnectionTracker();
|
||||
}
|
||||
}
|
||||
}
|
||||
ConnectionTracker connectionTracker = zzc;
|
||||
Preconditions.checkNotNull(connectionTracker);
|
||||
return connectionTracker;
|
||||
}
|
||||
|
||||
private static void zzb(Context context, ServiceConnection serviceConnection) {
|
||||
try {
|
||||
context.unbindService(serviceConnection);
|
||||
} catch (IllegalArgumentException | IllegalStateException | NoSuchElementException unused) {
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean zzc(Context context, String str, Intent intent, ServiceConnection serviceConnection, int i, boolean z, @Nullable Executor executor) {
|
||||
ComponentName component = intent.getComponent();
|
||||
if (component != null) {
|
||||
String packageName = component.getPackageName();
|
||||
"com.google.android.gms".equals(packageName);
|
||||
try {
|
||||
if ((Wrappers.packageManager(context).getApplicationInfo(packageName, 0).flags & 2097152) != 0) {
|
||||
Log.w("ConnectionTracker", "Attempted to bind to a service in a STOPPED package.");
|
||||
return false;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
}
|
||||
}
|
||||
if (!zzd(serviceConnection)) {
|
||||
return zze(context, intent, serviceConnection, i, executor);
|
||||
}
|
||||
ServiceConnection serviceConnection2 = (ServiceConnection) this.zza.putIfAbsent(serviceConnection, serviceConnection);
|
||||
if (serviceConnection2 != null && serviceConnection != serviceConnection2) {
|
||||
Log.w("ConnectionTracker", String.format("Duplicate binding with the same ServiceConnection: %s, %s, %s.", serviceConnection, str, intent.getAction()));
|
||||
}
|
||||
try {
|
||||
boolean zZze = zze(context, intent, serviceConnection, i, executor);
|
||||
if (zZze) {
|
||||
return zZze;
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
this.zza.remove(serviceConnection, serviceConnection);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean zzd(ServiceConnection serviceConnection) {
|
||||
return !(serviceConnection instanceof zzt);
|
||||
}
|
||||
|
||||
@ResultIgnorabilityUnspecified
|
||||
public boolean bindService(Context context, Intent intent, ServiceConnection serviceConnection, int i) {
|
||||
return zzc(context, context.getClass().getName(), intent, serviceConnection, i, true, null);
|
||||
}
|
||||
|
||||
public void unbindService(Context context, ServiceConnection serviceConnection) {
|
||||
if (!zzd(serviceConnection) || !this.zza.containsKey(serviceConnection)) {
|
||||
zzb(context, serviceConnection);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
zzb(context, (ServiceConnection) this.zza.get(serviceConnection));
|
||||
} finally {
|
||||
this.zza.remove(serviceConnection);
|
||||
}
|
||||
}
|
||||
|
||||
public void unbindServiceSafe(Context context, ServiceConnection serviceConnection) {
|
||||
try {
|
||||
unbindService(context, serviceConnection);
|
||||
} catch (IllegalArgumentException unused) {
|
||||
}
|
||||
}
|
||||
|
||||
@ResultIgnorabilityUnspecified
|
||||
public final boolean zza(Context context, String str, Intent intent, ServiceConnection serviceConnection, int i, @Nullable Executor executor) {
|
||||
return zzc(context, str, intent, serviceConnection, 4225, true, executor);
|
||||
}
|
||||
|
||||
private static final boolean zze(Context context, Intent intent, ServiceConnection serviceConnection, int i, @Nullable Executor executor) {
|
||||
if (executor == null) {
|
||||
executor = null;
|
||||
}
|
||||
return (!PlatformVersion.isAtLeastQ() || executor == null) ? context.bindService(intent, serviceConnection, i) : context.bindService(intent, i, executor, serviceConnection);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import android.content.ComponentName;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class LoggingConstants {
|
||||
|
||||
@Deprecated
|
||||
public static final String EXTRA_WAKE_LOCK_KEY = "WAKE_LOCK_KEY";
|
||||
public static final ComponentName zza = new ComponentName("com.google.android.gms", "com.google.android.gms.common.stats.GmsCoreStatsService");
|
||||
|
||||
private LoggingConstants() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import com.google.android.gms.common.internal.ReflectedParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
@Deprecated
|
||||
public abstract class StatsEvent extends AbstractSafeParcelable implements ReflectedParcelable {
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
public interface Types {
|
||||
public static final int EVENT_TYPE_ACQUIRE_WAKE_LOCK = 7;
|
||||
public static final int EVENT_TYPE_RELEASE_WAKE_LOCK = 8;
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return zzb() + "\t" + zza() + "\t-1" + zzc();
|
||||
}
|
||||
|
||||
public abstract int zza();
|
||||
|
||||
public abstract long zzb();
|
||||
|
||||
public abstract String zzc();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import android.os.PowerManager;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
@Deprecated
|
||||
public class StatsUtils {
|
||||
public static String getEventKey(PowerManager.WakeLock wakeLock, String str) {
|
||||
String strValueOf = String.valueOf((((long) Process.myPid()) << 32) | ((long) System.identityHashCode(wakeLock)));
|
||||
if (true == TextUtils.isEmpty(str)) {
|
||||
str = "";
|
||||
}
|
||||
return String.valueOf(strValueOf).concat(String.valueOf(str));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
@Deprecated
|
||||
public final class WakeLockEvent extends StatsEvent {
|
||||
public static final Parcelable.Creator<WakeLockEvent> CREATOR = new zza();
|
||||
final int zza;
|
||||
private final long zzb;
|
||||
private final int zzc;
|
||||
private final String zzd;
|
||||
private final String zze;
|
||||
private final String zzf;
|
||||
private final int zzg;
|
||||
|
||||
@Nullable
|
||||
private final List zzh;
|
||||
private final String zzi;
|
||||
private final long zzj;
|
||||
private final int zzk;
|
||||
private final String zzl;
|
||||
private final float zzm;
|
||||
private final long zzn;
|
||||
private final boolean zzo;
|
||||
|
||||
WakeLockEvent(int i, long j, int i2, String str, int i3, @Nullable List list, String str2, long j2, int i4, String str3, String str4, float f, long j3, String str5, boolean z) {
|
||||
this.zza = i;
|
||||
this.zzb = j;
|
||||
this.zzc = i2;
|
||||
this.zzd = str;
|
||||
this.zze = str3;
|
||||
this.zzf = str5;
|
||||
this.zzg = i3;
|
||||
this.zzh = list;
|
||||
this.zzi = str2;
|
||||
this.zzj = j2;
|
||||
this.zzk = i4;
|
||||
this.zzl = str4;
|
||||
this.zzm = f;
|
||||
this.zzn = j3;
|
||||
this.zzo = z;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public final void writeToParcel(Parcel parcel, int i) {
|
||||
int iBeginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
|
||||
SafeParcelWriter.writeInt(parcel, 1, this.zza);
|
||||
SafeParcelWriter.writeLong(parcel, 2, this.zzb);
|
||||
SafeParcelWriter.writeString(parcel, 4, this.zzd, false);
|
||||
SafeParcelWriter.writeInt(parcel, 5, this.zzg);
|
||||
SafeParcelWriter.writeStringList(parcel, 6, this.zzh, false);
|
||||
SafeParcelWriter.writeLong(parcel, 8, this.zzj);
|
||||
SafeParcelWriter.writeString(parcel, 10, this.zze, false);
|
||||
SafeParcelWriter.writeInt(parcel, 11, this.zzc);
|
||||
SafeParcelWriter.writeString(parcel, 12, this.zzi, false);
|
||||
SafeParcelWriter.writeString(parcel, 13, this.zzl, false);
|
||||
SafeParcelWriter.writeInt(parcel, 14, this.zzk);
|
||||
SafeParcelWriter.writeFloat(parcel, 15, this.zzm);
|
||||
SafeParcelWriter.writeLong(parcel, 16, this.zzn);
|
||||
SafeParcelWriter.writeString(parcel, 17, this.zzf, false);
|
||||
SafeParcelWriter.writeBoolean(parcel, 18, this.zzo);
|
||||
SafeParcelWriter.finishObjectHeader(parcel, iBeginObjectHeader);
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.stats.StatsEvent
|
||||
public final int zza() {
|
||||
return this.zzc;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.stats.StatsEvent
|
||||
public final long zzb() {
|
||||
return this.zzb;
|
||||
}
|
||||
|
||||
@Override // com.google.android.gms.common.stats.StatsEvent
|
||||
public final String zzc() {
|
||||
List list = this.zzh;
|
||||
String strJoin = list == null ? "" : TextUtils.join(",", list);
|
||||
int i = this.zzk;
|
||||
String str = this.zze;
|
||||
String str2 = this.zzl;
|
||||
float f = this.zzm;
|
||||
String str3 = this.zzf;
|
||||
int i2 = this.zzg;
|
||||
String str4 = this.zzd;
|
||||
boolean z = this.zzo;
|
||||
StringBuilder sb = new StringBuilder("\t");
|
||||
sb.append(str4);
|
||||
sb.append("\t");
|
||||
sb.append(i2);
|
||||
sb.append("\t");
|
||||
sb.append(strJoin);
|
||||
sb.append("\t");
|
||||
sb.append(i);
|
||||
sb.append("\t");
|
||||
if (str == null) {
|
||||
str = "";
|
||||
}
|
||||
sb.append(str);
|
||||
sb.append("\t");
|
||||
if (str2 == null) {
|
||||
str2 = "";
|
||||
}
|
||||
sb.append(str2);
|
||||
sb.append("\t");
|
||||
sb.append(f);
|
||||
sb.append("\t");
|
||||
sb.append(str3 != null ? str3 : "");
|
||||
sb.append("\t");
|
||||
sb.append(z);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import java.util.List;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
@Deprecated
|
||||
public class WakeLockTracker {
|
||||
private static final WakeLockTracker zza = new WakeLockTracker();
|
||||
|
||||
public static WakeLockTracker getInstance() {
|
||||
return zza;
|
||||
}
|
||||
|
||||
public void registerAcquireEvent(Context context, Intent intent, String str, String str2, String str3, int i, String str4) {
|
||||
}
|
||||
|
||||
public void registerDeadlineEvent(Context context, String str, String str2, String str3, int i, List<String> list, boolean z, long j) {
|
||||
}
|
||||
|
||||
public void registerEvent(Context context, String str, int i, String str2, String str3, String str4, int i2, List<String> list) {
|
||||
}
|
||||
|
||||
public void registerEvent(Context context, String str, int i, String str2, String str3, String str4, int i2, List<String> list, long j) {
|
||||
}
|
||||
|
||||
public void registerReleaseEvent(Context context, Intent intent) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.google.android.gms.common.stats;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelReader;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* JADX INFO: compiled from: com.google.android.gms:play-services-basement@@18.3.0 */
|
||||
/* JADX INFO: loaded from: classes2.dex */
|
||||
public final class zza implements Parcelable.Creator {
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* bridge */ /* synthetic */ Object createFromParcel(Parcel parcel) {
|
||||
int iValidateObjectHeader = SafeParcelReader.validateObjectHeader(parcel);
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
int i3 = 0;
|
||||
int i4 = 0;
|
||||
boolean z = false;
|
||||
String strCreateString = null;
|
||||
ArrayList<String> arrayListCreateStringList = null;
|
||||
String strCreateString2 = null;
|
||||
String strCreateString3 = null;
|
||||
String strCreateString4 = null;
|
||||
String strCreateString5 = null;
|
||||
long j = 0;
|
||||
long j2 = 0;
|
||||
long j3 = 0;
|
||||
float f = 0.0f;
|
||||
while (parcel.dataPosition() < iValidateObjectHeader) {
|
||||
int header = SafeParcelReader.readHeader(parcel);
|
||||
switch (SafeParcelReader.getFieldId(header)) {
|
||||
case 1:
|
||||
i = SafeParcelReader.readInt(parcel, header);
|
||||
break;
|
||||
case 2:
|
||||
j = SafeParcelReader.readLong(parcel, header);
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
case 9:
|
||||
default:
|
||||
SafeParcelReader.skipUnknownField(parcel, header);
|
||||
break;
|
||||
case 4:
|
||||
strCreateString = SafeParcelReader.createString(parcel, header);
|
||||
break;
|
||||
case 5:
|
||||
i3 = SafeParcelReader.readInt(parcel, header);
|
||||
break;
|
||||
case 6:
|
||||
arrayListCreateStringList = SafeParcelReader.createStringList(parcel, header);
|
||||
break;
|
||||
case 8:
|
||||
j2 = SafeParcelReader.readLong(parcel, header);
|
||||
break;
|
||||
case 10:
|
||||
strCreateString3 = SafeParcelReader.createString(parcel, header);
|
||||
break;
|
||||
case 11:
|
||||
i2 = SafeParcelReader.readInt(parcel, header);
|
||||
break;
|
||||
case 12:
|
||||
strCreateString2 = SafeParcelReader.createString(parcel, header);
|
||||
break;
|
||||
case 13:
|
||||
strCreateString4 = SafeParcelReader.createString(parcel, header);
|
||||
break;
|
||||
case 14:
|
||||
i4 = SafeParcelReader.readInt(parcel, header);
|
||||
break;
|
||||
case 15:
|
||||
f = SafeParcelReader.readFloat(parcel, header);
|
||||
break;
|
||||
case 16:
|
||||
j3 = SafeParcelReader.readLong(parcel, header);
|
||||
break;
|
||||
case 17:
|
||||
strCreateString5 = SafeParcelReader.createString(parcel, header);
|
||||
break;
|
||||
case 18:
|
||||
z = SafeParcelReader.readBoolean(parcel, header);
|
||||
break;
|
||||
}
|
||||
}
|
||||
SafeParcelReader.ensureAtEnd(parcel, iValidateObjectHeader);
|
||||
return new WakeLockEvent(i, j, i2, strCreateString, i3, arrayListCreateStringList, strCreateString2, j2, i4, strCreateString3, strCreateString4, f, j3, strCreateString5, z);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public final /* synthetic */ Object[] newArray(int i) {
|
||||
return new WakeLockEvent[i];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user