197 lines
5.5 KiB
Smali
197 lines
5.5 KiB
Smali
.class public Lcom/google/android/gms/common/BlockingServiceConnection;
|
|
.super Ljava/lang/Object;
|
|
.source "com.google.android.gms:play-services-basement@@18.0.0"
|
|
|
|
# interfaces
|
|
.implements Landroid/content/ServiceConnection;
|
|
|
|
|
|
# annotations
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public zza:Z
|
|
|
|
.field private final zzb:Ljava/util/concurrent/BlockingQueue;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/BlockingQueue<",
|
|
"Landroid/os/IBinder;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zza:Z
|
|
|
|
new-instance v0, Ljava/util/concurrent/LinkedBlockingQueue;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zzb:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getService()Landroid/os/IBinder;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/InterruptedException;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "BlockingServiceConnection.getService() called on main thread"
|
|
|
|
.line 1
|
|
invoke-static {v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotMainThread(Ljava/lang/String;)V
|
|
|
|
iget-boolean v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zza:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 2
|
|
iput-boolean v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zza:Z
|
|
|
|
iget-object v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zzb:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
.line 3
|
|
invoke-interface {v0}, Ljava/util/concurrent/BlockingQueue;->take()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/os/IBinder;
|
|
|
|
return-object v0
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Cannot call get on this connection more than once"
|
|
|
|
.line 5
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public getServiceWithTimeout(JLjava/util/concurrent/TimeUnit;)Landroid/os/IBinder;
|
|
.locals 1
|
|
.param p3 # Ljava/util/concurrent/TimeUnit;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/InterruptedException;,
|
|
Ljava/util/concurrent/TimeoutException;
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "BlockingServiceConnection.getServiceWithTimeout() called on main thread"
|
|
|
|
.line 1
|
|
invoke-static {v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotMainThread(Ljava/lang/String;)V
|
|
|
|
iget-boolean v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zza:Z
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 2
|
|
iput-boolean v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zza:Z
|
|
|
|
iget-object v0, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zzb:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
.line 3
|
|
invoke-interface {v0, p1, p2, p3}, Ljava/util/concurrent/BlockingQueue;->poll(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/os/IBinder;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
return-object p1
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance p1, Ljava/util/concurrent/TimeoutException;
|
|
|
|
const-string p2, "Timed out waiting for the service connection"
|
|
|
|
invoke-direct {p1, p2}, Ljava/util/concurrent/TimeoutException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 5
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p2, "Cannot call get on this connection more than once"
|
|
|
|
.line 6
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final onServiceConnected(Landroid/content/ComponentName;Landroid/os/IBinder;)V
|
|
.locals 0
|
|
.param p1 # Landroid/content/ComponentName;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/os/IBinder;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
iget-object p1, p0, Lcom/google/android/gms/common/BlockingServiceConnection;->zzb:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
invoke-interface {p1, p2}, Ljava/util/concurrent/BlockingQueue;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onServiceDisconnected(Landroid/content/ComponentName;)V
|
|
.locals 0
|
|
.param p1 # Landroid/content/ComponentName;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
return-void
|
|
.end method
|