apk(点击下载) / AMapLocation.java
package com.amap.api.location;
import android.location.Location;
import com.amap.api.col.f;
import com.amap.api.col.il;
import com.amap.api.services.district.DistrictSearchQuery;
import com.netease.nim.uikit.business.contact.core.model.ContactGroupStrategy;
import org.json.JSONObject;
public class AMapLocation extends Location {
public static final int ERROR_CODE_FAILURE_AUTH = 7;
public static final int ERROR_CODE_FAILURE_CELL = 11;
public static final int ERROR_CODE_FAILURE_CONNECTION = 4;
public static final int ERROR_CODE_FAILURE_INIT = 9;
public static final int ERROR_CODE_FAILURE_LOCATION = 6;
public static final int ERROR_CODE_FAILURE_LOCATION_PARAMETER = 3;
public static final int ERROR_CODE_FAILURE_LOCATION_PERMISSION = 12;
public static final int ERROR_CODE_FAILURE_NOENOUGHSATELLITES = 14;
public static final int ERROR_CODE_FAILURE_NOWIFIANDAP = 13;
public static final int ERROR_CODE_FAILURE_PARSER = 5;
public static final int ERROR_CODE_FAILURE_SIMULATION_LOCATION = 15;
public static final int ERROR_CODE_FAILURE_WIFI_INFO = 2;
public static final int ERROR_CODE_INVALID_PARAMETER = 1;
public static final int ERROR_CODE_SERVICE_FAIL = 10;
public static final int ERROR_CODE_UNKNOWN = 8;
public static final int GPS_ACCURACY_BAD = 0;
public static final int GPS_ACCURACY_GOOD = 1;
public static final int GPS_ACCURACY_UNKNOWN = -1;
public static final int LOCATION_SUCCESS = 0;
public static final int LOCATION_TYPE_AMAP = 7;
public static final int LOCATION_TYPE_CELL = 6;
public static final int LOCATION_TYPE_FAST = 3;
public static final int LOCATION_TYPE_FIX_CACHE = 4;
public static final int LOCATION_TYPE_GPS = 1;
public static final int LOCATION_TYPE_OFFLINE = 8;
public static final int LOCATION_TYPE_SAME_REQ = 2;
public static final int LOCATION_TYPE_WIFI = 5;
protected String a = "";
protected String b = "";
protected String c = "";
/* renamed from: d reason: collision with root package name */
private String f1073d = "";
private String e = "";
private String f = "";
private String g = "";
private String h = "";
private String i = "";
private String j = "";
private String k = "";
private String l = "";
private String m = "";
private String n = "";
private boolean o = true;
private int p = 0;
private String q = "success";
private String r = "";
private int s = 0;
private double t = 0.0d;
private double u = 0.0d;
private int v = 0;
private String w = "";
private int x = -1;
public AMapLocation(String str) {
super(str);
}
/* access modifiers changed from: protected */
public JSONObject a(int i2) {
try {
JSONObject jSONObject = new JSONObject();
if (i2 == 1) {
jSONObject.put("altitude", getAltitude());
jSONObject.put("speed", (double) getSpeed());
jSONObject.put("bearing", (double) getBearing());
jSONObject.put("citycode", this.g);
jSONObject.put("desc", this.c);
jSONObject.put("adcode", this.h);
jSONObject.put(DistrictSearchQuery.KEYWORDS_COUNTRY, this.k);
jSONObject.put(DistrictSearchQuery.KEYWORDS_PROVINCE, this.f1073d);
jSONObject.put(DistrictSearchQuery.KEYWORDS_CITY, this.e);
jSONObject.put(DistrictSearchQuery.KEYWORDS_DISTRICT, this.f);
jSONObject.put("road", this.l);
jSONObject.put("street", this.m);
jSONObject.put("number", this.n);
jSONObject.put("poiname", this.j);
jSONObject.put("errorCode", this.p);
jSONObject.put("errorInfo", this.q);
jSONObject.put("locationType", this.s);
jSONObject.put("locationDetail", this.r);
jSONObject.put("aoiname", this.w);
jSONObject.put("address", this.i);
jSONObject.put("poiid", this.a);
jSONObject.put("floor", this.b);
} else if (i2 != 2) {
if (i2 != 3) {
return jSONObject;
}
jSONObject.put("provider", getProvider());
jSONObject.put("lon", getLongitude());
jSONObject.put("lat", getLatitude());
jSONObject.put("accuracy", (double) getAccuracy());
jSONObject.put("isOffset", this.o);
return jSONObject;
}
jSONObject.put("time", getTime());
jSONObject.put("provider", getProvider());
jSONObject.put("lon", getLongitude());
jSONObject.put("lat", getLatitude());
jSONObject.put("accuracy", (double) getAccuracy());
jSONObject.put("isOffset", this.o);
return jSONObject;
} catch (Throwable th) {
f.a(th, "AmapLoc", "toStr");
return null;
}
}
public float getAccuracy() {
return super.getAccuracy();
}
public String getAdCode() {
return this.h;
}
public String getAddress() {
return this.i;
}
public double getAltitude() {
return super.getAltitude();
}
public String getAoiName() {
return this.w;
}
public float getBearing() {
return super.getBearing();
}
public String getBuildingId() {
return this.a;
}
public String getCity() {
return this.e;
}
public String getCityCode() {
return this.g;
}
public String getCountry() {
return this.k;
}
public String getDistrict() {
return this.f;
}
public int getErrorCode() {
return this.p;
}
public String getErrorInfo() {
StringBuilder sb = new StringBuilder();
sb.append(this.q);
if (this.p != 0) {
sb.append(" 请到http://lbs.amap.com/api/android-location-sdk/guide/utilities/errorcode/查看错误码说明.");
}
String sb2 = sb.toString();
this.q = sb2;
return sb2;
}
public String getFloor() {
return this.b;
}
public int getGpsAccuracyStatus() {
return this.x;
}
public double getLatitude() {
return this.t;
}
public String getLocationDetail() {
return this.r;
}
public int getLocationType() {
return this.s;
}
public double getLongitude() {
return this.u;
}
public String getPoiName() {
return this.j;
}
public String getProvider() {
return super.getProvider();
}
public String getProvince() {
return this.f1073d;
}
public String getRoad() {
return this.l;
}
public int getSatellites() {
return this.v;
}
public float getSpeed() {
return super.getSpeed();
}
public String getStreet() {
return this.m;
}
public String getStreetNum() {
return this.n;
}
public boolean isOffset() {
return this.o;
}
public void setAdCode(String str) {
this.h = str;
}
public void setAddress(String str) {
this.i = str;
}
public void setAoiName(String str) {
this.w = str;
}
public void setBuildingId(String str) {
this.a = str;
}
public void setCity(String str) {
this.e = str;
}
public void setCityCode(String str) {
this.g = str;
}
public void setCountry(String str) {
this.k = str;
}
public void setDistrict(String str) {
this.f = str;
}
public void setErrorCode(int i2) {
if (this.p == 0) {
this.q = il.b(i2);
this.p = i2;
}
}
public void setErrorInfo(String str) {
this.q = str;
}
public void setFloor(String str) {
this.b = str;
}
public void setGpsAccuracyStatus(int i2) {
this.x = i2;
}
public void setLatitude(double d2) {
this.t = d2;
}
public void setLocationDetail(String str) {
this.r = str;
}
public void setLocationType(int i2) {
this.s = i2;
}
public void setLongitude(double d2) {
this.u = d2;
}
public void setNumber(String str) {
this.n = str;
}
public void setOffset(boolean z) {
this.o = z;
}
public void setPoiName(String str) {
this.j = str;
}
public void setProvince(String str) {
this.f1073d = str;
}
public void setRoad(String str) {
this.l = str;
}
public void setSatellites(int i2) {
this.v = i2;
}
public void setStreet(String str) {
this.m = str;
}
public String toStr() {
return toStr(1);
}
public String toString() {
StringBuffer stringBuffer = new StringBuffer();
try {
stringBuffer.append("latitude=" + this.t + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("longitude=" + this.u + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("province=" + this.f1073d + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("city=" + this.e + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("district=" + this.f + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("cityCode=" + this.g + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("adCode=" + this.h + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("address=" + this.i + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("country=" + this.k + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("road=" + this.l + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("poiName=" + this.j + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("street=" + this.m + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("streetNum=" + this.n + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("aoiName=" + this.w + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("poiid=" + this.a + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("floor=" + this.b + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("errorCode=" + this.p + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("errorInfo=" + this.q + ContactGroupStrategy.GROUP_SHARP);
stringBuffer.append("locationDetail=" + this.r + ContactGroupStrategy.GROUP_SHARP);
StringBuilder sb = new StringBuilder();
sb.append("locationType=");
sb.append(this.s);
stringBuffer.append(sb.toString());
} catch (Throwable unused) {
}
return stringBuffer.toString();
}
public String toStr(int i2) {
JSONObject jSONObject;
try {
jSONObject = a(i2);
} catch (Throwable th) {
f.a(th, "AMapLocation", "toStr part2");
jSONObject = null;
}
if (jSONObject == null) {
return null;
}
return jSONObject.toString();
}
public AMapLocation(Location location) {
super(location);
this.t = location.getLatitude();
this.u = location.getLongitude();
}
}