x.smali

.class public Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;
.super Lcom/cleanmaster/ui/floatwindow/switchcontrol/SwitchItemController;
.source "FlightModeController.java"

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


# static fields
.field private static a:Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;


# instance fields
.field private b:Landroid/content/ContentResolver;

.field private w:Lcom/cleanmaster/hpcommonlib/utils/CMBaseReceiver;


# direct methods
.method protected constructor <init>(Landroid/content/Context;)V
    .registers 4

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

    .line 127
    new-instance v0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/y;

    invoke-direct {v0, p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/y;-><init>(Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;)V

    iput-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->w:Lcom/cleanmaster/hpcommonlib/utils/CMBaseReceiver;

    .line 34
    const v0, 0x7f0a0a25

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

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

    iget v1, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->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/x;->n:Ljava/lang/String;

    .line 36
    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iput-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->b:Landroid/content/ContentResolver;

    .line 37
    const/4 v0, 0x1

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

    .line 38
    return-void
.end method

.method public static declared-synchronized a(Landroid/content/Context;)Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;
    .registers 3

    .prologue
    .line 27
    const-class v1, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;

    monitor-enter v1

    :try_start_3
    sget-object v0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->a:Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;

    if-nez v0, :cond_e

    .line 28
    new-instance v0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;

    invoke-direct {v0, p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->a:Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;

    .line 30
    :cond_e
    sget-object v0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->a:Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;
    :try_end_10
    .catchall {:try_start_3 .. :try_end_10} :catchall_12

    monitor-exit v1

    return-object v0

    .line 27
    :catchall_12
    move-exception v0

    monitor-exit v1

    throw v0
.end method


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

    .prologue
    const/4 v1, 0x0

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

    const/16 v2, 0x11

    if-lt v0, v2, :cond_4e

    .line 44
    const-class v0, Landroid/provider/Settings;

    invoke-virtual {v0}, Ljava/lang/Class;->getDeclaredClasses()[Ljava/lang/Class;

    move-result-object v2

    .line 45
    array-length v3, v2

    move v0, v1

    :goto_f
    if-ge v0, v3, :cond_57

    aget-object v4, v2, v0

    .line 46
    invoke-virtual {v4}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v5

    const-string v6, "Global"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_4b

    .line 47
    const-string v0, "getInt"

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/Class;

    const/4 v3, 0x0

    const-class v5, Landroid/content/ContentResolver;

    aput-object v5, v2, v3

    const/4 v3, 0x1

    const-class v5, Ljava/lang/String;

    aput-object v5, v2, v3

    invoke-virtual {v4, v0, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v0

    .line 49
    const/4 v2, 0x0

    const/4 v3, 0x2

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

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->b:Landroid/content/ContentResolver;

    aput-object v5, v3, v4

    const/4 v4, 0x1

    const-string v5, "airplane_mode_on"

    aput-object v5, v3, v4

    invoke-virtual {v0, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    .line 51
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    .line 62
    :goto_4a
    return v0

    .line 45
    :cond_4b
    add-int/lit8 v0, v0, 0x1

    goto :goto_f

    .line 55
    :cond_4e
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->b:Landroid/content/ContentResolver;

    const-string v2, "airplane_mode_on"

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

    move-result v0

    goto :goto_4a

    .line 59
    :cond_57
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->b:Landroid/content/ContentResolver;

    const-string v2, "airplane_mode_on"

    invoke-static {v0, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I
    :try_end_5e
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_5e} :catch_60

    move-result v0

    goto :goto_4a

    .line 61
    :catch_60
    move-exception v0

    move v0, v1

    .line 62
    goto :goto_4a
.end method

.method public a(I)V
    .registers 2

    .prologue
    .line 69
    return-void
.end method

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

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

    .line 112
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    .line 113
    const-string v1, "android.intent.action.AIRPLANE_MODE"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

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

    invoke-static {v1}, Lcom/cleanmaster/hpcommonlib/utils/CmBroadcastManager;->getInstance(Landroid/content/Context;)Lcom/cleanmaster/hpcommonlib/utils/CmBroadcastManager;

    move-result-object v1

    iget-object v2, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->w:Lcom/cleanmaster/hpcommonlib/utils/CMBaseReceiver;

    invoke-virtual {v1, v2, v0}, Lcom/cleanmaster/hpcommonlib/utils/CmBroadcastManager;->registerReceiver(Lcom/cleanmaster/hpcommonlib/utils/CMBaseReceiver;Landroid/content/IntentFilter;)V

    .line 115
    return-void
.end method

.method public b(Landroid/content/Context;)Landroid/content/Intent;
    .registers 5

    .prologue
    .line 72
    const-string v0, "com.android.settings"

    const-string v1, "com.android.settings.WirelessSettings"

    invoke-virtual {p0, v0, v1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->a(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v0

    .line 74
    const/high16 v1, 0x14000000

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 76
    invoke-static {p1, v0}, Lcom/cleanmaster/base/a;->d(Landroid/content/Context;Landroid/content/Intent;)Z

    move-result v1

    if-nez v1, :cond_1a

    .line 77
    const-string v1, "com.android.settings"

    const-string v2, "com.android.settings.Settings$WirelessSettingsActivity"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 80
    :cond_1a
    return-object v0
.end method

.method public b()V
    .registers 2

    .prologue
    .line 106
    const-string v0, "android.settings.AIRPLANE_MODE_SETTINGS"

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

    .line 107
    return-void
.end method

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

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

    .line 120
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->d:Ljava/util/List;

    if-eqz v0, :cond_f

    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-nez v0, :cond_16

    .line 122
    :cond_f
    :try_start_f
    iget-object v0, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->c:Landroid/content/Context;

    iget-object v1, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->w:Lcom/cleanmaster/hpcommonlib/utils/CMBaseReceiver;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V
    :try_end_16
    .catch Ljava/lang/Exception; {:try_start_f .. :try_end_16} :catch_17

    .line 125
    :cond_16
    :goto_16
    return-void

    .line 123
    :catch_17
    move-exception v0

    goto :goto_16
.end method

.method public c()I
    .registers 2

    .prologue
    .line 136
    const/16 v0, 0xe

    return v0
.end method

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

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

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

    return-object v0
.end method

.method public getNotificationResId(I)I
    .registers 3

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

    return v0
.end method

.method public onClick()V
    .registers 5

    .prologue
    const/4 v0, 0x1

    .line 86
    :try_start_1
    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x11

    if-lt v1, v2, :cond_1b

    .line 87
    const-string v0, "android.settings.AIRPLANE_MODE_SETTINGS"

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

    move-result v0

    if-nez v0, :cond_1a

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

    iget-object v1, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->c:Landroid/content/Context;

    invoke-virtual {p0, v1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->b(Landroid/content/Context;)Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    .line 102
    :cond_1a
    :goto_1a
    return-void

    .line 91
    :cond_1b
    invoke-virtual {p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->a()I

    move-result v1

    invoke-virtual {p0, v1}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->d(I)I

    move-result v1

    .line 92
    iget-object v2, p0, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->c:Landroid/content/Context;

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

    move-result-object v2

    const-string v3, "airplane_mode_on"

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

    .line 94
    new-instance v2, Landroid/content/Intent;

    const-string v3, "android.intent.action.AIRPLANE_MODE"

    invoke-direct {v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 95
    const-string/jumbo v3, "state"

    if-ne v1, v0, :cond_4d

    :goto_3a
    invoke-virtual {v2, v3, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

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

    invoke-virtual {v0, v2}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

    .line 97
    invoke-virtual {p0}, Lcom/cleanmaster/ui/floatwindow/switchcontrol/x;->k()V
    :try_end_45
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_45} :catch_46

    goto :goto_1a

    .line 99
    :catch_46
    move-exception v0

    .line 100
    const-string v0, "android.settings.AIRPLANE_MODE_SETTINGS"

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

    goto :goto_1a

    .line 95
    :cond_4d
    const/4 v0, 0x0

    goto :goto_3a
.end method