opt
This commit is contained in:
@@ -8,7 +8,6 @@ import android.content.IntentFilter;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Trace;
|
||||
@@ -19,7 +18,6 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
@@ -46,8 +44,6 @@ import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.service.refresh.AutoRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.CustomRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.RefreshObject;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
@@ -258,8 +254,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
public void onFail() {
|
||||
if ( mLoopRequest ) {
|
||||
Logger.d( TAG, "onFail and loop" );
|
||||
mHandler.sendEmptyMessageDelayed( ServiceConst.MSG_LOOP_REQUEST,
|
||||
ServiceConst.LOOP_INTERVAL );
|
||||
mHandler.sendEmptyMessageDelayed( ServiceConst.MSG_LOOP_REQUEST, ServiceConst.LOOP_INTERVAL );
|
||||
} else {
|
||||
invokeAutoRefreshStrategy();
|
||||
}
|
||||
@@ -271,8 +266,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
mRefreshRemainingTime = mAutoRefreshStrategy.getInterval();
|
||||
mHandler.removeMessages( ServiceConst.MSG_TYPE_REFRESH_DECREASE );
|
||||
mHandler.sendEmptyMessageDelayed( ServiceConst.MSG_TYPE_REFRESH_DECREASE,
|
||||
ServiceConst.DECREASE_INTERVAL );
|
||||
mHandler.sendEmptyMessageDelayed( ServiceConst.MSG_TYPE_REFRESH_DECREASE, ServiceConst.DECREASE_INTERVAL );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -287,14 +281,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
mUiController = mMogoMapService.getMapUIController();
|
||||
mNavi = mMogoMapService.getNavi( context );
|
||||
mStatusManager = MarkerServiceHandler.getMogoStatusManager();
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE,
|
||||
StatusDescriptor.USER_INTERACTED, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.SEARCH_UI,
|
||||
this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ADAS_UI,
|
||||
this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE,
|
||||
StatusDescriptor.MAIN_PAGE_RESUME, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.USER_INTERACTED, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.SEARCH_UI, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ADAS_UI, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.MAIN_PAGE_RESUME, this );
|
||||
|
||||
registerMogoReceiver( context );
|
||||
registerInternalUnWakeupWords();
|
||||
@@ -336,7 +326,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
Logger.d( TAG, "current thread: %s", Thread.currentThread() );
|
||||
Logger.d( TAG, "current thread: %s, msg = %s", Thread.currentThread(), msg.what );
|
||||
if ( msg.what == ServiceConst.MSG_MAP_CHANGED ) {
|
||||
if ( msg.obj instanceof RefreshObject ) {
|
||||
RefreshObject ro = ( ( RefreshObject ) msg.obj );
|
||||
@@ -349,8 +339,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( msg.obj instanceof RefreshObject ) {
|
||||
RefreshObject ro = ( ( RefreshObject ) msg.obj );
|
||||
mRefreshModel.refreshData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
|
||||
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius,
|
||||
ro.mLonLat, mLastZoomLevel, ro.mAmount );
|
||||
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,8 +408,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
*/
|
||||
private float getMapCameraFactWidth() {
|
||||
try {
|
||||
return Utils.calculateLineDistance( mCameraNorthEastPosition,
|
||||
new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
|
||||
return Utils.calculateLineDistance( mCameraNorthEastPosition, new MogoLatLng( mCameraNorthEastPosition.lat, mCameraSouthWestPosition.lng ) );
|
||||
} catch ( Exception e ) {
|
||||
return ServiceConst.DEFAULT_AUTO_REFRESH_DATA_RADIUS;
|
||||
}
|
||||
@@ -507,6 +495,13 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
|
||||
// 搜索页面显示时不做任何策略
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
mLastZoomLevel = zoom;
|
||||
return;
|
||||
}
|
||||
|
||||
// 手动刷新触发
|
||||
if ( mLastZoomLevel - zoom > mCustomRefreshStrategy.getZoomOutLevel() ) {
|
||||
// 缩放级别缩小
|
||||
@@ -981,28 +976,21 @@ public class MogoServices implements IMogoMapListener,
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
if ( size == 0 ) {
|
||||
mUiController.showMyLocation( !mNavi.isNaviing() );
|
||||
AIAssist.getInstance( mContext ).unregisterUnWakeupCommand( ServiceConst.CMD_BACK );
|
||||
// 控制SearchUIShow 打点逻辑
|
||||
mStatusManager.setSearchUIShow( TAG, false );
|
||||
if ( mNavi.isNaviing() ) {
|
||||
mUiController.setPointToCenter( 0.675926, 0.77552 );
|
||||
} else {
|
||||
mUiController.setPointToCenter( 0.66145, 0.661094 );
|
||||
}
|
||||
mUiController.showMyLocation( !mNavi.isNaviing() );
|
||||
AIAssist.getInstance( mContext ).unregisterUnWakeupCommand( ServiceConst.CMD_BACK );
|
||||
// 控制SearchUIShow 打点逻辑
|
||||
setMarkerStatus(false);
|
||||
mUiController.recoverLockMode();
|
||||
} else {
|
||||
mUiController.showMyLocation( false );
|
||||
AIAssist.getInstance( mContext )
|
||||
.registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
AIAssist.getInstance( mContext ).registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
mStatusManager.setSearchUIShow( TAG, true );
|
||||
mUiController.setPointToCenter( 0.5, 0.5 );
|
||||
setMarkerStatus(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void setMarkerStatus( boolean show ) {
|
||||
mStatusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user