523 lines
15 KiB
Smali
523 lines
15 KiB
Smali
.class public Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
.super Ljava/lang/Object;
|
|
.source "com.google.android.gms:play-services-basement@@18.0.0"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final zzb:Ljava/lang/Object;
|
|
|
|
.field private static volatile zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field public zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/util/VisibleForTesting;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/ConcurrentHashMap<",
|
|
"Landroid/content/ServiceConnection;",
|
|
"Landroid/content/ServiceConnection;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Ljava/lang/Object;
|
|
|
|
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
|
|
|
sput-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb:Ljava/lang/Object;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static getInstance()Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.line 1
|
|
sget-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
sget-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
sget-object v1, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
new-instance v1, Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
|
|
invoke-direct {v1}, Lcom/google/android/gms/common/stats/ConnectionTracker;-><init>()V
|
|
|
|
sput-object v1, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
|
|
.line 2
|
|
:cond_0
|
|
monitor-exit v0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
sget-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
|
|
|
|
.line 3
|
|
invoke-static {v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static zzb(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p0, p1}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catch Ljava/util/NoSuchElementException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private final zzc(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;IZLjava/util/concurrent/Executor;)Z
|
|
.locals 3
|
|
.param p7 # Ljava/util/concurrent/Executor;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-virtual {p3}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;
|
|
|
|
move-result-object p6
|
|
|
|
const-string v0, "ConnectionTracker"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez p6, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-virtual {p6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p6
|
|
|
|
const-string v2, "com.google.android.gms"
|
|
|
|
.line 3
|
|
invoke-virtual {v2, p6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
.line 4
|
|
:try_start_0
|
|
invoke-static {p1}, Lcom/google/android/gms/common/wrappers/Wrappers;->packageManager(Landroid/content/Context;)Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, p6, v1}, Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
|
|
|
|
move-result-object p6
|
|
|
|
.line 5
|
|
iget p6, p6, Landroid/content/pm/ApplicationInfo;->flags:I
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
const/high16 v2, 0x200000
|
|
|
|
and-int/2addr p6, v2
|
|
|
|
if-eqz p6, :cond_1
|
|
|
|
const-string p1, "Attempted to bind to a service in a STOPPED package."
|
|
|
|
.line 6
|
|
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v1
|
|
|
|
.line 7
|
|
:catch_0
|
|
:cond_1
|
|
:goto_0
|
|
invoke-static {p4}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzd(Landroid/content/ServiceConnection;)Z
|
|
|
|
move-result p6
|
|
|
|
if-eqz p6, :cond_4
|
|
|
|
iget-object p6, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 8
|
|
invoke-virtual {p6, p4, p4}, Ljava/util/concurrent/ConcurrentHashMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p6
|
|
|
|
check-cast p6, Landroid/content/ServiceConnection;
|
|
|
|
if-eqz p6, :cond_2
|
|
|
|
if-eq p4, p6, :cond_2
|
|
|
|
const/4 p6, 0x3
|
|
|
|
new-array p6, p6, [Ljava/lang/Object;
|
|
|
|
aput-object p4, p6, v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object p2, p6, v2
|
|
|
|
const/4 p2, 0x2
|
|
|
|
.line 9
|
|
invoke-virtual {p3}, Landroid/content/Intent;->getAction()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, p6, p2
|
|
|
|
const-string p2, "Duplicate binding with the same ServiceConnection: %s, %s, %s."
|
|
|
|
.line 10
|
|
invoke-static {p2, p6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
.line 11
|
|
invoke-static {v0, p2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 12
|
|
:cond_2
|
|
:try_start_1
|
|
invoke-static {p1, p3, p4, p5, p7}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zze(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
|
|
|
|
move-result p1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
iget-object p1, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 13
|
|
invoke-virtual {p1, p4, p4}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
return v1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
.line 14
|
|
iget-object p2, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 15
|
|
invoke-virtual {p2, p4, p4}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
.line 16
|
|
throw p1
|
|
|
|
.line 17
|
|
:cond_4
|
|
invoke-static {p1, p3, p4, p5, p7}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zze(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
|
|
|
|
move-result p1
|
|
|
|
:goto_1
|
|
return p1
|
|
.end method
|
|
|
|
.method private static zzd(Landroid/content/ServiceConnection;)Z
|
|
.locals 0
|
|
|
|
.line 1
|
|
instance-of p0, p0, Lcom/google/android/gms/common/internal/zzs;
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static final zze(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
|
|
.locals 1
|
|
.param p4 # Ljava/util/concurrent/Executor;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastQ()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
invoke-virtual {p0, p1, p3, p4, p2}, Landroid/content/Context;->bindService(Landroid/content/Intent;ILjava/util/concurrent/Executor;Landroid/content/ServiceConnection;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
.line 2
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2, p3}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public bindService(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
|
|
.locals 9
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/Intent;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/content/ServiceConnection;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const/4 v7, 0x1
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, p1
|
|
|
|
move-object v4, p2
|
|
|
|
move-object v5, p3
|
|
|
|
move v6, p4
|
|
|
|
.line 2
|
|
invoke-direct/range {v1 .. v8}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;IZLjava/util/concurrent/Executor;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public unbindService(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
.locals 1
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/ServiceConnection;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {p2}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzd(Landroid/content/ServiceConnection;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-virtual {v0, p2}, Ljava/util/concurrent/ConcurrentHashMap;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 2
|
|
invoke-virtual {v0, p2}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/content/ServiceConnection;
|
|
|
|
invoke-static {p1, v0}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
iget-object p1, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
.line 3
|
|
invoke-virtual {p1, p2}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
iget-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-virtual {v0, p2}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 4
|
|
throw p1
|
|
|
|
.line 5
|
|
:cond_0
|
|
invoke-static {p1, p2}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public unbindServiceSafe(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
.locals 0
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/ServiceConnection;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p0, p1, p2}, Lcom/google/android/gms/common/stats/ConnectionTracker;->unbindService(Landroid/content/Context;Landroid/content/ServiceConnection;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:catch_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final zza(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
|
|
.locals 8
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Landroid/content/Intent;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p4 # Landroid/content/ServiceConnection;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p6 # Ljava/util/concurrent/Executor;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
const/4 v6, 0x1
|
|
|
|
move-object v0, p0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, p2
|
|
|
|
move-object v3, p3
|
|
|
|
move-object v4, p4
|
|
|
|
move v5, p5
|
|
|
|
move-object v7, p6
|
|
|
|
.line 1
|
|
invoke-direct/range {v0 .. v7}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;IZLjava/util/concurrent/Executor;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|