973 lines
24 KiB
Smali
973 lines
24 KiB
Smali
.class public Lcom/moji/weatherprovider/update/AutoUpdateManager;
|
|
.super Ljava/lang/Object;
|
|
.source "AutoUpdateManager.java"
|
|
|
|
|
|
# static fields
|
|
.field private static a:Ljava/lang/String; = "AutoUpdateManager"
|
|
|
|
.field private static b:J = 0x5265c00L
|
|
|
|
.field private static c:J = 0xea60L
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 24
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static a(Ljava/util/Date;)J
|
|
.locals 3
|
|
|
|
.line 222
|
|
invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x6
|
|
|
|
.line 223
|
|
invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I
|
|
|
|
move-result v2
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->set(II)V
|
|
|
|
.line 224
|
|
invoke-virtual {p0}, Ljava/util/Date;->getHours()I
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0xb
|
|
|
|
invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
|
|
|
|
.line 225
|
|
invoke-virtual {p0}, Ljava/util/Date;->getMinutes()I
|
|
|
|
move-result p0
|
|
|
|
const/16 v1, 0xc
|
|
|
|
invoke-virtual {v0, v1, p0}, Ljava/util/Calendar;->set(II)V
|
|
|
|
const/16 p0, 0xd
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 226
|
|
invoke-virtual {v0, p0, v1}, Ljava/util/Calendar;->set(II)V
|
|
|
|
.line 227
|
|
invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
|
|
|
|
move-result-wide v0
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method private static a(Ljava/util/Date;JJ)J
|
|
.locals 4
|
|
|
|
.line 162
|
|
sget-object v0, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v1, "start before end and in update time, use last weather update time"
|
|
|
|
invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 163
|
|
new-instance v0, Lcom/moji/preferences/ProcessPrefer;
|
|
|
|
invoke-direct {v0}, Lcom/moji/preferences/ProcessPrefer;-><init>()V
|
|
|
|
.line 164
|
|
invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->a()Lcom/moji/common/area/AreaInfo;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 166
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->b()Lcom/moji/weatherprovider/provider/WeatherProvider;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, v1}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a(Lcom/moji/common/area/AreaInfo;)Lcom/moji/weatherprovider/data/Weather;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 168
|
|
iget-wide p3, v1, Lcom/moji/weatherprovider/data/Weather;->mUpdatetime:J
|
|
|
|
add-long/2addr p3, p1
|
|
|
|
.line 169
|
|
invoke-virtual {p0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v1
|
|
|
|
cmp-long v3, p3, v1
|
|
|
|
if-gez v3, :cond_0
|
|
|
|
.line 170
|
|
sget-wide p3, Lcom/moji/weatherprovider/update/AutoUpdateManager;->c:J
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/ProcessPrefer;->y()I
|
|
|
|
move-result v0
|
|
|
|
mul-int/lit8 v0, v0, 0xf
|
|
|
|
int-to-long v0, v0
|
|
|
|
sget-wide v2, Lcom/moji/weatherprovider/update/AutoUpdateManager;->c:J
|
|
|
|
mul-long v0, v0, v2
|
|
|
|
add-long/2addr p3, v0
|
|
|
|
.line 171
|
|
invoke-static {p3, p4, p1, p2}, Ljava/lang/Math;->min(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
.line 172
|
|
invoke-virtual {p0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide p3
|
|
|
|
add-long/2addr p3, p1
|
|
|
|
.line 173
|
|
sget-object p0, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "weather update time too long, update "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "ms later"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p0, p1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-wide p3
|
|
.end method
|
|
|
|
.method public static a(Ljava/lang/String;)Ljava/util/Date;
|
|
.locals 4
|
|
|
|
.line 189
|
|
invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
.line 190
|
|
invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
.line 191
|
|
invoke-virtual {v0, v3}, Ljava/util/Calendar;->get(I)I
|
|
|
|
move-result v3
|
|
|
|
add-int/2addr v3, v1
|
|
|
|
const/4 v1, 0x5
|
|
|
|
.line 192
|
|
invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I
|
|
|
|
move-result v0
|
|
|
|
.line 193
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "-"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "-"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, " "
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/String;->trim()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, ":"
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
new-instance p0, Ljava/util/Random;
|
|
|
|
invoke-direct {p0}, Ljava/util/Random;-><init>()V
|
|
|
|
const/16 v0, 0x3c
|
|
|
|
invoke-virtual {p0, v0}, Ljava/util/Random;->nextInt(I)I
|
|
|
|
move-result p0
|
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 196
|
|
:try_start_0
|
|
new-instance v0, Ljava/text/SimpleDateFormat;
|
|
|
|
const-string v1, "yyyy-MM-dd HH:mm:ss"
|
|
|
|
invoke-direct {v0, v1}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 197
|
|
invoke-virtual {v0, p0}, Ljava/text/SimpleDateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 199
|
|
sget-object v0, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
invoke-static {v0, p0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static a()V
|
|
.locals 2
|
|
|
|
.line 98
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/SettingPrefer;->g()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 99
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/SettingPrefer;->h()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 100
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/moji/preferences/SettingPrefer;->j()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 101
|
|
invoke-static {v0, v1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->b(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(F)V
|
|
.locals 1
|
|
|
|
.line 86
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/moji/preferences/SettingPrefer;->a(F)V
|
|
|
|
.line 87
|
|
invoke-static {}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(II)V
|
|
.locals 1
|
|
|
|
.line 36
|
|
invoke-static {p0, p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->c(II)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 37
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/moji/preferences/SettingPrefer;->j()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 38
|
|
invoke-virtual {p0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 40
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/moji/preferences/SettingPrefer;->a(Ljava/lang/String;)V
|
|
|
|
.line 41
|
|
invoke-static {p0, p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 39
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "start time is equal to the end time!"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static a(J)V
|
|
.locals 5
|
|
|
|
.line 205
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 206
|
|
sget-object p0, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string p1, "set next alarm but context null"
|
|
|
|
invoke-static {p0, p1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 210
|
|
:cond_0
|
|
:try_start_0
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
new-instance v2, Landroid/content/Intent;
|
|
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v3
|
|
|
|
const-class v4, Lcom/moji/weatherprovider/Service/WeatherUpdateService;
|
|
|
|
invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const/high16 v3, 0x8000000
|
|
|
|
invoke-static {v0, v1, v2, v3}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object v0
|
|
|
|
.line 214
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lcom/moji/alarm/MJAlarmManager$TriggerType;->TRIGGER_TYPE_CURRENT_TIME_MILLIS:Lcom/moji/alarm/MJAlarmManager$TriggerType;
|
|
|
|
invoke-static {v1, v2, p0, p1, v0}, Lcom/moji/alarm/MJAlarmManager;->a(Landroid/content/Context;Lcom/moji/alarm/MJAlarmManager$TriggerType;JLandroid/app/PendingIntent;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 217
|
|
sget-object p1, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
invoke-static {p1, p0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private static a(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
.line 63
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/SettingPrefer;->g()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 64
|
|
invoke-static {p0, p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->b(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Z)V
|
|
.locals 1
|
|
|
|
.line 73
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0}, Lcom/moji/preferences/SettingPrefer;->a(Z)V
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
.line 75
|
|
invoke-static {}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a()V
|
|
|
|
goto :goto_0
|
|
|
|
.line 77
|
|
:cond_0
|
|
invoke-static {}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->c()V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static b()V
|
|
.locals 2
|
|
|
|
.line 106
|
|
new-instance v0, Lcom/moji/preferences/ProcessPrefer;
|
|
|
|
invoke-direct {v0}, Lcom/moji/preferences/ProcessPrefer;-><init>()V
|
|
|
|
.line 107
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/moji/preferences/SettingPrefer;->h()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/preferences/ProcessPrefer;->r(Ljava/lang/String;)V
|
|
|
|
.line 108
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/moji/preferences/SettingPrefer;->j()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/preferences/ProcessPrefer;->s(Ljava/lang/String;)V
|
|
|
|
.line 109
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/moji/preferences/SettingPrefer;->k()F
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/preferences/ProcessPrefer;->a(F)V
|
|
|
|
.line 110
|
|
invoke-static {}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static b(II)V
|
|
.locals 1
|
|
|
|
.line 51
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/preferences/SettingPrefer;->h()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 52
|
|
invoke-static {p0, p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->c(II)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 53
|
|
invoke-virtual {v0, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
.line 55
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, p0}, Lcom/moji/preferences/SettingPrefer;->b(Ljava/lang/String;)V
|
|
|
|
.line 56
|
|
invoke-static {v0, p0}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 54
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "start time is equal to the end time!"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static b(Ljava/lang/String;Ljava/lang/String;)V
|
|
.locals 10
|
|
|
|
.line 114
|
|
new-instance v0, Ljava/util/Date;
|
|
|
|
invoke-direct {v0}, Ljava/util/Date;-><init>()V
|
|
|
|
.line 115
|
|
invoke-static {p0}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object p0
|
|
|
|
.line 116
|
|
invoke-static {p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object p1
|
|
|
|
.line 117
|
|
invoke-static {}, Lcom/moji/preferences/SettingPrefer;->c()Lcom/moji/preferences/SettingPrefer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/moji/preferences/SettingPrefer;->k()F
|
|
|
|
move-result v1
|
|
|
|
const/high16 v2, 0x45610000 # 3600.0f
|
|
|
|
mul-float v1, v1, v2
|
|
|
|
const/high16 v2, 0x447a0000 # 1000.0f
|
|
|
|
mul-float v1, v1, v2
|
|
|
|
float-to-long v1, v1
|
|
|
|
.line 120
|
|
invoke-virtual {v0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v3
|
|
|
|
.line 122
|
|
invoke-virtual {p0, p1}, Ljava/util/Date;->before(Ljava/util/Date;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_4
|
|
|
|
.line 123
|
|
sget-object v5, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v6, "start before end"
|
|
|
|
invoke-static {v5, v6}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 125
|
|
invoke-virtual {v0, p0}, Ljava/util/Date;->before(Ljava/util/Date;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
invoke-virtual {p0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v5
|
|
|
|
invoke-virtual {v0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v7
|
|
|
|
sub-long/2addr v5, v7
|
|
|
|
sget-wide v7, Lcom/moji/weatherprovider/update/AutoUpdateManager;->c:J
|
|
|
|
cmp-long v9, v5, v7
|
|
|
|
if-lez v9, :cond_0
|
|
|
|
.line 126
|
|
sget-object p1, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v0, "start before end and now before start"
|
|
|
|
invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 127
|
|
invoke-virtual {p0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v3
|
|
|
|
goto/16 :goto_1
|
|
|
|
.line 128
|
|
:cond_0
|
|
invoke-virtual {v0, p1}, Ljava/util/Date;->after(Ljava/util/Date;)Z
|
|
|
|
move-result v5
|
|
|
|
if-nez v5, :cond_3
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v5, 0x0
|
|
|
|
add-long/2addr v3, v1
|
|
|
|
.line 133
|
|
new-instance v5, Ljava/util/Date;
|
|
|
|
invoke-direct {v5, v3, v4}, Ljava/util/Date;-><init>(J)V
|
|
|
|
invoke-virtual {v5, p1}, Ljava/util/Date;->after(Ljava/util/Date;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
.line 134
|
|
sget-object p1, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v0, "start before end and in update time, but add interval after end"
|
|
|
|
invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 135
|
|
invoke-static {p0}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/util/Date;)J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
.line 137
|
|
:cond_2
|
|
invoke-static {v0, v1, v2, v3, v4}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/util/Date;JJ)J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
.line 129
|
|
:cond_3
|
|
:goto_0
|
|
sget-object p1, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v0, "start before end and now after end"
|
|
|
|
invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 130
|
|
invoke-static {p0}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/util/Date;)J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
.line 140
|
|
:cond_4
|
|
invoke-virtual {p0, p1}, Ljava/util/Date;->after(Ljava/util/Date;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_8
|
|
|
|
.line 141
|
|
sget-object v5, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v6, "start after end"
|
|
|
|
invoke-static {v5, v6}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 143
|
|
invoke-virtual {v0, p1}, Ljava/util/Date;->after(Ljava/util/Date;)Z
|
|
|
|
move-result v5
|
|
|
|
if-nez v5, :cond_5
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_6
|
|
|
|
:cond_5
|
|
invoke-virtual {v0, p0}, Ljava/util/Date;->before(Ljava/util/Date;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_6
|
|
|
|
.line 144
|
|
sget-object p1, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v0, "start after end and outside update time"
|
|
|
|
invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 145
|
|
invoke-virtual {p0}, Ljava/util/Date;->getTime()J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
.line 147
|
|
:cond_6
|
|
sget-object v5, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v6, "start after end and in update time"
|
|
|
|
invoke-static {v5, v6}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
add-long/2addr v3, v1
|
|
|
|
.line 149
|
|
invoke-static {p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/util/Date;)J
|
|
|
|
move-result-wide v5
|
|
|
|
cmp-long p1, v3, v5
|
|
|
|
if-lez p1, :cond_7
|
|
|
|
.line 150
|
|
sget-object p1, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a:Ljava/lang/String;
|
|
|
|
const-string v0, "start after end and in update time, but add interval after end"
|
|
|
|
invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 151
|
|
invoke-static {p0}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/util/Date;)J
|
|
|
|
move-result-wide v3
|
|
|
|
goto :goto_1
|
|
|
|
.line 153
|
|
:cond_7
|
|
invoke-static {v0, v1, v2, v3, v4}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/util/Date;JJ)J
|
|
|
|
move-result-wide v3
|
|
|
|
.line 158
|
|
:cond_8
|
|
:goto_1
|
|
invoke-static {v3, v4}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static c(II)Ljava/lang/String;
|
|
.locals 4
|
|
|
|
.line 91
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const/16 v1, 0xa
|
|
|
|
if-ge p0, v1, :cond_0
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v3, "0"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p0, ":"
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
if-ge p1, v1, :cond_1
|
|
|
|
new-instance p0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "0"
|
|
|
|
invoke-virtual {p0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p0
|
|
|
|
:goto_1
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static c()V
|
|
.locals 5
|
|
|
|
.line 184
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Landroid/content/Intent;
|
|
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a()Landroid/content/Context;
|
|
|
|
move-result-object v3
|
|
|
|
const-class v4, Lcom/moji/weatherprovider/Service/WeatherUpdateService;
|
|
|
|
invoke-direct {v2, v3, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/high16 v4, 0x20000000
|
|
|
|
invoke-static {v1, v3, v2, v4}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, v1}, Lcom/moji/alarm/MJAlarmManager;->a(Landroid/content/Context;Landroid/app/PendingIntent;)V
|
|
|
|
return-void
|
|
.end method
|