package com.google.android.play.core.integrity;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import defpackage.qy3;
import defpackage.t1b;

/* JADX INFO: loaded from: classes2.dex */
abstract class y {
    private final String b;
    private final long c;

    @qy3
    private boolean e;
    private final t1b a = new t1b("IntegrityDialogWrapper");
    private final Object d = new Object();

    public y(String str, long j) {
        this.b = str;
        this.c = j;
    }

    public final Task a(Activity activity, int i) {
        synchronized (this.d) {
            try {
                if (this.e) {
                    return Tasks.forResult(0);
                }
                this.e = true;
                t1b t1bVar = this.a;
                Object[] objArr = {Integer.valueOf(i)};
                if (Log.isLoggable("PlayCore", 3)) {
                    t1b.d(t1bVar.a, "checkAndShowDialog(%s)", objArr);
                } else {
                    t1bVar.getClass();
                }
                Bundle bundle = new Bundle();
                bundle.putInt("dialog.intent.type", i);
                bundle.putString("package.name", this.b);
                bundle.putInt("playcore.integrity.version.major", 1);
                bundle.putInt("playcore.integrity.version.minor", 4);
                bundle.putInt("playcore.integrity.version.patch", 0);
                bundle.putLong("request.token.sid", this.c);
                return b(activity, bundle);
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    public abstract Task b(Activity activity, Bundle bundle);
}
