update modules to 1.0.2

This commit is contained in:
wangcongtao
2020-03-02 14:07:27 +08:00
parent fefccc8ee4
commit 590bb96ed2
4 changed files with 25 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
package com.mogo.commons.network;
import com.mogo.map.location.MogoLocation;
import java.util.HashMap;
import java.util.Map;
/**
* @author congtaowang
@@ -30,13 +31,9 @@ public class LocationHelper {
sInstance = null;
}
private MogoLocation mMogoLocation;
private Map< String, Object > mLocationProperties = new HashMap<>();
public MogoLocation getMogoLocation() {
return mMogoLocation;
}
public void setMogoLocation( MogoLocation mogoLocation ) {
this.mMogoLocation = mogoLocation;
public synchronized Map< String, Object > getLocationProperties() {
return mLocationProperties;
}
}

View File

@@ -9,7 +9,6 @@ import androidx.collection.ArrayMap;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.storage.SpStorage;
import com.mogo.map.location.MogoLocation;
import com.mogo.utils.CommonUtils;
import com.mogo.utils.DeviceIdUtils;
import com.mogo.utils.WindowUtils;
@@ -31,12 +30,9 @@ public class ParamsUtil {
public static Map< String, Object > getDynamicParams() {
Map< String, Object > params = new ArrayMap();
final MogoLocation location = LocationHelper.getInstance().getMogoLocation();
final Map<String,Object> location = LocationHelper.getInstance().getLocationProperties();
if ( location != null ) {
params.put( ServerParam.CITY_CODE, location.getCityCode() );
params.put( ServerParam.AD_CODE, location.getAdCode() );
params.put( ServerParam.LAT, location.getLatitude() );
params.put( ServerParam.LNG, location.getLongitude() );
params.putAll( location );
}
params.put( ServerParam.NET_TYPE, CommonUtils.getNetworkType( AbsMogoApplication.getApp() ) );
params.put( ServerParam.CELL_ID, Utils.getCellId( AbsMogoApplication.getApp() ) );