opt
This commit is contained in:
@@ -15,6 +15,7 @@ import android.os.Message;
|
||||
import android.os.Trace;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -48,6 +49,7 @@ 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;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
@@ -85,7 +87,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoIntentListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoVoiceCmdCallBack {
|
||||
IMogoVoiceCmdCallBack,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
private boolean mInternalUnWakeupRegisterStatus = false;
|
||||
|
||||
@@ -310,6 +313,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
mLauncher = apis.getLauncherApi();
|
||||
mFragmentManager = apis.getFragmentManagerApi();
|
||||
mCardManager = apis.getCardManagerApi();
|
||||
|
||||
mFragmentManager.addMainFragmentStackTransactionListener( this );
|
||||
initWorkThread();
|
||||
}
|
||||
|
||||
@@ -633,17 +638,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
case ADAS_UI:
|
||||
try {
|
||||
if ( isTrue ) {
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
onAdasOn();
|
||||
} else {
|
||||
// 主动刷新
|
||||
refreshStrategy();
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
onAdasClosed();
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
@@ -659,6 +656,21 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
|
||||
private void onAdasOn(){
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
}
|
||||
|
||||
private void onAdasClosed(){
|
||||
refreshStrategy();
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
public void restartAutoRefreshAtTime( int time ) {
|
||||
if ( time < 0 ) {
|
||||
Logger.w( TAG, "ignore refresh request case time < 0" );
|
||||
@@ -798,6 +810,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
} else if ( MogoReceiver.ACTION_VOICE_READY.equals( command ) ) {
|
||||
AIAssist.getInstance( mContext ).flush();
|
||||
} else if ( ServiceConst.COMMAND_MY_LOCATION.equals( command ) ) {
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
}
|
||||
@@ -853,10 +868,17 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
UiThreadHandler.post( () -> {
|
||||
mUiController.showMyLocation( ( ( float ) degree ) );
|
||||
|
||||
mUiController.showMyLocation( inflateCursorView( degree ) );
|
||||
} );
|
||||
}
|
||||
|
||||
private View inflateCursorView( double degree ) {
|
||||
View view = View.inflate( mContext, R.layout.map_amap_cursor, null );
|
||||
view.setRotation( ( float ) degree );
|
||||
return view;
|
||||
}
|
||||
|
||||
private void changeMyLocation( CarStateInfo.ValuesBean valuesBean ) {
|
||||
if ( valuesBean == null ) {
|
||||
return;
|
||||
@@ -903,6 +925,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
}
|
||||
} else if ( TextUtils.equals( ServiceConst.CMD_BACK, cmd ) ) {
|
||||
mFragmentManager.clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -925,4 +949,13 @@ public class MogoServices implements IMogoMapListener,
|
||||
public void onSpeakSelectTimeOut( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
if ( size == 0 ) {
|
||||
AIAssist.getInstance( mContext ).unregisterUnWakeupCommand( ServiceConst.CMD_BACK );
|
||||
} else {
|
||||
AIAssist.getInstance( mContext ).registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,5 +149,8 @@ public class ServiceConst {
|
||||
"定位我的位置"
|
||||
};
|
||||
|
||||
public static final String CMD_BACK = "back";
|
||||
public static final String[] CMD_BACK_WORDS = new String[]{"关闭", "返回"};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -340,6 +340,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
|
||||
mLastDataResult = response.getResult();
|
||||
@@ -392,6 +396,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( TextUtils.isEmpty( mCurrentModuleName ) ) {
|
||||
// 默认大而全
|
||||
mCurrentModuleName = ServiceConst.CARD_TYPE_BUSINESS_OPERATION;
|
||||
|
||||
Reference in New Issue
Block a user