package defpackage;

import android.content.Context;
import android.graphics.SurfaceTexture;
import android.os.Build;
import android.view.Surface;
import androidx.media3.common.util.GlUtil$GlException;

/* JADX INFO: renamed from: ˑˀᵬ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2048 extends Surface {

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public static int f8129;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public static boolean f8130;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final boolean f8131;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public boolean f8132;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final HandlerThreadC1926 f8133;

    public C2048(HandlerThreadC1926 handlerThreadC1926, SurfaceTexture surfaceTexture, boolean z) {
        super(surfaceTexture);
        this.f8133 = handlerThreadC1926;
        this.f8131 = z;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static synchronized boolean m5463(Context context) {
        try {
            if (!f8130) {
                f8129 = m5464(context);
                f8130 = true;
            }
        } catch (Throwable th) {
            throw th;
        }
        return f8129 != 0;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static int m5464(Context context) {
        try {
            int i = Build.VERSION.SDK_INT;
            if ((i >= 24 && (i >= 26 || !("samsung".equals(Build.MANUFACTURER) || "XT1650".equals(Build.MODEL))) && (i >= 26 || context.getPackageManager().hasSystemFeature("android.hardware.vr.high_performance"))) ? ᵺᵘ.ᵯᵷʽ("EGL_EXT_protected_content") : false) {
                return ᵺᵘ.ᵯᵷʽ("EGL_KHR_surfaceless_context") ? 1 : 2;
            }
            return 0;
        } catch (GlUtil$GlException e) {
            ˋˀᵧ.ᵝᵶ("Failed to determine secure mode due to GL error: " + e.getMessage());
            return 0;
        }
    }

    @Override // android.view.Surface
    public final void release() {
        super.release();
        synchronized (this.f8133) {
            try {
                if (!this.f8132) {
                    HandlerThreadC1926 handlerThreadC1926 = this.f8133;
                    handlerThreadC1926.f7680.getClass();
                    handlerThreadC1926.f7680.sendEmptyMessage(2);
                    this.f8132 = true;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
