Merge branch 'qa_hengyang_base' into dev_hengyang_base
This commit is contained in:
@@ -16,6 +16,7 @@ import com.mogo.cloud.passport.IMoGoTokenCallback;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
@@ -193,14 +194,34 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
.getApis().getMapServiceApi()
|
||||
.getSingletonLocationClient(getApp())
|
||||
.getLastKnowLocation();
|
||||
//Logger.i(TAG, "刷新DNS" + mogoLocation);
|
||||
if (mogoLocation != null) {
|
||||
return new HttpDnsSimpleLocation(
|
||||
HttpDnsSimpleLocation httpDnsSimpleLocation;
|
||||
if (mogoLocation != null
|
||||
&& mogoLocation.getLatitude() != 0
|
||||
&& mogoLocation.getLongitude() != 0) {
|
||||
httpDnsSimpleLocation = new HttpDnsSimpleLocation(
|
||||
mogoLocation.getCityCode(),
|
||||
mogoLocation.getLatitude(),
|
||||
mogoLocation.getLongitude());
|
||||
Logger.i(TAG, "使用实时GPS信息:" + httpDnsSimpleLocation);
|
||||
} else {
|
||||
String ciyCode = SharedPrefsMgr.getInstance(getApp())
|
||||
.getString(SharedPrefsConstants.LOCATION_CITY_CODE);
|
||||
String latitude = SharedPrefsMgr.getInstance(getApp())
|
||||
.getString(SharedPrefsConstants.LOCATION_LATITUDE);
|
||||
String longitude = SharedPrefsMgr.getInstance(getApp())
|
||||
.getString(SharedPrefsConstants.LOCATION_LONGITUDE);
|
||||
try {
|
||||
httpDnsSimpleLocation = new HttpDnsSimpleLocation(
|
||||
ciyCode,
|
||||
Double.parseDouble(latitude),
|
||||
Double.parseDouble(longitude));
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
httpDnsSimpleLocation = new HttpDnsSimpleLocation("010", 1, 1);
|
||||
}
|
||||
Logger.i(TAG, "使用缓存GPS信息:" + httpDnsSimpleLocation);
|
||||
}
|
||||
return new HttpDnsSimpleLocation("010", 0, 0);
|
||||
return httpDnsSimpleLocation;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user