e.smali

.class public Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;
.super Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController;
.source "BrightnessController.java"

# interfaces
.implements Lcom/cm/plugincluster/nagativescreen/interfaces/INotificationController;


# instance fields
.field private a:Landroid/database/ContentObserver;


# direct methods
.method public constructor <init>()V
    .registers 3

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController;-><init>()V

    .line 24
    const v0, 0x7f0a0a27

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->t:I

    .line 25
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

    iget v1, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->t:I

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

    move-result-object v0

    iput-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->n:Ljava/lang/String;

    .line 26
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->o:Z

    .line 27
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->f:Z

    .line 28
    return-void
.end method

.method private f(I)V
    .registers 4

    .prologue
    .line 79
    :try_start_0
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    const-string/jumbo v1, "screen_brightness_mode"

    invoke-static {v0, v1, p1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    :try_end_c
    .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_c} :catch_d
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_c} :catch_12

    .line 87
    :goto_c
    return-void

    .line 80
    :catch_d
    move-exception v0

    .line 81
    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(Ljava/lang/Exception;)V

    goto :goto_c

    .line 82
    :catch_12
    move-exception v0

    goto :goto_c
.end method

.method private g(I)V
    .registers 3

    .prologue
    .line 118
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->m:Landroid/graphics/drawable/Drawable;

    if-eqz v0, :cond_b

    .line 119
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->m:Landroid/graphics/drawable/Drawable;

    check-cast v0, Landroid/graphics/drawable/LevelListDrawable;

    .line 120
    invoke-virtual {v0, p1}, Landroid/graphics/drawable/LevelListDrawable;->setLevel(I)Z

    .line 122
    :cond_b
    return-void
.end method


# virtual methods
.method public a()I
    .registers 5

    .prologue
    const/4 v3, 0x1

    const/4 v2, 0x3

    .line 33
    :try_start_2
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    const-string/jumbo v1, "screen_brightness_mode"

    invoke-static {v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I

    move-result v0

    .line 34
    if-ne v0, v3, :cond_17

    .line 35
    const/4 v0, 0x0

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I
    :try_end_14
    .catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_2 .. :try_end_14} :catch_2c

    .line 51
    :goto_14
    iget v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    return v0

    .line 37
    :cond_17
    :try_start_17
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    const-string/jumbo v1, "screen_brightness"

    invoke-static {v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I

    move-result v0

    .line 38
    const/16 v1, 0x1a

    if-ge v0, v1, :cond_30

    .line 39
    const/4 v0, 0x1

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I
    :try_end_2b
    .catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_17 .. :try_end_2b} :catch_2c

    goto :goto_14

    .line 48
    :catch_2c
    move-exception v0

    .line 49
    iput v2, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    goto :goto_14

    .line 40
    :cond_30
    const/16 v1, 0x80

    if-ge v0, v1, :cond_38

    .line 41
    const/4 v0, 0x2

    :try_start_35
    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    goto :goto_14

    .line 42
    :cond_38
    const/16 v1, 0xff

    if-ge v0, v1, :cond_40

    .line 43
    const/4 v0, 0x3

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    goto :goto_14

    .line 45
    :cond_40
    const/4 v0, 0x3

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I
    :try_end_43
    .catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_35 .. :try_end_43} :catch_2c

    goto :goto_14
.end method

.method public a(I)V
    .registers 4

    .prologue
    const/4 v1, -0x1

    .line 56
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->k:Z

    .line 57
    if-lt p1, v1, :cond_24

    const/16 v0, 0xff

    if-ge p1, v0, :cond_24

    .line 58
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->u:Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$OnControlListener;

    if-eqz v0, :cond_13

    .line 59
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->u:Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$OnControlListener;

    invoke-interface {v0, p0, p1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$OnControlListener;->onValueChanged(Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController;I)V

    .line 63
    :cond_13
    if-eq p1, v1, :cond_21

    .line 64
    :try_start_15
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    const-string/jumbo v1, "screen_brightness"

    invoke-static {v0, v1, p1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 66
    :cond_21
    invoke-virtual {p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->k()V
    :try_end_24
    .catch Ljava/lang/SecurityException; {:try_start_15 .. :try_end_24} :catch_25
    .catch Ljava/lang/Exception; {:try_start_15 .. :try_end_24} :catch_2a

    .line 75
    :cond_24
    :goto_24
    return-void

    .line 67
    :catch_25
    move-exception v0

    .line 68
    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(Ljava/lang/Exception;)V

    goto :goto_24

    .line 69
    :catch_2a
    move-exception v0

    goto :goto_24
.end method

.method public a(Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$SwitchItemControllerListener;)V
    .registers 6

    .prologue
    const/4 v3, 0x0

    .line 131
    invoke-super {p0, p1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController;->a(Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$SwitchItemControllerListener;)V

    .line 132
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    if-nez v0, :cond_40

    .line 133
    new-instance v0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/f;

    new-instance v1, Landroid/os/Handler;

    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getMainLooper()Landroid/os/Looper;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    invoke-direct {v0, p0, v1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/f;-><init>(Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;Landroid/os/Handler;)V

    iput-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    .line 142
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    const-string/jumbo v1, "screen_brightness"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v2, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v3, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 143
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    const-string/jumbo v1, "screen_brightness_mode"

    .line 144
    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v2, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v3, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 146
    :cond_40
    return-void
.end method

.method public b(I)Ljava/lang/String;
    .registers 3

    .prologue
    .line 213
    const-string v0, ""

    .line 214
    packed-switch p1, :pswitch_data_14

    .line 220
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->l:Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;

    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;->getBlueColor()Ljava/lang/String;

    move-result-object v0

    .line 223
    :goto_b
    return-object v0

    .line 216
    :pswitch_c
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->l:Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;

    invoke-virtual {v0}, Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;->getWhiteColor()Ljava/lang/String;

    move-result-object v0

    goto :goto_b

    .line 214
    nop

    :pswitch_data_14
    .packed-switch 0x1
        :pswitch_c
    .end packed-switch
.end method

.method public b()V
    .registers 2

    .prologue
    .line 126
    const-string v0, "android.settings.DISPLAY_SETTINGS"

    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(Ljava/lang/String;)Z

    .line 127
    return-void
.end method

.method public b(Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$SwitchItemControllerListener;)V
    .registers 4

    .prologue
    .line 150
    invoke-super {p0, p1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController;->b(Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController$SwitchItemControllerListener;)V

    .line 151
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    if-eqz v0, :cond_15

    .line 152
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

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

    move-result-object v0

    iget-object v1, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1}, Landroid/content/ContentResolver;->unregisterContentObserver(Landroid/database/ContentObserver;)V

    .line 153
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a:Landroid/database/ContentObserver;

    .line 155
    :cond_15
    return-void
.end method

.method public c()I
    .registers 2

    .prologue
    .line 183
    const/4 v0, 0x1

    return v0
.end method

.method public d()Ljava/lang/String;
    .registers 3

    .prologue
    .line 193
    const-string v0, ""

    .line 194
    invoke-virtual {p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a()I

    move-result v1

    packed-switch v1, :pswitch_data_1e

    .line 208
    :goto_9
    return-object v0

    .line 196
    :pswitch_a
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->l:Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;

    iget-object v0, v0, Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;->AutoBrightness:Ljava/lang/String;

    goto :goto_9

    .line 199
    :pswitch_f
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->l:Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;

    iget-object v0, v0, Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;->brightness:Ljava/lang/String;

    goto :goto_9

    .line 202
    :pswitch_14
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->l:Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;

    iget-object v0, v0, Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;->halfBrightness:Ljava/lang/String;

    goto :goto_9

    .line 205
    :pswitch_19
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->l:Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;

    iget-object v0, v0, Lcom/cleanmaster/hpsharelib/base/imagefont/FontImageType;->allBrightness:Ljava/lang/String;

    goto :goto_9

    .line 194
    :pswitch_data_1e
    .packed-switch 0x0
        :pswitch_a
        :pswitch_f
        :pswitch_14
        :pswitch_19
    .end packed-switch
.end method

.method public f()Ljava/lang/String;
    .registers 6

    .prologue
    .line 160
    iget v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    packed-switch v0, :pswitch_data_2a

    .line 174
    const-string v0, ""

    .line 177
    :goto_7
    iget-object v1, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

    const v2, 0x7f0a0a22

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object v0, v3, v4

    invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    .line 178
    return-object v0

    .line 162
    :pswitch_17
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->c:Landroid/content/Context;

    const v1, 0x7f0a0a21

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

    move-result-object v0

    goto :goto_7

    .line 165
    :pswitch_21
    const-string v0, "10%"

    goto :goto_7

    .line 168
    :pswitch_24
    const-string v0, "50%"

    goto :goto_7

    .line 171
    :pswitch_27
    const-string v0, "100%"

    goto :goto_7

    .line 160
    :pswitch_data_2a
    .packed-switch 0x0
        :pswitch_17
        :pswitch_21
        :pswitch_24
        :pswitch_27
    .end packed-switch
.end method

.method public getNotificationResId(I)I
    .registers 3

    .prologue
    .line 188
    iget v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->s:I

    return v0
.end method

.method public onClick()V
    .registers 2

    .prologue
    .line 92
    :try_start_0
    invoke-virtual {p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a()I

    move-result v0

    packed-switch v0, :pswitch_data_3a

    .line 112
    :goto_7
    iget v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    invoke-direct {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->g(I)V

    .line 115
    :goto_c
    return-void

    .line 94
    :pswitch_d
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->f(I)V

    .line 95
    const/4 v0, 0x1

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    .line 96
    const/16 v0, 0x19

    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(I)V

    goto :goto_7

    .line 113
    :catch_1a
    move-exception v0

    goto :goto_c

    .line 99
    :pswitch_1c
    const/4 v0, 0x2

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    .line 100
    const/16 v0, 0x7f

    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(I)V

    goto :goto_7

    .line 103
    :pswitch_25
    const/4 v0, 0x3

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    .line 104
    const/16 v0, 0xfe

    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(I)V

    goto :goto_7

    .line 107
    :pswitch_2e
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->f(I)V

    .line 108
    const/4 v0, 0x0

    iput v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->q:I

    .line 109
    const/4 v0, -0x1

    invoke-virtual {p0, v0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/e;->a(I)V
    :try_end_39
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_39} :catch_1a

    goto :goto_7

    .line 92
    :pswitch_data_3a
    .packed-switch 0x0
        :pswitch_d
        :pswitch_1c
        :pswitch_25
        :pswitch_2e
    .end packed-switch
.end method