.class public Lcom/moji/appwidget/core/MJWidgetManager;
.super Ljava/lang/Object;
.source "MJWidgetManager.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/appwidget/core/MJWidgetManager$SingleHolder;
    }
.end annotation


# static fields
.field public static final a:[Ljava/lang/String;

.field public static final b:[Ljava/lang/String;


# instance fields
.field private c:Lcom/moji/appwidget/core/AWUpdateStrategy;


# direct methods
.method static constructor <clinit>()V
    .locals 4

    const/4 v0, 0x1

    .line 28
    new-array v1, v0, [Ljava/lang/String;

    const-string v2, "android.permission.WRITE_EXTERNAL_STORAGE"

    const/4 v3, 0x0

    aput-object v2, v1, v3

    sput-object v1, Lcom/moji/appwidget/core/MJWidgetManager;->a:[Ljava/lang/String;

    const/4 v1, 0x2

    .line 31
    new-array v1, v1, [Ljava/lang/String;

    const-string v2, "android.permission.ACCESS_FINE_LOCATION"

    aput-object v2, v1, v3

    const-string v2, "android.permission.ACCESS_COARSE_LOCATION"

    aput-object v2, v1, v0

    sput-object v1, Lcom/moji/appwidget/core/MJWidgetManager;->b:[Ljava/lang/String;

    return-void
.end method

.method private constructor <init>()V
    .locals 3

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

    .line 38
    invoke-virtual {p0}, Lcom/moji/appwidget/core/MJWidgetManager;->b()V

    .line 39
    invoke-static {}, Lcom/moji/appwidget/core/MJAppWidgetProvider;->a()[Lcom/moji/appwidget/core/EWidgetSize;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 40
    array-length v1, v0

    if-lez v1, :cond_0

    .line 41
    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

    sget-object v2, Lcom/moji/appwidget/core/ELayer;->CONFIG:Lcom/moji/appwidget/core/ELayer;

    invoke-virtual {p0, v1, v2, v0}, Lcom/moji/appwidget/core/MJWidgetManager;->a(Landroid/content/Context;Lcom/moji/appwidget/core/ELayer;[Lcom/moji/appwidget/core/EWidgetSize;)V

    :cond_0
    return-void
.end method

.method synthetic constructor <init>(Lcom/moji/appwidget/core/MJWidgetManager$1;)V
    .locals 0

    .line 27
    invoke-direct {p0}, Lcom/moji/appwidget/core/MJWidgetManager;-><init>()V

    return-void
.end method

.method public static declared-synchronized a()Lcom/moji/appwidget/core/MJWidgetManager;
    .locals 2

    const-class v0, Lcom/moji/appwidget/core/MJWidgetManager;

    monitor-enter v0

    .line 51
    :try_start_0
    invoke-static {}, Lcom/moji/appwidget/core/MJWidgetManager$SingleHolder;->a()Lcom/moji/appwidget/core/MJWidgetManager;

    move-result-object v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return-object v1

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method


# virtual methods
.method public varargs a(Landroid/content/Context;Lcom/moji/appwidget/core/ELayer;[Lcom/moji/appwidget/core/EWidgetSize;)V
    .locals 6

    const/4 v2, 0x0

    const/4 v4, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v3, p2

    move-object v5, p3

    .line 100
    invoke-virtual/range {v0 .. v5}, Lcom/moji/appwidget/core/MJWidgetManager;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/appwidget/core/ELayer;Lcom/moji/appwidget/activity/WidgetConfigListener;[Lcom/moji/appwidget/core/EWidgetSize;)V

    return-void
.end method

.method public varargs a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/appwidget/activity/WidgetConfigListener;[Lcom/moji/appwidget/core/EWidgetSize;)V
    .locals 7

    if-eqz p3, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    .line 95
    :goto_0
    invoke-virtual {p0, p2, v0}, Lcom/moji/appwidget/core/MJWidgetManager;->a(Ljava/lang/String;Z)V

    .line 96
    sget-object v4, Lcom/moji/appwidget/core/ELayer;->CONFIG:Lcom/moji/appwidget/core/ELayer;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move-object v5, p3

    move-object v6, p4

    invoke-virtual/range {v1 .. v6}, Lcom/moji/appwidget/core/MJWidgetManager;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/appwidget/core/ELayer;Lcom/moji/appwidget/activity/WidgetConfigListener;[Lcom/moji/appwidget/core/EWidgetSize;)V

    return-void
.end method

.method public varargs a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/appwidget/core/ELayer;Lcom/moji/appwidget/activity/WidgetConfigListener;[Lcom/moji/appwidget/core/EWidgetSize;)V
    .locals 9

    .line 104
    sget-object v0, Lcom/moji/appwidget/core/MJWidgetManager;->a:[Ljava/lang/String;

    invoke-static {p1, v0}, Lcom/moji/tool/permission/EasyPermissions;->a(Landroid/content/Context;[Ljava/lang/String;)Z

    move-result v3

    .line 105
    new-instance v0, Lcom/moji/appwidget/core/AWUpdateRunnable;

    iget-object v6, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    move-object v1, v0

    move-object v2, p1

    move-object v4, p2

    move-object v5, p3

    move-object v7, p4

    move-object v8, p5

    invoke-direct/range {v1 .. v8}, Lcom/moji/appwidget/core/AWUpdateRunnable;-><init>(Landroid/content/Context;ZLjava/lang/String;Lcom/moji/appwidget/core/ELayer;Lcom/moji/appwidget/core/AWUpdateStrategy;Lcom/moji/appwidget/activity/WidgetConfigListener;[Lcom/moji/appwidget/core/EWidgetSize;)V

    sget-object p1, Lcom/moji/tool/thread/ThreadType;->NORMAL_THREAD:Lcom/moji/tool/thread/ThreadType;

    sget-object p2, Lcom/moji/tool/thread/ThreadPriority;->NORMAL:Lcom/moji/tool/thread/ThreadPriority;

    invoke-static {v0, p1, p2}, Lcom/moji/tool/thread/MJPools;->a(Ljava/lang/Runnable;Lcom/moji/tool/thread/ThreadType;Lcom/moji/tool/thread/ThreadPriority;)I

    return-void
.end method

.method public varargs a(Landroid/content/Context;[Lcom/moji/appwidget/core/EWidgetSize;)V
    .locals 2

    .line 89
    new-instance v0, Lcom/moji/appwidget/SettingRepeater;

    invoke-direct {v0}, Lcom/moji/appwidget/SettingRepeater;-><init>()V

    .line 90
    invoke-virtual {v0}, Lcom/moji/appwidget/SettingRepeater;->a()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    .line 91
    invoke-virtual {p0, p1, v0, v1, p2}, Lcom/moji/appwidget/core/MJWidgetManager;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/appwidget/activity/WidgetConfigListener;[Lcom/moji/appwidget/core/EWidgetSize;)V

    return-void
.end method

.method public a(Ljava/lang/String;Z)V
    .locals 1

    if-eqz p2, :cond_0

    .line 65
    new-instance p1, Lcom/moji/appwidget/image/FakeImageUpdateStrategy;

    invoke-direct {p1}, Lcom/moji/appwidget/image/FakeImageUpdateStrategy;-><init>()V

    iput-object p1, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    return-void

    :cond_0
    const-string p2, "org"

    .line 68
    invoke-virtual {p1, p2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p2

    if-nez p2, :cond_2

    const-string p2, "ORG"

    invoke-virtual {p1, p2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p2

    if-eqz p2, :cond_1

    goto :goto_0

    .line 81
    :cond_1
    new-instance p1, Lcom/moji/appwidget/image/CImageUpdateStrategy;

    invoke-direct {p1}, Lcom/moji/appwidget/image/CImageUpdateStrategy;-><init>()V

    iput-object p1, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    goto :goto_1

    .line 69
    :cond_2
    :goto_0
    sget p2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v0, 0x11

    if-ge p2, v0, :cond_3

    .line 70
    new-instance p1, Lcom/moji/appwidget/image/DImageUpdateStrategy;

    invoke-direct {p1}, Lcom/moji/appwidget/image/DImageUpdateStrategy;-><init>()V

    iput-object p1, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    goto :goto_1

    :cond_3
    const-string p2, "org"

    .line 72
    invoke-virtual {p2, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result p2

    if-eqz p2, :cond_4

    .line 73
    new-instance p1, Lcom/moji/appwidget/original/ViewUpdateStrategy;

    invoke-direct {p1}, Lcom/moji/appwidget/original/ViewUpdateStrategy;-><init>()V

    iput-object p1, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    goto :goto_1

    :cond_4
    const-string p2, "org_white"

    .line 74
    invoke-virtual {p2, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result p2

    if-eqz p2, :cond_5

    .line 75
    new-instance p1, Lcom/moji/appwidget/original/WhiteViewUpdateStrategy;

    invoke-direct {p1}, Lcom/moji/appwidget/original/WhiteViewUpdateStrategy;-><init>()V

    iput-object p1, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    goto :goto_1

    :cond_5
    const-string p2, "org_black"

    .line 76
    invoke-virtual {p2, p1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result p1

    if-eqz p1, :cond_6

    .line 77
    new-instance p1, Lcom/moji/appwidget/original/BlackViewUpdateStrategy;

    invoke-direct {p1}, Lcom/moji/appwidget/original/BlackViewUpdateStrategy;-><init>()V

    iput-object p1, p0, Lcom/moji/appwidget/core/MJWidgetManager;->c:Lcom/moji/appwidget/core/AWUpdateStrategy;

    :cond_6
    :goto_1
    return-void
.end method

.method public b()V
    .locals 2

    .line 58
    new-instance v0, Lcom/moji/appwidget/SettingRepeater;

    invoke-direct {v0}, Lcom/moji/appwidget/SettingRepeater;-><init>()V

    .line 59
    invoke-virtual {v0}, Lcom/moji/appwidget/SettingRepeater;->a()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    .line 60
    invoke-virtual {p0, v0, v1}, Lcom/moji/appwidget/core/MJWidgetManager;->a(Ljava/lang/String;Z)V

    return-void
.end method
