package P2;

import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
import com.google.android.gms.common.api.GoogleApiActivity;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class p implements DialogInterface.OnClickListener {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f5429a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Intent f5430b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Object f5431c;

    public /* synthetic */ p(Intent intent, Object obj, int i) {
        this.f5429a = i;
        this.f5430b = intent;
        this.f5431c = obj;
    }

    /* JADX WARN: Type inference failed for: r1v2, types: [O2.e, java.lang.Object] */
    public final void a() {
        switch (this.f5429a) {
            case u0.f15495q /* 0 */:
                Intent intent = this.f5430b;
                if (intent != null) {
                    ((GoogleApiActivity) this.f5431c).startActivityForResult(intent, 2);
                }
                break;
            default:
                Intent intent2 = this.f5430b;
                if (intent2 != null) {
                    this.f5431c.a(intent2, 2);
                }
                break;
        }
    }

    @Override // android.content.DialogInterface.OnClickListener
    public final void onClick(DialogInterface dialogInterface, int i) {
        try {
            try {
                a();
            } catch (ActivityNotFoundException e8) {
                Log.e("DialogRedirect", true == Build.FINGERPRINT.contains("generic") ? "Failed to start resolution intent. This may occur when resolving Google Play services connection issues on emulators with Google APIs but not Google Play Store." : "Failed to start resolution intent.", e8);
            }
        } finally {
            dialogInterface.dismiss();
        }
    }
}
