dev
This commit is contained in:
@@ -58,6 +58,7 @@ import com.mogo.service.module.MogoAction;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -838,7 +839,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
* 切换卡片
|
||||
*/
|
||||
private void switchCard2( String card ) {
|
||||
if ( isApplicationBroughtToBackground( mContext ) ) {
|
||||
if ( AppUtils.isApplicationBroughtToBackground( mContext ) ) {
|
||||
mLauncher.backToLauncher( mContext );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
if ( mStatusManager.isADASShow() ) {
|
||||
@@ -855,18 +856,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isApplicationBroughtToBackground( final Context context ) {
|
||||
ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningTaskInfo > tasks = am.getRunningTasks( 1 );
|
||||
if ( !tasks.isEmpty() ) {
|
||||
ComponentName topActivity = tasks.get( 0 ).topActivity;
|
||||
if ( !topActivity.getPackageName().equals( context.getPackageName() ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void changeCarHeadstockDirection( final double degree ) {
|
||||
if ( mNavi.isNaviing() ) {
|
||||
return;
|
||||
@@ -940,11 +929,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
if ( TextUtils.equals( ServiceConst.CMD_UN_WAKE_PREV, cmd ) ) {
|
||||
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(),
|
||||
MogoAction.Prev );
|
||||
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(), MogoAction.Prev );
|
||||
} else if ( TextUtils.equals( ServiceConst.CMD_UN_WAKE_NEXT, cmd ) ) {
|
||||
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(),
|
||||
MogoAction.Next );
|
||||
mActionManager.invoke( MapMarkerManager.getInstance().getCurrentModuleName(), MogoAction.Next );
|
||||
} else if ( TextUtils.equals( ServiceConst.CMD_UN_WAKEUP_MY_LOCATION, cmd ) ) {
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
|
||||
Reference in New Issue
Block a user