428 lines
13 KiB
Smali
428 lines
13 KiB
Smali
.class public Lcom/moji/location/MJLocationManager;
|
|
.super Ljava/lang/Object;
|
|
.source "MJLocationManager.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/moji/location/MJLocationManager$MJPoiSearchBuilder;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final a:Lcom/moji/location/MJLocationSource;
|
|
|
|
|
|
# instance fields
|
|
.field public b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
.field private c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.line 33
|
|
sget-object v0, Lcom/moji/location/MJLocationSource;->AMAP_LOCATION:Lcom/moji/location/MJLocationSource;
|
|
|
|
sput-object v0, Lcom/moji/location/MJLocationManager;->a:Lcom/moji/location/MJLocationSource;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 4
|
|
|
|
.line 38
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 39
|
|
new-instance v0, Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
invoke-direct {v0}, Lcom/moji/location/options/MJLocationOptions;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
.line 40
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
iput-boolean v1, v0, Lcom/moji/location/options/MJLocationOptions;->e:Z
|
|
|
|
.line 41
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
iput-boolean v1, v0, Lcom/moji/location/options/MJLocationOptions;->d:Z
|
|
|
|
.line 42
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
iput-boolean v2, v0, Lcom/moji/location/options/MJLocationOptions;->b:Z
|
|
|
|
.line 43
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
iput-boolean v2, v0, Lcom/moji/location/options/MJLocationOptions;->c:Z
|
|
|
|
.line 44
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
const-wide/16 v2, 0x3a98
|
|
|
|
iput-wide v2, v0, Lcom/moji/location/options/MJLocationOptions;->f:J
|
|
|
|
.line 45
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
const-wide/16 v2, 0x7d0
|
|
|
|
iput-wide v2, v0, Lcom/moji/location/options/MJLocationOptions;->g:J
|
|
|
|
.line 46
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
iput-boolean v1, v0, Lcom/moji/location/options/MJLocationOptions;->h:Z
|
|
|
|
.line 47
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
sget-object v2, Lcom/moji/location/options/MJLocationOptions$MJLocationMode;->Battery_Saving:Lcom/moji/location/options/MJLocationOptions$MJLocationMode;
|
|
|
|
iput-object v2, v0, Lcom/moji/location/options/MJLocationOptions;->a:Lcom/moji/location/options/MJLocationOptions$MJLocationMode;
|
|
|
|
.line 48
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
iput-boolean v1, v0, Lcom/moji/location/options/MJLocationOptions;->i:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/content/Context;)Lcom/moji/location/MJLocationManager$MJPoiSearchBuilder;
|
|
.locals 1
|
|
|
|
.line 218
|
|
new-instance v0, Lcom/moji/location/MJLocationManager$MJPoiSearchBuilder;
|
|
|
|
invoke-direct {v0, p0}, Lcom/moji/location/MJLocationManager$MJPoiSearchBuilder;-><init>(Landroid/content/Context;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()V
|
|
.locals 1
|
|
|
|
.line 151
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 152
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
invoke-virtual {v0}, Lcom/moji/location/worker/AbsLocationWorker;->a()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Landroid/content/Context;Lcom/moji/location/MJGeoQuerySource;Lcom/moji/location/geo/MJReGeoCodeQuery;Lcom/moji/location/MJOnGeoCodeSearchListener;)V
|
|
.locals 1
|
|
|
|
if-eqz p4, :cond_3
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 189
|
|
sget-object v0, Lcom/moji/location/MJLocationManager$1;->b:[I
|
|
|
|
invoke-virtual {p2}, Lcom/moji/location/MJGeoQuerySource;->ordinal()I
|
|
|
|
move-result p2
|
|
|
|
aget p2, v0, p2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-eq p2, v0, :cond_0
|
|
|
|
.line 194
|
|
new-instance p2, Lcom/moji/location/worker/AmapReGeoWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/AmapReGeoWorker;-><init>()V
|
|
|
|
goto :goto_0
|
|
|
|
.line 191
|
|
:cond_0
|
|
new-instance p2, Lcom/moji/location/worker/AmapReGeoWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/AmapReGeoWorker;-><init>()V
|
|
|
|
.line 197
|
|
:goto_0
|
|
invoke-virtual {p2, p1, p3, p4}, Lcom/moji/location/worker/AbsReGeoWorker;->a(Landroid/content/Context;Lcom/moji/location/geo/MJReGeoCodeQuery;Lcom/moji/location/MJOnGeoCodeSearchListener;)V
|
|
|
|
return-void
|
|
|
|
.line 185
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Context is needed for location should not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 181
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "MJReGeoCodeQuery should not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 177
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "MJOnGeoCodeSearchListener should not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public a(Landroid/content/Context;Lcom/moji/location/MJLocationListener;)V
|
|
.locals 1
|
|
|
|
.line 62
|
|
sget-object v0, Lcom/moji/location/MJLocationManager;->a:Lcom/moji/location/MJLocationSource;
|
|
|
|
invoke-virtual {p0, p1, v0, p2}, Lcom/moji/location/MJLocationManager;->a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;Lcom/moji/location/MJLocationListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;Lcom/moji/location/MJLocationListener;)V
|
|
.locals 1
|
|
|
|
.line 77
|
|
iget-object v0, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
invoke-virtual {p0, p1, p2, v0, p3}, Lcom/moji/location/MJLocationManager;->a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;Lcom/moji/location/options/MJLocationOptions;Lcom/moji/location/MJLocationListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;Lcom/moji/location/options/MJLocationOptions;Lcom/moji/location/MJLocationListener;)V
|
|
.locals 1
|
|
|
|
.line 93
|
|
invoke-static {}, Lcom/moji/tool/preferences/CtaPrefer;->c()Lcom/moji/tool/preferences/CtaPrefer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/moji/tool/preferences/CtaPrefer;->e()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
if-eqz p4, :cond_4
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
.line 105
|
|
iget-object p3, p0, Lcom/moji/location/MJLocationManager;->b:Lcom/moji/location/options/MJLocationOptions;
|
|
|
|
.line 111
|
|
:cond_1
|
|
invoke-static {p1, p2}, Lcom/moji/location/provider/HistoryLocationHelper;->a(Landroid/content/Context;Lcom/moji/location/MJLocationSource;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
.line 112
|
|
invoke-static {p1, p2}, Lcom/moji/location/provider/HistoryLocationHelper;->b(Landroid/content/Context;Lcom/moji/location/MJLocationSource;)Lcom/moji/location/entity/MJLocation;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 114
|
|
invoke-interface {p4, v0}, Lcom/moji/location/MJLocationListener;->onLocateSuccess(Lcom/moji/location/entity/MJLocation;)V
|
|
|
|
.line 115
|
|
invoke-interface {p4, v0}, Lcom/moji/location/MJLocationListener;->onOtherDataReady(Lcom/moji/location/entity/MJLocation;)V
|
|
|
|
const-string p1, "MJLocationManager"
|
|
|
|
const-string p2, " no need to locate for just located, return cached location"
|
|
|
|
.line 116
|
|
invoke-static {p1, p2}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
.line 121
|
|
:cond_2
|
|
sget-object v0, Lcom/moji/location/MJLocationManager$1;->a:[I
|
|
|
|
invoke-virtual {p2}, Lcom/moji/location/MJLocationSource;->ordinal()I
|
|
|
|
move-result p2
|
|
|
|
aget p2, v0, p2
|
|
|
|
packed-switch p2, :pswitch_data_0
|
|
|
|
.line 144
|
|
new-instance p2, Lcom/moji/location/worker/AmapLocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/AmapLocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 141
|
|
:pswitch_0
|
|
new-instance p2, Lcom/moji/location/worker/MJV3LocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/MJV3LocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 138
|
|
:pswitch_1
|
|
new-instance p2, Lcom/moji/location/worker/TVLocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/TVLocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 135
|
|
:pswitch_2
|
|
new-instance p2, Lcom/moji/location/worker/IPLocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/IPLocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 132
|
|
:pswitch_3
|
|
new-instance p2, Lcom/moji/location/worker/CDMALocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/CDMALocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 129
|
|
:pswitch_4
|
|
new-instance p2, Lcom/moji/location/worker/GSMLocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/GSMLocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 126
|
|
:pswitch_5
|
|
new-instance p2, Lcom/moji/location/worker/AmapLocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/AmapLocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
goto :goto_0
|
|
|
|
.line 123
|
|
:pswitch_6
|
|
new-instance p2, Lcom/moji/location/worker/MJLocationWorker;
|
|
|
|
invoke-direct {p2}, Lcom/moji/location/worker/MJLocationWorker;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
.line 147
|
|
:goto_0
|
|
iget-object p2, p0, Lcom/moji/location/MJLocationManager;->c:Lcom/moji/location/worker/AbsLocationWorker;
|
|
|
|
invoke-virtual {p2, p1, p4, p3}, Lcom/moji/location/worker/AbsLocationWorker;->a(Landroid/content/Context;Lcom/moji/location/MJLocationListener;Lcom/moji/location/options/MJLocationOptions;)V
|
|
|
|
return-void
|
|
|
|
.line 101
|
|
:cond_3
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Context is needed for location should not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 97
|
|
:cond_4
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "MJLocationListener should not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
nop
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x1
|
|
:pswitch_6
|
|
:pswitch_5
|
|
:pswitch_4
|
|
:pswitch_3
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_0
|
|
.end packed-switch
|
|
.end method
|
|
|
|
.method public a(Landroid/content/Context;Lcom/moji/location/geo/MJReGeoCodeQuery;Lcom/moji/location/MJOnGeoCodeSearchListener;)V
|
|
.locals 1
|
|
|
|
.line 164
|
|
sget-object v0, Lcom/moji/location/MJGeoQuerySource;->AMAP:Lcom/moji/location/MJGeoQuerySource;
|
|
|
|
invoke-virtual {p0, p1, v0, p2, p3}, Lcom/moji/location/MJLocationManager;->a(Landroid/content/Context;Lcom/moji/location/MJGeoQuerySource;Lcom/moji/location/geo/MJReGeoCodeQuery;Lcom/moji/location/MJOnGeoCodeSearchListener;)V
|
|
|
|
return-void
|
|
.end method
|