granularity level: instruction
.class public final Lcom/google/android/gms/common/api/internal/zak;
.super Lcom/google/android/gms/common/api/internal/zap;
.source "com.google.android.gms:play-services-base@@18.0.1"
.field private final zad:Landroid/util/SparseArray;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/SparseArray<",
"Lcom/google/android/gms/common/api/internal/zaj;",
">;"
}
.end annotation
.end field
.method private constructor <init>(Lcom/google/android/gms/common/api/internal/LifecycleFragment;)V
.locals 1
invoke-static {}, Lcom/google/android/gms/common/GoogleApiAvailability;->getInstance()Lcom/google/android/gms/common/GoogleApiAvailability;
move-result-object v0
invoke-direct {p0, p1, v0}, Lcom/google/android/gms/common/api/internal/zap;-><init>(Lcom/google/android/gms/common/api/internal/LifecycleFragment;Lcom/google/android/gms/common/GoogleApiAvailability;)V
new-instance p1, Landroid/util/SparseArray;
invoke-direct {p1}, Landroid/util/SparseArray;-><init>()V
iput-object p1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
iget-object p1, p0, Lcom/google/android/gms/common/api/internal/zak;->mLifecycleFragment:Lcom/google/android/gms/common/api/internal/LifecycleFragment;
const-string v0, "AutoManageHelper"
invoke-interface {p1, v0, p0}, Lcom/google/android/gms/common/api/internal/LifecycleFragment;->addCallback(Ljava/lang/String;Lcom/google/android/gms/common/api/internal/LifecycleCallback;)V
return-void
.end method
.method public static zaa(Lcom/google/android/gms/common/api/internal/LifecycleActivity;)Lcom/google/android/gms/common/api/internal/zak;
.locals 2
invoke-static {p0}, Lcom/google/android/gms/common/api/internal/zak;->getFragment(Lcom/google/android/gms/common/api/internal/LifecycleActivity;)Lcom/google/android/gms/common/api/internal/LifecycleFragment;
move-result-object p0
const-class v0, Lcom/google/android/gms/common/api/internal/zak;
const-string v1, "AutoManageHelper"
invoke-interface {p0, v1, v0}, Lcom/google/android/gms/common/api/internal/LifecycleFragment;->getCallbackOrNull(Ljava/lang/String;Ljava/lang/Class;)Lcom/google/android/gms/common/api/internal/LifecycleCallback;
move-result-object v0
check-cast v0, Lcom/google/android/gms/common/api/internal/zak;
if-eqz v0, :cond_0
return-object v0
:cond_0
new-instance v0, Lcom/google/android/gms/common/api/internal/zak;
invoke-direct {v0, p0}, Lcom/google/android/gms/common/api/internal/zak;-><init>(Lcom/google/android/gms/common/api/internal/LifecycleFragment;)V
return-object v0
.end method
.method private final zai(I)Lcom/google/android/gms/common/api/internal/zaj;
.locals 1
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v0}, Landroid/util/SparseArray;->size()I
move-result v0
if-gt v0, p1, :cond_0
const/4 p1, 0x0
return-object p1
:cond_0
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v0, p1}, Landroid/util/SparseArray;->keyAt(I)I
move-result p1
invoke-virtual {v0, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;
move-result-object p1
check-cast p1, Lcom/google/android/gms/common/api/internal/zaj;
return-object p1
.end method
.method public final dump(Ljava/lang/String;Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
.locals 4
const/4 v0, 0x0
:goto_0
iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v1}, Landroid/util/SparseArray;->size()I
move-result v1
if-ge v0, v1, :cond_1
invoke-direct {p0, v0}, Lcom/google/android/gms/common/api/internal/zak;->zai(I)Lcom/google/android/gms/common/api/internal/zaj;
move-result-object v1
if-eqz v1, :cond_0
invoke-virtual {p3, p1}, Ljava/io/PrintWriter;->append(Ljava/lang/CharSequence;)Ljava/io/PrintWriter;
move-result-object v2
const-string v3, "GoogleApiClient #"
invoke-virtual {v2, v3}, Ljava/io/PrintWriter;->append(Ljava/lang/CharSequence;)Ljava/io/PrintWriter;
move-result-object v2
iget v3, v1, Lcom/google/android/gms/common/api/internal/zaj;->zaa:I
invoke-virtual {v2, v3}, Ljava/io/PrintWriter;->print(I)V
const-string v2, ":"
invoke-virtual {p3, v2}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V
iget-object v1, v1, Lcom/google/android/gms/common/api/internal/zaj;->zab:Lcom/google/android/gms/common/api/GoogleApiClient;
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
const-string v3, " "
invoke-virtual {v2, v3}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2, p2, p3, p4}, Lcom/google/android/gms/common/api/GoogleApiClient;->dump(Ljava/lang/String;Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
:cond_0
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
return-void
.end method
.method public final onStart()V
.locals 4
invoke-super {p0}, Lcom/google/android/gms/common/api/internal/zap;->onStart()V
iget-boolean v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zaa:Z
iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v1
invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/String;->length()I
move-result v2
new-instance v3, Ljava/lang/StringBuilder;
add-int/lit8 v2, v2, 0xe
invoke-direct {v3, v2}, Ljava/lang/StringBuilder;-><init>(I)V
const-string v2, "onStart "
invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
const-string v0, " "
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v1, "AutoManageHelper"
invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zab:Ljava/util/concurrent/atomic/AtomicReference;
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object v0
if-nez v0, :cond_1
const/4 v0, 0x0
:goto_0
iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v1}, Landroid/util/SparseArray;->size()I
move-result v1
if-ge v0, v1, :cond_1
invoke-direct {p0, v0}, Lcom/google/android/gms/common/api/internal/zak;->zai(I)Lcom/google/android/gms/common/api/internal/zaj;
move-result-object v1
if-eqz v1, :cond_0
iget-object v1, v1, Lcom/google/android/gms/common/api/internal/zaj;->zab:Lcom/google/android/gms/common/api/GoogleApiClient;
invoke-virtual {v1}, Lcom/google/android/gms/common/api/GoogleApiClient;->connect()V
:cond_0
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
return-void
.end method
.method public final onStop()V
.locals 2
invoke-super {p0}, Lcom/google/android/gms/common/api/internal/zap;->onStop()V
const/4 v0, 0x0
:goto_0
iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v1}, Landroid/util/SparseArray;->size()I
move-result v1
if-ge v0, v1, :cond_1
invoke-direct {p0, v0}, Lcom/google/android/gms/common/api/internal/zak;->zai(I)Lcom/google/android/gms/common/api/internal/zaj;
move-result-object v1
if-eqz v1, :cond_0
iget-object v1, v1, Lcom/google/android/gms/common/api/internal/zaj;->zab:Lcom/google/android/gms/common/api/GoogleApiClient;
invoke-virtual {v1}, Lcom/google/android/gms/common/api/GoogleApiClient;->disconnect()V
:cond_0
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
return-void
.end method
.method protected final zab(Lcom/google/android/gms/common/ConnectionResult;I)V
.locals 2
const-string v0, "AutoManageHelper"
const-string v1, "Unresolved error while connecting client. Stopping auto-manage."
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
if-gez p2, :cond_0
new-instance p1, Ljava/lang/Exception;
invoke-direct {p1}, Ljava/lang/Exception;-><init>()V
const-string p2, "AutoManageLifecycleHelper received onErrorResolutionFailed callback but no failing client ID is set"
invoke-static {v0, p2, p1}, Landroid/util/Log;->wtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return-void
:cond_0
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v0, p2}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/android/gms/common/api/internal/zaj;
if-eqz v0, :cond_1
invoke-virtual {p0, p2}, Lcom/google/android/gms/common/api/internal/zak;->zae(I)V
iget-object p2, v0, Lcom/google/android/gms/common/api/internal/zaj;->zac:Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;
if-eqz p2, :cond_1
invoke-interface {p2, p1}, Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;->onConnectionFailed(Lcom/google/android/gms/common/ConnectionResult;)V
:cond_1
return-void
.end method
.method protected final zac()V
.locals 2
const/4 v0, 0x0
:goto_0
iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v1}, Landroid/util/SparseArray;->size()I
move-result v1
if-ge v0, v1, :cond_1
invoke-direct {p0, v0}, Lcom/google/android/gms/common/api/internal/zak;->zai(I)Lcom/google/android/gms/common/api/internal/zaj;
move-result-object v1
if-eqz v1, :cond_0
iget-object v1, v1, Lcom/google/android/gms/common/api/internal/zaj;->zab:Lcom/google/android/gms/common/api/GoogleApiClient;
invoke-virtual {v1}, Lcom/google/android/gms/common/api/GoogleApiClient;->connect()V
:cond_0
add-int/lit8 v0, v0, 0x1
goto :goto_0
:cond_1
return-void
.end method
.method public final zad(ILcom/google/android/gms/common/api/GoogleApiClient;Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;)V
.locals 5
const-string v0, "GoogleApiClient instance cannot be null"
invoke-static {p2, v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v0, p1}, Landroid/util/SparseArray;->indexOfKey(I)I
move-result v0
if-gez v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
new-instance v1, Ljava/lang/StringBuilder;
const/16 v2, 0x36
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(I)V
const-string v2, "Already managing a GoogleApiClient with id "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/google/android/gms/common/internal/Preconditions;->checkState(ZLjava/lang/Object;)V
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zab:Ljava/util/concurrent/atomic/AtomicReference;
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/android/gms/common/api/internal/zam;
iget-boolean v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zaa:Z
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/String;->length()I
move-result v3
new-instance v4, Ljava/lang/StringBuilder;
add-int/lit8 v3, v3, 0x31
invoke-direct {v4, v3}, Ljava/lang/StringBuilder;-><init>(I)V
const-string v3, "starting AutoManage for client "
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v3, " "
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
const-string v2, "AutoManageHelper"
invoke-static {v2, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
new-instance v1, Lcom/google/android/gms/common/api/internal/zaj;
invoke-direct {v1, p0, p1, p2, p3}, Lcom/google/android/gms/common/api/internal/zaj;-><init>(Lcom/google/android/gms/common/api/internal/zak;ILcom/google/android/gms/common/api/GoogleApiClient;Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;)V
invoke-virtual {p2, v1}, Lcom/google/android/gms/common/api/GoogleApiClient;->registerConnectionFailedListener(Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;)V
iget-object p3, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {p3, p1, v1}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
iget-boolean p1, p0, Lcom/google/android/gms/common/api/internal/zak;->zaa:Z
if-eqz p1, :cond_1
if-nez v0, :cond_1
invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p1
const-string p3, "connecting "
invoke-virtual {p3, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-static {v2, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
invoke-virtual {p2}, Lcom/google/android/gms/common/api/GoogleApiClient;->connect()V
:cond_1
return-void
.end method
.method public final zae(I)V
.locals 2
iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v0, p1}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/google/android/gms/common/api/internal/zaj;
iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zak;->zad:Landroid/util/SparseArray;
invoke-virtual {v1, p1}, Landroid/util/SparseArray;->remove(I)V
if-eqz v0, :cond_0
iget-object p1, v0, Lcom/google/android/gms/common/api/internal/zaj;->zab:Lcom/google/android/gms/common/api/GoogleApiClient;
invoke-virtual {p1, v0}, Lcom/google/android/gms/common/api/GoogleApiClient;->unregisterConnectionFailedListener(Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;)V
iget-object p1, v0, Lcom/google/android/gms/common/api/internal/zaj;->zab:Lcom/google/android/gms/common/api/GoogleApiClient;
invoke-virtual {p1}, Lcom/google/android/gms/common/api/GoogleApiClient;->disconnect()V
:cond_0
return-void
.end method