.class public final Lt3/q;
.super Ljava/lang/Object;
.source ""


# static fields
.field public static final g:Z

.field public static final h:Z

.field public static final i:Ljava/io/File;

.field public static volatile j:Lt3/q;

.field public static volatile k:I


# instance fields
.field public final a:Z

.field public final b:I

.field public final c:I

.field public d:I

.field public e:Z

.field public final f:Ljava/util/concurrent/atomic/AtomicBoolean;


# direct methods
.method public static constructor <clinit>()V
    .registers 4

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/4 v1, 0x1

    const/4 v2, 0x0

    const/16 v3, 0x1d

    if-ge v0, v3, :cond_a

    move v3, v1

    goto :goto_b

    :cond_a
    move v3, v2

    :goto_b
    sput-boolean v3, Lt3/q;->g:Z

    const/16 v3, 0x1a

    if-lt v0, v3, :cond_12

    goto :goto_13

    :cond_12
    move v1, v2

    :goto_13
    sput-boolean v1, Lt3/q;->h:Z

    new-instance v0, Ljava/io/File;

    const-string v1, "/proc/self/fd"

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    sput-object v0, Lt3/q;->i:Ljava/io/File;

    const/4 v0, -0x1

    sput v0, Lt3/q;->k:I

    return-void
.end method

.method public constructor <init>()V
    .registers 27

    move-object/from16 v0, p0

    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    const/4 v1, 0x1

    iput-boolean v1, v0, Lt3/q;->e:Z

    new-instance v2, Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v3, 0x0

    invoke-direct {v2, v3}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V

    iput-object v2, v0, Lt3/q;->f:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 1
    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v4, 0x1a

    if-eq v2, v4, :cond_17

    goto :goto_5b

    :cond_17
    const-string v5, "SC-04J"

    const-string v6, "SM-N935"

    const-string v7, "SM-J720"

    const-string v8, "SM-G570F"

    const-string v9, "SM-G570M"

    const-string v10, "SM-G960"

    const-string v11, "SM-G965"

    const-string v12, "SM-G935"

    const-string v13, "SM-G930"

    const-string v14, "SM-A520"

    const-string v15, "SM-A720F"

    const-string v16, "moto e5"

    const-string v17, "moto e5 play"

    const-string v18, "moto e5 plus"

    const-string v19, "moto e5 cruise"

    const-string v20, "moto g(6) forge"

    const-string v21, "moto g(6) play"

    filled-new-array/range {v5 .. v21}, [Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_45
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_5b

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    sget-object v5, Landroid/os/Build;->MODEL:Ljava/lang/String;

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

    move-result v4

    if-eqz v4, :cond_45

    move v2, v1

    goto :goto_5c

    :cond_5b
    :goto_5b
    move v2, v3

    :goto_5c
    if-nez v2, :cond_a1

    .line 2
    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v4, 0x1b

    if-eq v2, v4, :cond_66

    move v2, v3

    goto :goto_9e

    :cond_66
    const-string v5, "LG-M250"

    const-string v6, "LG-M320"

    const-string v7, "LG-Q710AL"

    const-string v8, "LG-Q710PL"

    const-string v9, "LGM-K121K"

    const-string v10, "LGM-K121L"

    const-string v11, "LGM-K121S"

    const-string v12, "LGM-X320K"

    const-string v13, "LGM-X320L"

    const-string v14, "LGM-X320S"

    const-string v15, "LGM-X401L"

    const-string v16, "LGM-X401S"

    const-string v17, "LM-Q610.FG"

    const-string v18, "LM-Q610.FGN"

    const-string v19, "LM-Q617.FG"

    const-string v20, "LM-Q617.FGN"

    const-string v21, "LM-Q710.FG"

    const-string v22, "LM-Q710.FGN"

    const-string v23, "LM-X220PM"

    const-string v24, "LM-X220QMA"

    const-string v25, "LM-X410PM"

    filled-new-array/range {v5 .. v25}, [Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v2

    sget-object v4, Landroid/os/Build;->MODEL:Ljava/lang/String;

    invoke-interface {v2, v4}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v2

    :goto_9e
    if-nez v2, :cond_a1

    goto :goto_a2

    :cond_a1
    move v1, v3

    .line 3
    :goto_a2
    iput-boolean v1, v0, Lt3/q;->a:Z

    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x1c

    if-lt v1, v2, :cond_b1

    const/16 v1, 0x4e20

    iput v1, v0, Lt3/q;->b:I

    iput v3, v0, Lt3/q;->c:I

    goto :goto_b9

    :cond_b1
    const/16 v1, 0x2bc

    iput v1, v0, Lt3/q;->b:I

    const/16 v1, 0x80

    iput v1, v0, Lt3/q;->c:I

    :goto_b9
    return-void
.end method

.method public static a()Lt3/q;
    .registers 2

    sget-object v0, Lt3/q;->j:Lt3/q;

    if-nez v0, :cond_17

    const-class v0, Lt3/q;

    monitor-enter v0

    :try_start_7
    sget-object v1, Lt3/q;->j:Lt3/q;

    if-nez v1, :cond_12

    new-instance v1, Lt3/q;

    invoke-direct {v1}, Lt3/q;-><init>()V

    sput-object v1, Lt3/q;->j:Lt3/q;

    :cond_12
    monitor-exit v0

    goto :goto_17

    :catchall_14
    move-exception v1

    monitor-exit v0
    :try_end_16
    .catchall {:try_start_7 .. :try_end_16} :catchall_14

    throw v1

    :cond_17
    :goto_17
    sget-object v0, Lt3/q;->j:Lt3/q;

    return-object v0
.end method


# virtual methods
.method public b(IIZZ)Z
    .registers 10

    const/4 v0, 0x2

    const/4 v1, 0x0

    if-nez p3, :cond_14

    const-string p1, "HardwareConfig"

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_13

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed by caller"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_13
    return v1

    :cond_14
    iget-boolean p3, p0, Lt3/q;->a:Z

    if-nez p3, :cond_28

    const-string p1, "HardwareConfig"

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_27

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed by device model"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_27
    return v1

    :cond_28
    sget-boolean p3, Lt3/q;->h:Z

    if-nez p3, :cond_3c

    const-string p1, "HardwareConfig"

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_3b

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed by sdk"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_3b
    return v1

    .line 1
    :cond_3c
    sget-boolean p3, Lt3/q;->g:Z

    const/4 v2, 0x1

    if-eqz p3, :cond_4b

    iget-object p3, p0, Lt3/q;->f:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {p3}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result p3

    if-nez p3, :cond_4b

    move p3, v2

    goto :goto_4c

    :cond_4b
    move p3, v1

    :goto_4c
    if-eqz p3, :cond_5e

    const-string p1, "HardwareConfig"

    .line 2
    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_5d

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed by app state"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_5d
    return v1

    :cond_5e
    if-eqz p4, :cond_70

    const-string p1, "HardwareConfig"

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_6f

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed because exif orientation is required"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_6f
    return v1

    :cond_70
    iget p3, p0, Lt3/q;->c:I

    if-ge p1, p3, :cond_84

    const-string p1, "HardwareConfig"

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_83

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed because width is too small"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_83
    return v1

    :cond_84
    if-ge p2, p3, :cond_96

    const-string p1, "HardwareConfig"

    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_95

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed because height is too small"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_95
    return v1

    .line 3
    :cond_96
    monitor-enter p0

    :try_start_97
    iget p1, p0, Lt3/q;->d:I

    add-int/2addr p1, v2

    iput p1, p0, Lt3/q;->d:I

    const/16 p2, 0x32

    if-lt p1, p2, :cond_e7

    iput v1, p0, Lt3/q;->d:I

    sget-object p1, Lt3/q;->i:Ljava/io/File;

    invoke-virtual {p1}, Ljava/io/File;->list()[Ljava/lang/String;

    move-result-object p1

    array-length p1, p1

    .line 4
    sget p2, Lt3/q;->k:I

    const/4 p3, -0x1

    if-eq p2, p3, :cond_b1

    sget p2, Lt3/q;->k:I

    goto :goto_b3

    :cond_b1
    iget p2, p0, Lt3/q;->b:I

    :goto_b3
    int-to-long p2, p2

    int-to-long v3, p1

    cmp-long p4, v3, p2

    if-gez p4, :cond_bb

    move p4, v2

    goto :goto_bc

    :cond_bb
    move p4, v1

    .line 5
    :goto_bc
    iput-boolean p4, p0, Lt3/q;->e:Z

    if-nez p4, :cond_e7

    const-string p4, "Downsampler"

    const/4 v3, 0x5

    invoke-static {p4, v3}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p4

    if-eqz p4, :cond_e7

    const-string p4, "Downsampler"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Excluding HARDWARE bitmap config because we\'re over the file descriptor limit, file descriptors "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p1, ", limit "

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {p4, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    :cond_e7
    iget-boolean p1, p0, Lt3/q;->e:Z
    :try_end_e9
    .catchall {:try_start_97 .. :try_end_e9} :catchall_fd

    monitor-exit p0

    if-nez p1, :cond_fc

    const-string p1, "HardwareConfig"

    .line 6
    invoke-static {p1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result p1

    if-eqz p1, :cond_fb

    const-string p1, "HardwareConfig"

    const-string p2, "Hardware config disallowed because there are insufficient FDs"

    invoke-static {p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    :cond_fb
    return v1

    :cond_fc
    return v2

    :catchall_fd
    move-exception p1

    .line 7
    monitor-exit p0

    throw p1
.end method
