package l;

import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.RemoteException;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.appcompat.view.menu.ActionMenuItemView;
import androidx.appcompat.widget.Toolbar;
import com.google.android.gms.internal.ads.aj;
import com.google.android.gms.internal.ads.bq1;
import com.google.android.gms.internal.ads.c60;
import com.google.android.gms.internal.ads.gq1;
import com.google.android.gms.internal.ads.lp1;
import com.google.android.gms.internal.ads.np1;
import com.google.android.gms.internal.ads.p10;
import com.google.android.gms.internal.ads.sp1;
import com.google.android.gms.internal.ads.w40;
import com.google.android.gms.internal.ads.wp1;
import com.google.android.gms.internal.ads.xp1;
import com.google.android.gms.internal.ads.yp1;
import java.util.HashMap;
import java.util.Objects;

/* JADX INFO: loaded from: classes.dex */
public final class w0 implements Runnable {

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

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

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

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

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

    public /* synthetic */ w0(int i10, int i11, Object obj, Object obj2, Object obj3) {
        this.f29877a = i11;
        this.f29879c = obj;
        this.f29878b = i10;
        this.f29880d = obj2;
        this.f29881e = obj3;
    }

    @Override // java.lang.Runnable
    public final void run() throws Throwable {
        switch (this.f29877a) {
            case 0:
                ((TextView) this.f29879c).setTypeface((Typeface) this.f29880d, this.f29878b);
                break;
            case 1:
                HashMap mapO = com.google.android.gms.measurement.internal.u1.o("event", "precacheComplete");
                mapO.put("src", (String) this.f29879c);
                mapO.put("cachedSrc", (String) this.f29880d);
                mapO.put("totalBytes", Integer.toString(this.f29878b));
                ((w40) this.f29881e).r(mapO);
                break;
            case 2:
                ((c60) this.f29879c).l((View) this.f29880d, (p10) this.f29881e, this.f29878b - 1);
                break;
            case 3:
                yp1 yp1Var = (yp1) this.f29879c;
                bq1 bq1Var = (bq1) this.f29880d;
                int i10 = this.f29878b;
                xyz.stream.utils.a0 a0Var = (xyz.stream.utils.a0) this.f29881e;
                String str = yp1Var.f18928b;
                try {
                    gq1 gq1Var = yp1Var.f18927a;
                    gq1Var.getClass();
                    np1 np1Var = (np1) gq1Var.zzc();
                    if (np1Var != null) {
                        Bundle bundle = new Bundle();
                        bundle.putString("callerPackage", str);
                        bundle.putInt("displayMode", i10);
                        yp1.b(bq1Var.zza(), new wp1(8, bundle));
                        yp1.b(bq1Var.zzb(), new wp1(0, 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(3, parcelO);
                    }
                } catch (RemoteException e10) {
                    yp1.f18925c.zzd(e10, "switchDisplayMode overlay display to %d from: %s", Integer.valueOf(i10), str);
                    return;
                }
                break;
            case 4:
                com.google.android.gms.measurement.internal.l3 l3Var = (com.google.android.gms.measurement.internal.l3) this.f29879c;
                int i11 = this.f29878b;
                com.google.android.gms.measurement.internal.p0 p0Var = (com.google.android.gms.measurement.internal.p0) this.f29880d;
                Intent intent = (Intent) this.f29881e;
                com.google.android.gms.measurement.internal.n3 n3Var = (com.google.android.gms.measurement.internal.n3) l3Var.f21736a;
                if (n3Var.zza(i11)) {
                    p0Var.f21842n.b(Integer.valueOf(i11), "Local AppMeasurementService processed last upload request. StartId");
                    l3Var.a().f21842n.c("Completed wakeful intent.");
                    n3Var.zza(intent);
                }
                break;
            default:
                ActionMenuItemView actionMenuItemView = com.google.android.material.internal.r0.getActionMenuItemView((Toolbar) this.f29879c, this.f29878b);
                if (actionMenuItemView != null) {
                    z8.a aVar = (z8.a) this.f29880d;
                    Resources resources = ((Toolbar) this.f29879c).getResources();
                    int dimensionPixelOffset = resources.getDimensionPixelOffset(x8.e.mtrl_badge_toolbar_action_menu_item_horizontal_offset);
                    Integer numValueOf = Integer.valueOf(dimensionPixelOffset);
                    z8.c cVar = aVar.f37076e;
                    cVar.f37101a.f37084a0 = numValueOf;
                    cVar.f37102b.f37084a0 = Integer.valueOf(dimensionPixelOffset);
                    aVar.h();
                    int dimensionPixelOffset2 = resources.getDimensionPixelOffset(x8.e.mtrl_badge_toolbar_action_menu_item_vertical_offset);
                    Integer numValueOf2 = Integer.valueOf(dimensionPixelOffset2);
                    z8.c cVar2 = aVar.f37076e;
                    cVar2.f37101a.f37086b0 = numValueOf2;
                    cVar2.f37102b.f37086b0 = Integer.valueOf(dimensionPixelOffset2);
                    aVar.h();
                    z8.e.attachBadgeDrawable((z8.a) this.f29880d, actionMenuItemView, (FrameLayout) this.f29881e);
                    z8.a aVar2 = (z8.a) this.f29880d;
                    if (Build.VERSION.SDK_INT >= 29 && androidx.core.view.s1.d(actionMenuItemView)) {
                        androidx.core.view.s1.setAccessibilityDelegate(actionMenuItemView, new z8.d(actionMenuItemView.getAccessibilityDelegate(), actionMenuItemView, aVar2));
                    } else {
                        androidx.core.view.s1.setAccessibilityDelegate(actionMenuItemView, new z8.d(aVar2, actionMenuItemView));
                    }
                }
                break;
        }
    }

    public /* synthetic */ w0(c60 c60Var, View view, p10 p10Var, int i10) {
        this.f29877a = 2;
        this.f29879c = c60Var;
        this.f29880d = view;
        this.f29881e = p10Var;
        this.f29878b = i10;
    }

    public /* synthetic */ w0(yp1 yp1Var, sp1 sp1Var, int i10, xyz.stream.utils.a0 a0Var) {
        this.f29877a = 3;
        this.f29879c = yp1Var;
        this.f29880d = sp1Var;
        this.f29878b = i10;
        this.f29881e = a0Var;
    }

    public w0(w40 w40Var, String str, String str2, int i10) {
        this.f29877a = 1;
        this.f29879c = str;
        this.f29880d = str2;
        this.f29878b = i10;
        Objects.requireNonNull(w40Var);
        this.f29881e = w40Var;
    }

    public w0(a1 a1Var, TextView textView, Typeface typeface, int i10) {
        this.f29877a = 0;
        this.f29881e = a1Var;
        this.f29879c = textView;
        this.f29880d = typeface;
        this.f29878b = i10;
    }
}
