granularity level: instruction

		.class public final Lcom/google/android/gms/common/api/internal/zacc;
.super Lcom/google/android/gms/common/api/internal/zap;
.source "com.google.android.gms:play-services-base@@18.0.1"


.field private zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/android/gms/tasks/TaskCompletionSource<",
"Ljava/lang/Void;",
">;"
}
.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, Lcom/google/android/gms/tasks/TaskCompletionSource;
	invoke-direct {p1}, Lcom/google/android/gms/tasks/TaskCompletionSource;-><init>()V
	iput-object p1, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	iget-object p1, p0, Lcom/google/android/gms/common/api/internal/zacc;->mLifecycleFragment:Lcom/google/android/gms/common/api/internal/LifecycleFragment;
	const-string v0, "GmsAvailabilityHelper"
	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(Landroid/app/Activity;)Lcom/google/android/gms/common/api/internal/zacc;
	.locals 2

	invoke-static {p0}, Lcom/google/android/gms/common/api/internal/zacc;->getFragment(Landroid/app/Activity;)Lcom/google/android/gms/common/api/internal/LifecycleFragment;
	move-result-object p0
	const-class v0, Lcom/google/android/gms/common/api/internal/zacc;
	const-string v1, "GmsAvailabilityHelper"
	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/zacc;
	if-eqz v0, :cond_1
	iget-object p0, v0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	invoke-virtual {p0}, Lcom/google/android/gms/tasks/TaskCompletionSource;->getTask()Lcom/google/android/gms/tasks/Task;
	move-result-object p0
	invoke-virtual {p0}, Lcom/google/android/gms/tasks/Task;->isComplete()Z
	move-result p0
	if-eqz p0, :cond_0
	new-instance p0, Lcom/google/android/gms/tasks/TaskCompletionSource;
	invoke-direct {p0}, Lcom/google/android/gms/tasks/TaskCompletionSource;-><init>()V
	iput-object p0, v0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	:cond_0
	return-object v0
	:cond_1
	new-instance v0, Lcom/google/android/gms/common/api/internal/zacc;
	invoke-direct {v0, p0}, Lcom/google/android/gms/common/api/internal/zacc;-><init>(Lcom/google/android/gms/common/api/internal/LifecycleFragment;)V
	return-object v0
.end method

.method public final onDestroy()V
	.locals 3

	invoke-super {p0}, Lcom/google/android/gms/common/api/internal/zap;->onDestroy()V
	iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	new-instance v1, Ljava/util/concurrent/CancellationException;
	const-string v2, "Host activity was destroyed before Google Play services could be made available."
	invoke-direct {v1, v2}, Ljava/util/concurrent/CancellationException;-><init>(Ljava/lang/String;)V
	invoke-virtual {v0, v1}, Lcom/google/android/gms/tasks/TaskCompletionSource;->trySetException(Ljava/lang/Exception;)Z
	return-void
.end method

.method protected final zab(Lcom/google/android/gms/common/ConnectionResult;I)V
	.locals 4

	invoke-virtual {p1}, Lcom/google/android/gms/common/ConnectionResult;->getErrorMessage()Ljava/lang/String;
	move-result-object p2
	if-nez p2, :cond_0
	const-string p2, "Error connecting to Google Play services"
	:cond_0
	iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	new-instance v1, Lcom/google/android/gms/common/api/ApiException;
	new-instance v2, Lcom/google/android/gms/common/api/Status;
	invoke-virtual {p1}, Lcom/google/android/gms/common/ConnectionResult;->getErrorCode()I
	move-result v3
	invoke-direct {v2, p1, p2, v3}, Lcom/google/android/gms/common/api/Status;-><init>(Lcom/google/android/gms/common/ConnectionResult;Ljava/lang/String;I)V
	invoke-direct {v1, v2}, Lcom/google/android/gms/common/api/ApiException;-><init>(Lcom/google/android/gms/common/api/Status;)V
	invoke-virtual {v0, v1}, Lcom/google/android/gms/tasks/TaskCompletionSource;->setException(Ljava/lang/Exception;)V
	return-void
.end method

.method protected final zac()V
	.locals 4

	iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zacc;->mLifecycleFragment:Lcom/google/android/gms/common/api/internal/LifecycleFragment;
	invoke-interface {v0}, Lcom/google/android/gms/common/api/internal/LifecycleFragment;->getLifecycleActivity()Landroid/app/Activity;
	move-result-object v0
	if-nez v0, :cond_0
	iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	new-instance v1, Lcom/google/android/gms/common/api/ApiException;
	new-instance v2, Lcom/google/android/gms/common/api/Status;
	const/16 v3, 0x8
	invoke-direct {v2, v3}, Lcom/google/android/gms/common/api/Status;-><init>(I)V
	invoke-direct {v1, v2}, Lcom/google/android/gms/common/api/ApiException;-><init>(Lcom/google/android/gms/common/api/Status;)V
	invoke-virtual {v0, v1}, Lcom/google/android/gms/tasks/TaskCompletionSource;->trySetException(Ljava/lang/Exception;)Z
	return-void
	:cond_0
	iget-object v1, p0, Lcom/google/android/gms/common/api/internal/zacc;->zac:Lcom/google/android/gms/common/GoogleApiAvailability;
	invoke-virtual {v1, v0}, Lcom/google/android/gms/common/GoogleApiAvailability;->isGooglePlayServicesAvailable(Landroid/content/Context;)I
	move-result v0
	const/4 v1, 0x0
	if-nez v0, :cond_1
	iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	invoke-virtual {v0, v1}, Lcom/google/android/gms/tasks/TaskCompletionSource;->trySetResult(Ljava/lang/Object;)Z
	return-void
	:cond_1
	iget-object v2, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	invoke-virtual {v2}, Lcom/google/android/gms/tasks/TaskCompletionSource;->getTask()Lcom/google/android/gms/tasks/Task;
	move-result-object v2
	invoke-virtual {v2}, Lcom/google/android/gms/tasks/Task;->isComplete()Z
	move-result v2
	if-nez v2, :cond_2
	new-instance v2, Lcom/google/android/gms/common/ConnectionResult;
	invoke-direct {v2, v0, v1}, Lcom/google/android/gms/common/ConnectionResult;-><init>(ILandroid/app/PendingIntent;)V
	const/4 v0, 0x0
	invoke-virtual {p0, v2, v0}, Lcom/google/android/gms/common/api/internal/zap;->zah(Lcom/google/android/gms/common/ConnectionResult;I)V
	:cond_2
	return-void
.end method

.method public final zad()Lcom/google/android/gms/tasks/Task;
	.locals 1
	.annotation system Ldalvik/annotation/Signature;
	value = {
	"()",
	"Lcom/google/android/gms/tasks/Task<",
	"Ljava/lang/Void;",
	">;"
	}
	.end annotation

	iget-object v0, p0, Lcom/google/android/gms/common/api/internal/zacc;->zad:Lcom/google/android/gms/tasks/TaskCompletionSource;
	invoke-virtual {v0}, Lcom/google/android/gms/tasks/TaskCompletionSource;->getTask()Lcom/google/android/gms/tasks/Task;
	move-result-object v0
	return-object v0
.end method