ResolutionUtil.smali

.class public Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;
.super Ljava/lang/Object;
.source "ResolutionUtil.java"


# static fields
.field static mSuitableWidth:I

.field private static msGetResolutionLevelLock:Ljava/lang/Object;

.field static volatile sLevel:I

.field public static sMEResolutionLevel:[I


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

    .prologue
    const/4 v1, 0x0

    .line 5
    const/4 v0, 0x0

    sput-object v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    .line 7
    sput v1, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    .line 58
    sput v1, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    .line 59
    new-instance v0, Ljava/lang/Object;

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

    sput-object v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->msGetResolutionLevelLock:Ljava/lang/Object;

    return-void
.end method

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

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

    return-void
.end method

.method public static getKeyResolutions()[I
    .registers 1

    .prologue
    .line 44
    invoke-static {}, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->initsMEResolutionLevel()V

    .line 46
    sget-object v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    return-object v0
.end method

.method public static getResolutionLevel()I
    .registers 7

    .prologue
    .line 64
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    if-lez v0, :cond_7

    .line 65
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    .line 80
    :goto_6
    return v0

    .line 68
    :cond_7
    sget-object v1, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->msGetResolutionLevelLock:Ljava/lang/Object;

    monitor-enter v1

    .line 69
    :try_start_a
    invoke-static {}, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->getSuitableHight()I

    move-result v2

    .line 70
    invoke-static {}, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->getKeyResolutions()[I

    move-result-object v3

    .line 71
    if-eqz v3, :cond_2c

    .line 72
    array-length v4, v3

    const/4 v0, 0x0

    :goto_16
    if-ge v0, v4, :cond_2c

    aget v5, v3, v0

    .line 73
    sget v6, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    add-int/lit8 v6, v6, 0x1

    sput v6, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    .line 75
    if-ne v5, v2, :cond_29

    .line 76
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    monitor-exit v1

    goto :goto_6

    .line 81
    :catchall_26
    move-exception v0

    monitor-exit v1
    :try_end_28
    .catchall {:try_start_a .. :try_end_28} :catchall_26

    throw v0

    .line 72
    :cond_29
    add-int/lit8 v0, v0, 0x1

    goto :goto_16

    .line 80
    :cond_2c
    :try_start_2c
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sLevel:I

    monitor-exit v1
    :try_end_2f
    .catchall {:try_start_2c .. :try_end_2f} :catchall_26

    goto :goto_6
.end method

.method public static getSuitableHight()I
    .registers 5

    .prologue
    .line 16
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    if-lez v0, :cond_7

    .line 17
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    .line 40
    :goto_6
    return v0

    .line 20
    :cond_7
    invoke-static {}, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->initsMEResolutionLevel()V

    .line 22
    invoke-static {}, Lcom/cleanmaster/hpsharelib/utils/MiscUtils;->getScreenWidth()I

    move-result v0

    .line 23
    invoke-static {}, Lcom/cleanmaster/hpsharelib/utils/MiscUtils;->getScreenHeight()I

    move-result v1

    .line 25
    if-ge v0, v1, :cond_36

    .line 26
    :goto_14
    sput v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    .line 28
    sget-object v1, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    array-length v2, v1

    const/4 v0, 0x0

    :goto_1a
    if-ge v0, v2, :cond_24

    aget v3, v1, v0

    .line 29
    sget v4, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    if-gt v4, v3, :cond_38

    .line 30
    sput v3, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    .line 35
    :cond_24
    sget-object v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    sget-object v1, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    array-length v1, v1

    add-int/lit8 v1, v1, -0x1

    aget v0, v0, v1

    .line 36
    sget v1, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    if-ge v0, v1, :cond_33

    .line 37
    sput v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    .line 40
    :cond_33
    sget v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->mSuitableWidth:I

    goto :goto_6

    :cond_36
    move v0, v1

    .line 25
    goto :goto_14

    .line 28
    :cond_38
    add-int/lit8 v0, v0, 0x1

    goto :goto_1a
.end method

.method private static initsMEResolutionLevel()V
    .registers 1

    .prologue
    .line 50
    sget-object v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    if-nez v0, :cond_d

    .line 52
    const/16 v0, 0x8

    new-array v0, v0, [I

    fill-array-data v0, :array_e

    sput-object v0, Lcom/cleanmaster/hpsharelib/utils/ResolutionUtil;->sMEResolutionLevel:[I

    .line 56
    :cond_d
    return-void

    .line 52
    :array_e
    .array-data 4
        0x140
        0x1e0
        0x21c
        0x258
        0x2d0
        0x320
        0x438
        0x5a0
    .end array-data
.end method