DialogChecker.smali

.class public Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;
.super Ljava/lang/Object;
.source "DialogChecker.java"


# static fields
.field private static mIns:Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;


# instance fields
.field private mTopAppQuery:Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;


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

    .prologue
    .line 21
    const/4 v0, 0x0

    sput-object v0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mIns:Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    return-void
.end method

.method private constructor <init>()V
    .registers 2

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

    .line 22
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mTopAppQuery:Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;

    .line 25
    new-instance v0, Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;

    invoke-direct {v0}, Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;-><init>()V

    iput-object v0, p0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mTopAppQuery:Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;

    .line 26
    return-void
.end method

.method private checkInternal(Ljava/lang/String;Lcom/cleanmaster/hpsharelib/dialog/common/DialogDefine$DialogType;)V
    .registers 7

    .prologue
    .line 59
    iget-object v0, p0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mTopAppQuery:Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;

    invoke-static {}, Lcom/cleanmaster/hpsharelib/base/Commons;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/cleanmaster/hpsharelib/base/util/system/TopAppQuery;->getTopAppPkgName(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    .line 60
    invoke-static {}, Lcom/cleanmaster/hpsharelib/base/Commons;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v1

    .line 62
    invoke-static {}, Lcom/cleanmaster/base/util/concurrent/BackgroundThread;->getHandler()Landroid/os/Handler;

    move-result-object v2

    new-instance v3, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker$1;

    invoke-direct {v3, p0, v0, v1}, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker$1;-><init>(Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v2, v3}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 96
    return-void
.end method

.method public static getIns()Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;
    .registers 2

    .prologue
    .line 29
    sget-object v0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mIns:Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    if-nez v0, :cond_13

    .line 30
    const-class v1, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    monitor-enter v1

    .line 31
    :try_start_7
    sget-object v0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mIns:Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    if-nez v0, :cond_12

    .line 32
    new-instance v0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    invoke-direct {v0}, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;-><init>()V

    sput-object v0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mIns:Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    .line 34
    :cond_12
    monitor-exit v1
    :try_end_13
    .catchall {:try_start_7 .. :try_end_13} :catchall_16

    .line 36
    :cond_13
    sget-object v0, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->mIns:Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;

    return-object v0

    .line 34
    :catchall_16
    move-exception v0

    :try_start_17
    monitor-exit v1
    :try_end_18
    .catchall {:try_start_17 .. :try_end_18} :catchall_16

    throw v0
.end method


# virtual methods
.method public checkShow(Landroid/content/ComponentName;)Z
    .registers 4

    .prologue
    .line 49
    if-eqz p1, :cond_11

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

    const/16 v1, 0x15

    if-ge v0, v1, :cond_11

    .line 52
    invoke-virtual {p1}, Landroid/content/ComponentName;->getClassName()Ljava/lang/String;

    move-result-object v0

    sget-object v1, Lcom/cleanmaster/hpsharelib/dialog/common/DialogDefine$DialogType;->ACTIVITY:Lcom/cleanmaster/hpsharelib/dialog/common/DialogDefine$DialogType;

    invoke-direct {p0, v0, v1}, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->checkInternal(Ljava/lang/String;Lcom/cleanmaster/hpsharelib/dialog/common/DialogDefine$DialogType;)V

    .line 55
    :cond_11
    const/4 v0, 0x1

    return v0
.end method

.method public checkShow(Landroid/content/Context;Lcom/cleanmaster/hpsharelib/dialog/common/DialogDefine$DialogType;)Z
    .registers 5

    .prologue
    .line 40
    if-eqz p1, :cond_13

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

    const/16 v1, 0x15

    if-ge v0, v1, :cond_13

    .line 42
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v0, p2}, Lcom/cleanmaster/hpsharelib/dialog/common/DialogChecker;->checkInternal(Ljava/lang/String;Lcom/cleanmaster/hpsharelib/dialog/common/DialogDefine$DialogType;)V

    .line 45
    :cond_13
    const/4 v0, 0x1

    return v0
.end method