package com.google.android.gms.internal.ads;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.media.AudioTrack;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcel;
import android.os.RemoteException;
import android.os.SystemClock;
import android.util.Pair;
import android.webkit.ValueCallback;
import java.util.Map;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final /* synthetic */ class m1 implements Runnable {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f13923b;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Object f13925d;

    public /* synthetic */ m1(eb1 eb1Var, wa1 wa1Var, yw0 yw0Var) {
        this.f13922a = 7;
        this.f13923b = eb1Var;
        this.f13924c = wa1Var;
        this.f13925d = yw0Var;
    }

    @Override // java.lang.Runnable
    public final void run() {
        int i10 = this.f13922a;
        Object obj = this.f13925d;
        Object obj2 = this.f13924c;
        Object obj3 = this.f13923b;
        switch (i10) {
            case 0:
                ((q1) obj3).l((zn2) obj2, (vg2) obj);
                return;
            case 1:
                gc gcVar = (gc) obj3;
                synchronized (gcVar.f11699e) {
                    break;
                }
                lc lcVar = (lc) obj2;
                zzash zzashVar = lcVar.zzc;
                if (zzashVar == null) {
                    gcVar.j(lcVar.zza);
                } else {
                    gcVar.k(zzashVar);
                }
                if (lcVar.f13618a) {
                    gcVar.a("intermediate-response");
                } else {
                    gcVar.b("done");
                }
                Runnable runnable = (Runnable) obj;
                if (runnable != null) {
                    runnable.run();
                    return;
                }
                return;
            case 2:
                q30 q30Var = ((zzcfi) obj).S;
                if (q30Var != null) {
                    q30Var.zzf((String) obj3, (String) obj2);
                    return;
                }
                return;
            case 3:
                ((k60) obj3).r0((String) obj2, (ValueCallback) obj);
                return;
            case 4:
                c70 c70Var = (c70) obj3;
                c70Var.getClass();
                m7.n nVar = m7.n.C;
                nVar.f30472k.getClass();
                long jElapsedRealtime = SystemClock.elapsedRealtime();
                String str = ((q7.a) obj).f32212a;
                nVar.f30464c.A((Context) obj2, str);
                tn tnVar = ao.f8877gf;
                n7.y yVar = n7.y.f31093e;
                if (((Boolean) yVar.f31096c.b(tnVar)).booleanValue()) {
                    nVar.f30472k.getClass();
                    long jElapsedRealtime2 = SystemClock.elapsedRealtime() - jElapsedRealtime;
                    br0 br0VarA = c70Var.f9789b.a();
                    br0VarA.zzc("action", "webview_startup_l");
                    StringBuilder sb = new StringBuilder(String.valueOf(jElapsedRealtime2).length());
                    sb.append(jElapsedRealtime2);
                    br0VarA.zzc("webview_startup_l", sb.toString());
                    br0VarA.b();
                }
                if (((Boolean) yVar.f31096c.b(ao.f8975mf)).booleanValue()) {
                    b30.f9364f.execute(new mv1(c70Var, 28));
                    return;
                }
                return;
            case 5:
                ((re1) obj3).zzb((String) obj2, (q7.n) obj, null, null);
                return;
            case 6:
                SQLiteDatabase sQLiteDatabase = (SQLiteDatabase) obj3;
                int i11 = dw0.f10535c;
                ContentValues contentValues = new ContentValues();
                contentValues.put("event_state", (Integer) 1);
                sQLiteDatabase.update("offline_buffered_pings", contentValues, "gws_query_id = ?", new String[]{(String) obj2});
                dw0.m(sQLiteDatabase, (q7.m) obj);
                return;
            case 7:
                yy0.c((eb1) obj3, (wa1) obj2, (yw0) obj);
                return;
            case 8:
                do1 do1Var = (do1) obj3;
                Map map = (Map) obj2;
                map.putAll(do1Var.f10462d.a());
                do1Var.d(map);
                map.put("f", "q");
                map.put("ctx", (Context) obj);
                return;
            case 9:
                yp1 yp1Var = (yp1) obj3;
                tp1 tp1Var = (tp1) obj2;
                xyz.stream.utils.a0 a0Var = (xyz.stream.utils.a0) obj;
                String str2 = yp1Var.f18928b;
                try {
                    gq1 gq1Var = yp1Var.f18927a;
                    gq1Var.getClass();
                    np1 np1Var = (np1) gq1Var.zzc();
                    if (np1Var == null) {
                        return;
                    }
                    Bundle bundle = new Bundle();
                    bundle.putString("callerPackage", str2);
                    yp1.b(tp1Var.zza(), new wp1(6, bundle));
                    yp1.b(tp1Var.zzb(), new wp1(7, bundle));
                    xp1 xp1Var = new xp1(yp1Var, a0Var);
                    lp1 lp1Var = (lp1) np1Var;
                    Parcel parcelO = lp1Var.O();
                    aj.b(parcelO, bundle);
                    aj.d(parcelO, xp1Var);
                    lp1Var.b1(2, parcelO);
                    return;
                } catch (RemoteException e10) {
                    yp1.f18925c.zzd(e10, "dismiss overlay display from: %s", str2);
                    return;
                }
            case 10:
                yp1 yp1Var2 = (yp1) obj3;
                zp1 zp1Var = (zp1) obj2;
                xyz.stream.utils.a0 a0Var2 = (xyz.stream.utils.a0) obj;
                String str3 = yp1Var2.f18928b;
                try {
                    gq1 gq1Var2 = yp1Var2.f18927a;
                    gq1Var2.getClass();
                    np1 np1Var2 = (np1) gq1Var2.zzc();
                    if (np1Var2 == null) {
                        return;
                    }
                    Bundle bundle2 = new Bundle();
                    bundle2.putString("callerPackage", str3);
                    bundle2.putBinder("windowToken", ((qp1) zp1Var).f15839a);
                    yp1.b(zp1Var.zzj(), new wp1(1, bundle2));
                    bundle2.putInt("layoutGravity", ((qp1) zp1Var).f15840b);
                    bundle2.putFloat("layoutVerticalMargin", ((qp1) zp1Var).f15841c);
                    bundle2.putInt("displayMode", 0);
                    bundle2.putInt("triggerMode", 0);
                    bundle2.putInt("windowWidthPx", ((qp1) zp1Var).f15842d);
                    yp1.b(null, new wp1(2, bundle2));
                    yp1.b(null, new wp1(3, bundle2));
                    yp1.b(zp1Var.zzb(), new wp1(4, bundle2));
                    yp1.b(null, new wp1(5, bundle2));
                    bundle2.putBoolean("stableSessionToken", true);
                    xp1 xp1Var2 = new xp1(yp1Var2, a0Var2);
                    lp1 lp1Var2 = (lp1) np1Var2;
                    Parcel parcelO2 = lp1Var2.O();
                    parcelO2.writeString(str3);
                    aj.b(parcelO2, bundle2);
                    aj.d(parcelO2, xp1Var2);
                    lp1Var2.b1(1, parcelO2);
                    return;
                } catch (RemoteException e11) {
                    yp1.f18925c.zzd(e11, "show overlay display from: %s", str3);
                    return;
                }
            case 11:
                li2 li2Var = (li2) obj3;
                li2Var.getClass();
                zzguf zzgufVarG = ((as1) obj2).g();
                ((ek2) li2Var.f13709c).zzz(zzgufVarG, (cp2) obj);
                return;
            case 12:
                Pair pair = (Pair) obj2;
                int iIntValue = ((Integer) pair.first).intValue();
                cp2 cp2Var = (cp2) pair.second;
                ((ek2) ((pi2) obj3).f15425b.f17646h).zzam(iIntValue, cp2Var, (yo2) obj);
                return;
            case 13:
                ((gl2) obj3).r((zn2) obj2, (vg2) obj);
                return;
            default:
                zl2.d((AudioTrack) obj3, (Handler) obj2, (lt0) obj);
                return;
        }
    }

    public /* synthetic */ m1(Object obj, Object obj2, Object obj3, int i10) {
        this.f13922a = i10;
        this.f13923b = obj;
        this.f13924c = obj2;
        this.f13925d = obj3;
    }

    public m1(zzcfi zzcfiVar, String str, String str2) {
        this.f13922a = 2;
        this.f13923b = str;
        this.f13924c = str2;
        Objects.requireNonNull(zzcfiVar);
        this.f13925d = zzcfiVar;
    }
}
