280 lines
6.6 KiB
Smali
280 lines
6.6 KiB
Smali
.class public Lcom/moji/appwidget/WeatherRepeater;
|
|
.super Ljava/lang/Object;
|
|
.source "WeatherRepeater.java"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 22
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Lcom/moji/common/area/AreaInfo;)Lcom/moji/weatherprovider/data/Weather;
|
|
.locals 3
|
|
|
|
const-string v0, "getCurrAreaInfo"
|
|
|
|
.line 34
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, ""
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 35
|
|
invoke-static {}, Lcom/moji/weatherprovider/provider/WeatherProvider;->b()Lcom/moji/weatherprovider/provider/WeatherProvider;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Lcom/moji/weatherprovider/provider/WeatherProvider;->a(Lcom/moji/common/area/AreaInfo;)Lcom/moji/weatherprovider/data/Weather;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private a(Lcom/moji/weatherprovider/data/Weather;)V
|
|
.locals 10
|
|
|
|
.line 49
|
|
invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->a()Lcom/moji/common/area/AreaInfo;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
goto/16 :goto_1
|
|
|
|
.line 53
|
|
:cond_0
|
|
iget-wide v1, p1, Lcom/moji/weatherprovider/data/Weather;->mLocalUpdatetime:J
|
|
|
|
.line 54
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
.line 55
|
|
new-instance p1, Lcom/moji/preferences/ProcessPrefer;
|
|
|
|
invoke-direct {p1}, Lcom/moji/preferences/ProcessPrefer;-><init>()V
|
|
|
|
invoke-virtual {p1}, Lcom/moji/preferences/ProcessPrefer;->x()F
|
|
|
|
move-result p1
|
|
|
|
.line 56
|
|
new-instance v5, Lcom/moji/appwidget/core/AWPrefer;
|
|
|
|
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-direct {v5, v6}, Lcom/moji/appwidget/core/AWPrefer;-><init>(Landroid/content/Context;)V
|
|
|
|
sub-long v1, v3, v1
|
|
|
|
const v6, 0x4a5bba00 # 3600000.0f
|
|
|
|
mul-float p1, p1, v6
|
|
|
|
float-to-long v6, p1
|
|
|
|
const-wide/32 v8, 0x493e0
|
|
|
|
cmp-long p1, v1, v6
|
|
|
|
if-lez p1, :cond_5
|
|
|
|
.line 60
|
|
invoke-virtual {v5}, Lcom/moji/appwidget/core/AWPrefer;->f()J
|
|
|
|
move-result-wide v1
|
|
|
|
.line 61
|
|
invoke-virtual {v5}, Lcom/moji/appwidget/core/AWPrefer;->g()J
|
|
|
|
move-result-wide v6
|
|
|
|
sub-long v1, v3, v1
|
|
|
|
cmp-long p1, v1, v6
|
|
|
|
if-gez p1, :cond_1
|
|
|
|
return-void
|
|
|
|
.line 69
|
|
:cond_1
|
|
invoke-virtual {v5, v3, v4}, Lcom/moji/appwidget/core/AWPrefer;->a(J)V
|
|
|
|
add-long/2addr v6, v8
|
|
|
|
const-wide/32 v1, 0x6ddd00
|
|
|
|
cmp-long p1, v6, v1
|
|
|
|
if-ltz p1, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
move-wide v1, v6
|
|
|
|
.line 72
|
|
:goto_0
|
|
invoke-virtual {v5, v1, v2}, Lcom/moji/appwidget/core/AWPrefer;->b(J)V
|
|
|
|
.line 74
|
|
invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_3
|
|
|
|
.line 75
|
|
invoke-static {}, Landroid/os/Looper;->prepare()V
|
|
|
|
.line 77
|
|
:cond_3
|
|
new-instance p1, Lcom/moji/preferences/ProcessPrefer;
|
|
|
|
invoke-direct {p1}, Lcom/moji/preferences/ProcessPrefer;-><init>()V
|
|
|
|
invoke-virtual {p1}, Lcom/moji/preferences/ProcessPrefer;->v()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 78
|
|
new-instance v1, Lcom/moji/preferences/ProcessPrefer;
|
|
|
|
invoke-direct {v1}, Lcom/moji/preferences/ProcessPrefer;-><init>()V
|
|
|
|
invoke-virtual {v1}, Lcom/moji/preferences/ProcessPrefer;->w()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 79
|
|
new-instance v2, Ljava/util/Date;
|
|
|
|
invoke-direct {v2}, Ljava/util/Date;-><init>()V
|
|
|
|
.line 80
|
|
invoke-static {p1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object p1
|
|
|
|
.line 81
|
|
invoke-static {v1}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a(Ljava/lang/String;)Ljava/util/Date;
|
|
|
|
move-result-object v1
|
|
|
|
.line 82
|
|
invoke-virtual {v2, v1}, Ljava/util/Date;->before(Ljava/util/Date;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-virtual {v2, p1}, Ljava/util/Date;->after(Ljava/util/Date;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
const-string p1, "NetProblem"
|
|
|
|
const-string v1, "WeatherRepeater --> \u58a8\u8ff9\u5929\u6c14\u81ea\u5e26 Widget \u66f4\u65b0\u5929\u6c14"
|
|
|
|
.line 83
|
|
invoke-static {p1, v1}, Lcom/moji/tool/log/MJLogger;->e(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
.line 84
|
|
new-instance p1, Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
invoke-direct {p1}, Lcom/moji/weatherprovider/update/WeatherUpdater;-><init>()V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 85
|
|
sget-object v2, Lcom/moji/weatherprovider/update/WeatherUpdater$UPDATE_TYPE;->WIDGET_AUTO:Lcom/moji/weatherprovider/update/WeatherUpdater$UPDATE_TYPE;
|
|
|
|
invoke-virtual {p1, v0, v1, v2}, Lcom/moji/weatherprovider/update/WeatherUpdater;->a(Lcom/moji/common/area/AreaInfo;Lcom/moji/weatherprovider/update/WeatherUpdateListener;Lcom/moji/weatherprovider/update/WeatherUpdater$UPDATE_TYPE;)V
|
|
|
|
.line 86
|
|
invoke-static {}, Lcom/moji/weatherprovider/update/AutoUpdateManager;->a()V
|
|
|
|
:cond_4
|
|
return-void
|
|
|
|
.line 93
|
|
:cond_5
|
|
invoke-virtual {v5, v8, v9}, Lcom/moji/appwidget/core/AWPrefer;->b(J)V
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()Lcom/moji/weatherprovider/data/Weather;
|
|
.locals 1
|
|
|
|
.line 28
|
|
invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->a()Lcom/moji/common/area/AreaInfo;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Lcom/moji/appwidget/WeatherRepeater;->a(Lcom/moji/common/area/AreaInfo;)Lcom/moji/weatherprovider/data/Weather;
|
|
|
|
move-result-object v0
|
|
|
|
.line 29
|
|
invoke-direct {p0, v0}, Lcom/moji/appwidget/WeatherRepeater;->a(Lcom/moji/weatherprovider/data/Weather;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public b()I
|
|
.locals 1
|
|
|
|
.line 39
|
|
invoke-static {}, Lcom/moji/areamanagement/MJAreaManager;->c()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
.line 40
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
:goto_0
|
|
return v0
|
|
.end method
|