333 lines
8.9 KiB
Smali
333 lines
8.9 KiB
Smali
.class public Lcom/moji/weatherprovider/SilentCityManager;
|
|
.super Ljava/lang/Object;
|
|
.source "SilentCityManager.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/moji/weatherprovider/SilentCityManager$SingleHolder;,
|
|
Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final a:[Ljava/lang/String;
|
|
|
|
.field private static d:Landroid/content/Context;
|
|
|
|
|
|
# instance fields
|
|
.field private b:Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
.field private c:Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
|
|
.field private e:Z
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x2
|
|
|
|
.line 29
|
|
new-array v0, v0, [Ljava/lang/String;
|
|
|
|
const-string v1, "android.permission.ACCESS_FINE_LOCATION"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
const-string v1, "android.permission.ACCESS_COARSE_LOCATION"
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/moji/weatherprovider/SilentCityManager;->a:[Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 1
|
|
|
|
.line 115
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 116
|
|
invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/moji/weatherprovider/SilentCityManager;->d:Landroid/content/Context;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method synthetic constructor <init>(Lcom/moji/weatherprovider/SilentCityManager$1;)V
|
|
.locals 0
|
|
|
|
.line 24
|
|
invoke-direct {p0}, Lcom/moji/weatherprovider/SilentCityManager;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a()Lcom/moji/weatherprovider/SilentCityManager;
|
|
.locals 1
|
|
|
|
.line 32
|
|
sget-object v0, Lcom/moji/weatherprovider/SilentCityManager$SingleHolder;->a:Lcom/moji/weatherprovider/SilentCityManager;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private a(Lcom/moji/common/area/AreaInfo;)V
|
|
.locals 2
|
|
|
|
.line 53
|
|
iget-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->b:Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 54
|
|
new-instance v0, Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
invoke-direct {v0}, Lcom/moji/weatherprovider/update/WeatherUpdater;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->b:Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
.line 56
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->c:Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 57
|
|
new-instance v0, Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, p0, v1}, Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;-><init>(Lcom/moji/weatherprovider/SilentCityManager;Lcom/moji/weatherprovider/SilentCityManager$1;)V
|
|
|
|
iput-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->c:Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
|
|
.line 59
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->b:Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
iget-object v1, p0, Lcom/moji/weatherprovider/SilentCityManager;->c:Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
|
|
invoke-virtual {v0, p1, v1}, Lcom/moji/weatherprovider/update/WeatherUpdater;->a(Lcom/moji/common/area/AreaInfo;Lcom/moji/weatherprovider/update/WeatherUpdateListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic a(Lcom/moji/weatherprovider/SilentCityManager;Lcom/moji/weatherprovider/data/Weather;)V
|
|
.locals 0
|
|
|
|
.line 24
|
|
invoke-direct {p0, p1}, Lcom/moji/weatherprovider/SilentCityManager;->a(Lcom/moji/weatherprovider/data/Weather;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Lcom/moji/weatherprovider/data/Weather;)V
|
|
.locals 5
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 97
|
|
iget-object v0, p1, Lcom/moji/weatherprovider/data/Weather;->mDetail:Lcom/moji/weatherprovider/data/Detail;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p1, Lcom/moji/weatherprovider/data/Weather;->mDetail:Lcom/moji/weatherprovider/data/Detail;
|
|
|
|
iget-wide v0, v0, Lcom/moji/weatherprovider/data/Detail;->mCityId:J
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-lez v4, :cond_1
|
|
|
|
iget-object v0, p1, Lcom/moji/weatherprovider/data/Weather;->mDetail:Lcom/moji/weatherprovider/data/Detail;
|
|
|
|
iget-object v0, v0, Lcom/moji/weatherprovider/data/Detail;->mCityName:Ljava/lang/String;
|
|
|
|
invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 100
|
|
:cond_0
|
|
invoke-direct {p0, p1}, Lcom/moji/weatherprovider/SilentCityManager;->b(Lcom/moji/weatherprovider/data/Weather;)Lcom/moji/common/area/AreaInfo;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lcom/moji/areamanagement/MJAreaManager;->a(Lcom/moji/common/area/AreaInfo;)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private b(Lcom/moji/weatherprovider/data/Weather;)Lcom/moji/common/area/AreaInfo;
|
|
.locals 3
|
|
.annotation build Landroid/support/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 105
|
|
new-instance v0, Lcom/moji/common/area/AreaInfo;
|
|
|
|
invoke-direct {v0}, Lcom/moji/common/area/AreaInfo;-><init>()V
|
|
|
|
.line 106
|
|
iget-object v1, p1, Lcom/moji/weatherprovider/data/Weather;->mDetail:Lcom/moji/weatherprovider/data/Detail;
|
|
|
|
iget-wide v1, v1, Lcom/moji/weatherprovider/data/Detail;->mCityId:J
|
|
|
|
long-to-int v1, v1
|
|
|
|
iput v1, v0, Lcom/moji/common/area/AreaInfo;->cityId:I
|
|
|
|
.line 107
|
|
iget-object v1, p1, Lcom/moji/weatherprovider/data/Weather;->mDetail:Lcom/moji/weatherprovider/data/Detail;
|
|
|
|
iget-object v1, v1, Lcom/moji/weatherprovider/data/Detail;->mCityName:Ljava/lang/String;
|
|
|
|
iput-object v1, v0, Lcom/moji/common/area/AreaInfo;->cityName:Ljava/lang/String;
|
|
|
|
.line 108
|
|
iget-object p1, p1, Lcom/moji/weatherprovider/data/Weather;->mDetail:Lcom/moji/weatherprovider/data/Detail;
|
|
|
|
iget-object p1, p1, Lcom/moji/weatherprovider/data/Detail;->mStreetName:Ljava/lang/String;
|
|
|
|
iput-object p1, v0, Lcom/moji/common/area/AreaInfo;->streetName:Ljava/lang/String;
|
|
|
|
.line 109
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, v0, Lcom/moji/common/area/AreaInfo;->timestamp:Ljava/lang/String;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 110
|
|
iput p1, v0, Lcom/moji/common/area/AreaInfo;->city_index:I
|
|
|
|
const/4 p1, 0x1
|
|
|
|
.line 111
|
|
iput-boolean p1, v0, Lcom/moji/common/area/AreaInfo;->isLocation:Z
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private e()V
|
|
.locals 2
|
|
|
|
.line 46
|
|
invoke-static {}, Lcom/moji/tool/DeviceTool;->m()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 47
|
|
:cond_0
|
|
new-instance v0, Lcom/moji/common/area/AreaInfo;
|
|
|
|
invoke-direct {v0}, Lcom/moji/common/area/AreaInfo;-><init>()V
|
|
|
|
const/4 v1, 0x1
|
|
|
|
.line 48
|
|
iput-boolean v1, v0, Lcom/moji/common/area/AreaInfo;->isLocation:Z
|
|
|
|
.line 49
|
|
invoke-direct {p0, v0}, Lcom/moji/weatherprovider/SilentCityManager;->a(Lcom/moji/common/area/AreaInfo;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Z)V
|
|
.locals 0
|
|
|
|
.line 63
|
|
iput-boolean p1, p0, Lcom/moji/weatherprovider/SilentCityManager;->e:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public b()V
|
|
.locals 2
|
|
|
|
.line 36
|
|
sget-object v0, Lcom/moji/weatherprovider/SilentCityManager;->d:Landroid/content/Context;
|
|
|
|
sget-object v1, Lcom/moji/weatherprovider/SilentCityManager;->a:[Ljava/lang/String;
|
|
|
|
invoke-static {v0, v1}, Lcom/moji/tool/permission/EasyPermissions;->a(Landroid/content/Context;[Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 39
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/moji/weatherprovider/SilentCityManager;->e()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public c()Z
|
|
.locals 1
|
|
|
|
.line 67
|
|
iget-boolean v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->e:Z
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public d()V
|
|
.locals 2
|
|
|
|
.line 71
|
|
iget-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->b:Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 72
|
|
iget-object v0, p0, Lcom/moji/weatherprovider/SilentCityManager;->b:Lcom/moji/weatherprovider/update/WeatherUpdater;
|
|
|
|
iget-object v1, p0, Lcom/moji/weatherprovider/SilentCityManager;->c:Lcom/moji/weatherprovider/SilentCityManager$AreaWeatherUpdateListener;
|
|
|
|
invoke-virtual {v0, v1}, Lcom/moji/weatherprovider/update/WeatherUpdater;->a(Lcom/moji/weatherprovider/update/WeatherUpdateListener;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|