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

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import e.y;
import java.util.Map;
import java.util.Objects;
import p7.r0;

/* JADX INFO: loaded from: classes2.dex */
public final class k extends p7.n {

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

    public /* synthetic */ k(l lVar) {
        Objects.requireNonNull(lVar);
        this.f7927b = lVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x0079  */
    @Override // p7.n
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void a() {
        BitmapDrawable bitmapDrawable;
        y yVar = m7.n.C.f30484w;
        l lVar = this.f7927b;
        Bitmap bitmap = (Bitmap) ((Map) yVar.f25365a).get(Integer.valueOf(lVar.zzc.R.f30450f));
        if (bitmap != null) {
            m7.h hVar = lVar.zzc.R;
            boolean z10 = hVar.f30448d;
            Activity activity = lVar.f7928b;
            if (z10) {
                float f10 = hVar.f30449e;
                if (f10 <= 0.0f || f10 > 25.0f) {
                    bitmapDrawable = new BitmapDrawable(activity.getResources(), bitmap);
                } else {
                    try {
                        Bitmap bitmapCreateScaledBitmap = Bitmap.createScaledBitmap(bitmap, bitmap.getWidth(), bitmap.getHeight(), false);
                        Bitmap bitmapCreateBitmap = Bitmap.createBitmap(bitmapCreateScaledBitmap);
                        RenderScript renderScriptCreate = RenderScript.create(activity);
                        ScriptIntrinsicBlur scriptIntrinsicBlurCreate = ScriptIntrinsicBlur.create(renderScriptCreate, Element.U8_4(renderScriptCreate));
                        Allocation allocationCreateFromBitmap = Allocation.createFromBitmap(renderScriptCreate, bitmapCreateScaledBitmap);
                        Allocation allocationCreateFromBitmap2 = Allocation.createFromBitmap(renderScriptCreate, bitmapCreateBitmap);
                        scriptIntrinsicBlurCreate.setRadius(f10);
                        scriptIntrinsicBlurCreate.setInput(allocationCreateFromBitmap);
                        scriptIntrinsicBlurCreate.forEach(allocationCreateFromBitmap2);
                        allocationCreateFromBitmap2.copyTo(bitmapCreateBitmap);
                        bitmapDrawable = new BitmapDrawable(activity.getResources(), bitmapCreateBitmap);
                    } catch (RuntimeException unused) {
                        bitmapDrawable = new BitmapDrawable(activity.getResources(), bitmap);
                    }
                }
            }
            r0.f31763l.post(new l.l(this, bitmapDrawable, 18, 0));
        }
    }
}
