package com.discord.utilities.auth; import c.i.a.f.c.a.d.a; import c.i.a.f.c.a.d.b; import c.i.a.f.n.c; import com.discord.app.AppFragment; import com.discord.app.AppLog; import com.google.android.gms.auth.api.credentials.Credential; import com.google.android.gms.common.api.ApiException; import com.google.android.gms.common.api.ResolvableApiException; import com.google.android.gms.tasks.Task; import d0.z.d.m; /* compiled from: GoogleSmartLockManager.kt */ public final class GoogleSmartLockManager$requestCredentials$1 implements c { public final /* synthetic */ AppFragment $fragment; public final /* synthetic */ int $requestCode; public final /* synthetic */ GoogleSmartLockManager this$0; public GoogleSmartLockManager$requestCredentials$1(GoogleSmartLockManager googleSmartLockManager, AppFragment appFragment, int i) { this.this$0 = googleSmartLockManager; this.$fragment = appFragment; this.$requestCode = i; } @Override // c.i.a.f.n.c public final void onComplete(Task task) { m.checkNotNullParameter(task, "task"); boolean z2 = true; if (task.p()) { a l = task.l(); m.checkNotNullExpressionValue(l, "task.result"); Credential Q = ((b) l.a).Q(); String str = null; String str2 = Q != null ? Q.i : null; a l2 = task.l(); m.checkNotNullExpressionValue(l2, "task.result"); Credential Q2 = ((b) l2.a).Q(); if (Q2 != null) { str = Q2.m; } if (str2 != null && str != null) { this.this$0.getSmartLockRepo().setAttemptToSignInWithSmartLock(true); this.this$0.getSmartLockRepo().setSmartLockLogin(str2, str); return; } return; } Exception k = task.k(); if (k instanceof ResolvableApiException) { ResolvableApiException resolvableApiException = (ResolvableApiException) k; if (resolvableApiException.mStatus.o == 4) { z2 = false; } AppLog.g.w("Google Smart Lock", "Resolvable Exception requesting credentials", k); if (z2) { GoogleSmartLockManager.access$resolveResult(this.this$0, this.$fragment, this.$requestCode, resolvableApiException); } } else if (k instanceof ApiException) { AppLog.g.w("Google Smart Lock", "API Exception requesting credentials", k); } else { AppLog.g.w("Google Smart Lock", "Exception requesting credentials", k); } } }