a.smali

.class public Lcom/cleanmaster/ui/app/b/a;
.super Ljava/lang/Object;
.source "RedPacketNotificationHelper.java"


# static fields
.field private static final a:I


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

    .prologue
    .line 26
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    long-to-int v0, v0

    sput v0, Lcom/cleanmaster/ui/app/b/a;->a:I

    return-void
.end method

.method public static a()V
    .registers 7

    .prologue
    const/16 v6, 0x28

    const/16 v5, 0x15

    .line 29
    invoke-static {}, Lcom/keniu/security/l;->d()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    .line 30
    const-string v0, "notification"

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

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    .line 31
    new-instance v2, Landroid/support/v4/app/NotificationCompat$Builder;

    const-string v3, "common"

    invoke-direct {v2, v1, v3}, Landroid/support/v4/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 32
    invoke-static {}, Lcom/keniu/security/l;->f()Landroid/app/Application;

    move-result-object v3

    invoke-virtual {v3}, Landroid/app/Application;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object v3

    iget v3, v3, Landroid/content/pm/ApplicationInfo;->targetSdkVersion:I

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

    .line 34
    if-lt v3, v5, :cond_53

    if-lt v4, v5, :cond_53

    .line 36
    const v3, 0x7f02015f

    invoke-virtual {v2, v3}, Landroid/support/v4/app/NotificationCompat$Builder;->setSmallIcon(I)Landroid/support/v4/app/NotificationCompat$Builder;

    .line 41
    :goto_31
    new-instance v3, Lcom/cm/plugincluster/common/notification/define/NotificationSetting;

    invoke-direct {v3}, Lcom/cm/plugincluster/common/notification/define/NotificationSetting;-><init>()V

    .line 42
    const/4 v4, 0x1

    iput-boolean v4, v3, Lcom/cm/plugincluster/common/notification/define/NotificationSetting;->mIsNeedShowInForground:Z

    .line 43
    iput v6, v3, Lcom/cm/plugincluster/common/notification/define/NotificationSetting;->mUniqueId:I

    .line 45
    new-instance v4, Lcom/cm/plugincluster/common/notification/define/NotificationModel;

    invoke-direct {v4}, Lcom/cm/plugincluster/common/notification/define/NotificationModel;-><init>()V

    .line 46
    invoke-static {}, Lcom/cleanmaster/s/b/a;->a()Lcom/cm/plugincluster/redpacket/interfaces/IRedPacketPluginModule;

    move-result-object v5

    invoke-interface {v5}, Lcom/cm/plugincluster/redpacket/interfaces/IRedPacketPluginModule;->getRedPacketNotificationTitle()Ljava/lang/String;

    move-result-object v5

    iput-object v5, v4, Lcom/cm/plugincluster/common/notification/define/NotificationModel;->mTitle:Ljava/lang/CharSequence;

    .line 47
    iget-object v5, v4, Lcom/cm/plugincluster/common/notification/define/NotificationModel;->mTitle:Ljava/lang/CharSequence;

    invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_5a

    .line 72
    :cond_52
    :goto_52
    return-void

    .line 38
    :cond_53
    const v3, 0x7f0203da

    invoke-virtual {v2, v3}, Landroid/support/v4/app/NotificationCompat$Builder;->setSmallIcon(I)Landroid/support/v4/app/NotificationCompat$Builder;

    goto :goto_31

    .line 50
    :cond_5a
    invoke-static {}, Lcom/cleanmaster/s/b/a;->a()Lcom/cm/plugincluster/redpacket/interfaces/IRedPacketPluginModule;

    move-result-object v5

    invoke-interface {v5}, Lcom/cm/plugincluster/redpacket/interfaces/IRedPacketPluginModule;->getRedPacketNotificationHint()Ljava/lang/String;

    move-result-object v5

    iput-object v5, v4, Lcom/cm/plugincluster/common/notification/define/NotificationModel;->mContent:Ljava/lang/CharSequence;

    .line 51
    iget-object v5, v4, Lcom/cm/plugincluster/common/notification/define/NotificationModel;->mContent:Ljava/lang/CharSequence;

    invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v5

    if-nez v5, :cond_52

    .line 54
    const v5, 0x7f020163

    iput v5, v4, Lcom/cm/plugincluster/common/notification/define/NotificationModel;->mLeftIconRes:I

    .line 56
    invoke-virtual {v2}, Landroid/support/v4/app/NotificationCompat$Builder;->build()Landroid/app/Notification;

    move-result-object v2

    .line 57
    invoke-static {}, Lcom/cleanmaster/notification/af;->a()Lcom/cleanmaster/notification/af;

    move-result-object v5

    invoke-virtual {v5, v3, v4}, Lcom/cleanmaster/notification/af;->b(Lcom/cm/plugincluster/common/notification/define/NotificationSetting;Lcom/cm/plugincluster/common/notification/define/NotificationModel;)Landroid/widget/RemoteViews;

    move-result-object v3

    iput-object v3, v2, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;

    .line 58
    sget-object v3, Landroid/os/Build;->MODEL:Ljava/lang/String;

    const-string/jumbo v4, "vivo X9Plus"

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

    move-result v3

    if-nez v3, :cond_90

    .line 59
    iget v3, v2, Landroid/app/Notification;->flags:I

    or-int/lit8 v3, v3, 0x2

    iput v3, v2, Landroid/app/Notification;->flags:I

    .line 61
    :cond_90
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    iput-wide v4, v2, Landroid/app/Notification;->when:J

    .line 63
    invoke-static {}, Lcom/cleanmaster/s/b/a;->a()Lcom/cm/plugincluster/redpacket/interfaces/IRedPacketPluginModule;

    move-result-object v3

    invoke-interface {v3}, Lcom/cm/plugincluster/redpacket/interfaces/IRedPacketPluginModule;->getRedPacketSettingActivityIntent()Landroid/content/Intent;

    move-result-object v3

    .line 64
    if-eqz v3, :cond_52

    .line 68
    sget v4, Lcom/cleanmaster/ui/app/b/a;->a:I

    const/high16 v5, 0x8000000

    invoke-static {v1, v4, v3, v5}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v1

    .line 70
    iput-object v1, v2, Landroid/app/Notification;->contentIntent:Landroid/app/PendingIntent;

    .line 71
    invoke-virtual {v0, v6, v2}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    goto :goto_52
.end method

.method public static b()V
    .registers 2

    .prologue
    .line 75
    invoke-static {}, Lcom/keniu/security/l;->d()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 76
    const-string v1, "notification"

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

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    .line 78
    const/16 v1, 0x28

    invoke-virtual {v0, v1}, Landroid/app/NotificationManager;->cancel(I)V

    .line 79
    return-void
.end method