[Change]下沉 MoGoApplication 中对初始化的调用

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2021-11-16 11:22:24 +08:00
parent 7b3744813e
commit 2739a20076
10 changed files with 434 additions and 322 deletions

View File

@@ -751,7 +751,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
MogoLocation mLastLocation = ObjectUtils.fromLocation(location);
CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation);
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
Location sysLocation = new Location(location.getProvider());
sysLocation.setAltitude(location.getAltitude());

View File

@@ -9,6 +9,7 @@ import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.map.location.MogoLocationListenerRegister;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import com.zhidaoauto.map.sdk.open.location.LocationClient;
import com.zhidaoauto.map.sdk.open.location.LocationListener;
@@ -123,7 +124,8 @@ public class ALocationClient implements IMogoLocationClient {
}
Trace.beginSection( "timer.onLocationChanged" );
mLastLocation = ObjectUtils.fromLocation( location );
CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation);
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
Set< IMogoLocationListener > listeners = MogoLocationListenerRegister.getInstance().getListeners();
synchronized ( listeners ) {
Iterator< IMogoLocationListener > listenerIterator = listeners.iterator();