.class public final Lz5/ge;
.super Landroid/view/Surface;
.source ""


# annotations
.annotation build Landroid/annotation/TargetApi;
    value = 0x11
.end annotation


# static fields
.field public static t:Z

.field public static u:Z


# instance fields
.field public final r:Lz5/fe;

.field public s:Z


# direct methods
.method public synthetic constructor <init>(Lz5/fe;Landroid/graphics/SurfaceTexture;)V
    .registers 3

    invoke-direct {p0, p2}, Landroid/view/Surface;-><init>(Landroid/graphics/SurfaceTexture;)V

    iput-object p1, p0, Lz5/ge;->r:Lz5/fe;

    return-void
.end method

.method public static declared-synchronized a(Landroid/content/Context;)Z
    .registers 7

    const-class v0, Lz5/ge;

    monitor-enter v0

    :try_start_3
    sget-boolean v1, Lz5/ge;->u:Z

    if-nez v1, :cond_4b

    sget v1, Lz5/be;->a:I

    const/16 v2, 0x11

    const/4 v3, 0x1

    if-lt v1, v2, :cond_49

    const/4 v2, 0x0

    invoke-static {v2}, Landroid/opengl/EGL14;->eglGetDisplay(I)Landroid/opengl/EGLDisplay;

    move-result-object v4

    const/16 v5, 0x3055

    invoke-static {v4, v5}, Landroid/opengl/EGL14;->eglQueryString(Landroid/opengl/EGLDisplay;I)Ljava/lang/String;

    move-result-object v4

    if-eqz v4, :cond_47

    const-string v5, "EGL_EXT_protected_content"

    invoke-virtual {v4, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v4

    if-eqz v4, :cond_47

    const/16 v4, 0x18

    if-ne v1, v4, :cond_46

    sget-object v1, Lz5/be;->d:Ljava/lang/String;

    const-string v4, "SM-G950"

    invoke-virtual {v1, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_39

    const-string v4, "SM-G955"

    invoke-virtual {v1, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_46

    :cond_39
    invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object p0

    const-string v1, "android.hardware.vr.high_performance"

    invoke-virtual {p0, v1}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z

    move-result p0

    if-nez p0, :cond_46

    goto :goto_47

    :cond_46
    move v2, v3

    :cond_47
    :goto_47
    sput-boolean v2, Lz5/ge;->t:Z

    :cond_49
    sput-boolean v3, Lz5/ge;->u:Z

    :cond_4b
    sget-boolean p0, Lz5/ge;->t:Z
    :try_end_4d
    .catchall {:try_start_3 .. :try_end_4d} :catchall_4f

    monitor-exit v0

    return p0

    :catchall_4f
    move-exception p0

    monitor-exit v0

    throw p0
.end method

.method public static b(Landroid/content/Context;Z)Lz5/ge;
    .registers 6

    sget v0, Lz5/be;->a:I

    const/16 v1, 0x11

    if-lt v0, v1, :cond_60

    const/4 v0, 0x0

    const/4 v1, 0x1

    if-eqz p1, :cond_13

    invoke-static {p0}, Lz5/ge;->a(Landroid/content/Context;)Z

    move-result p0

    if-eqz p0, :cond_11

    goto :goto_13

    :cond_11
    move p0, v0

    goto :goto_14

    :cond_13
    :goto_13
    move p0, v1

    :goto_14
    invoke-static {p0}, Lcom/google/android/gms/internal/ads/r;->q(Z)V

    new-instance p0, Lz5/fe;

    invoke-direct {p0}, Lz5/fe;-><init>()V

    .line 1
    invoke-virtual {p0}, Landroid/os/HandlerThread;->start()V

    new-instance v2, Landroid/os/Handler;

    invoke-virtual {p0}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v3

    invoke-direct {v2, v3, p0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;Landroid/os/Handler$Callback;)V

    iput-object v2, p0, Lz5/fe;->s:Landroid/os/Handler;

    monitor-enter p0

    :try_start_2b
    iget-object v2, p0, Lz5/fe;->s:Landroid/os/Handler;

    invoke-virtual {v2, v1, p1, v0}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object p1

    invoke-virtual {p1}, Landroid/os/Message;->sendToTarget()V

    :goto_34
    iget-object p1, p0, Lz5/fe;->w:Lz5/ge;

    if-nez p1, :cond_46

    iget-object p1, p0, Lz5/fe;->v:Ljava/lang/RuntimeException;

    if-nez p1, :cond_46

    iget-object p1, p0, Lz5/fe;->u:Ljava/lang/Error;
    :try_end_3e
    .catchall {:try_start_2b .. :try_end_3e} :catchall_5d

    if-nez p1, :cond_46

    :try_start_40
    invoke-virtual {p0}, Ljava/lang/Object;->wait()V
    :try_end_43
    .catch Ljava/lang/InterruptedException; {:try_start_40 .. :try_end_43} :catch_44
    .catchall {:try_start_40 .. :try_end_43} :catchall_5d

    goto :goto_34

    :catch_44
    move v0, v1

    goto :goto_34

    :cond_46
    :try_start_46
    monitor-exit p0
    :try_end_47
    .catchall {:try_start_46 .. :try_end_47} :catchall_5d

    if-eqz v0, :cond_50

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Thread;->interrupt()V

    :cond_50
    iget-object p1, p0, Lz5/fe;->v:Ljava/lang/RuntimeException;

    if-nez p1, :cond_5c

    iget-object p1, p0, Lz5/fe;->u:Ljava/lang/Error;

    if-nez p1, :cond_5b

    iget-object p0, p0, Lz5/fe;->w:Lz5/ge;

    return-object p0

    :cond_5b
    throw p1

    :cond_5c
    throw p1

    :catchall_5d
    move-exception p1

    :try_start_5e
    monitor-exit p0
    :try_end_5f
    .catchall {:try_start_5e .. :try_end_5f} :catchall_5d

    throw p1

    .line 2
    :cond_60
    new-instance p0, Ljava/lang/UnsupportedOperationException;

    const-string p1, "Unsupported prior to API level 17"

    invoke-direct {p0, p1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw p0
.end method


# virtual methods
.method public final release()V
    .registers 4

    invoke-super {p0}, Landroid/view/Surface;->release()V

    iget-object v0, p0, Lz5/ge;->r:Lz5/fe;

    monitor-enter v0

    :try_start_6
    iget-boolean v1, p0, Lz5/ge;->s:Z

    if-nez v1, :cond_18

    iget-object v1, p0, Lz5/ge;->r:Lz5/fe;

    .line 1
    iget-object v1, v1, Lz5/fe;->s:Landroid/os/Handler;

    const/4 v2, 0x3

    invoke-virtual {v1, v2}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    const/4 v1, 0x1

    .line 2
    iput-boolean v1, p0, Lz5/ge;->s:Z

    goto :goto_18

    :catchall_16
    move-exception v1

    goto :goto_1a

    :cond_18
    :goto_18
    monitor-exit v0

    return-void

    :goto_1a
    monitor-exit v0
    :try_end_1b
    .catchall {:try_start_6 .. :try_end_1b} :catchall_16

    throw v1
.end method
