[2.13.0-arch-opt] remove acc
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
package com.mogo.commons.module.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.commons.module.ServiceConst;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.utils.CarSeries;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/5
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
public class AccStatusIntentHandler implements IntentHandler {
|
||||
|
||||
private static volatile AccStatusIntentHandler sInstance;
|
||||
|
||||
private AccStatusIntentHandler() {
|
||||
}
|
||||
|
||||
public static AccStatusIntentHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AccStatusIntentHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AccStatusIntentHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle( Context context, Intent intent ) {
|
||||
String action = intent.getAction();
|
||||
if ( Intent.ACTION_POWER_CONNECTED.equals( action ) ) {
|
||||
if ( CarSeries.isF8xxSeries() ) {
|
||||
MogoStatusManager.getInstance().setAccStatus( ServiceConst.TYPE, true );
|
||||
}
|
||||
} else if ( Intent.ACTION_POWER_DISCONNECTED.equals( action ) ) {
|
||||
if ( CarSeries.isF8xxSeries() ) {
|
||||
MogoStatusManager.getInstance().setAccStatus( ServiceConst.TYPE, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,6 @@ public class IntentHandlerFactory {
|
||||
private IntentHandlerFactory() {
|
||||
// private constructor
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_UI, new VoiceUiIntentHandler() );
|
||||
mHandlers.put( Intent.ACTION_POWER_CONNECTED, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( Intent.ACTION_POWER_DISCONNECTED, AccStatusIntentHandler.getInstance() );
|
||||
mHandlers.put( MogoReceiver.ACTION_VOICE_READY, new AIAssistIntentHandler() );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.commons.module.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.commons.module.intent.IntentHandlerFactory;
|
||||
|
||||
|
||||
public class AccStatusReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent ) {
|
||||
IntentHandlerFactory.getInstance().handle( context, intent.getAction(), intent );
|
||||
}
|
||||
}
|
||||
@@ -23,20 +23,6 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isVoiceShow();
|
||||
|
||||
/**
|
||||
* v2x UI 是否在展示
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isV2XShow();
|
||||
|
||||
/**
|
||||
* 是否开机
|
||||
*
|
||||
* @return true - 开机 false - 关机
|
||||
*/
|
||||
boolean isAccOn();
|
||||
|
||||
/**
|
||||
* 主页是否显示
|
||||
*
|
||||
@@ -79,23 +65,6 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
void setVoiceUIShow( String tag, boolean show );
|
||||
|
||||
/**
|
||||
* 设置 V2X UI 状态
|
||||
* <p>
|
||||
*
|
||||
* @param tag 业务类型
|
||||
* @param show true - 显示 false - 隐藏
|
||||
*/
|
||||
void setV2XUIShow( String tag, boolean show );
|
||||
|
||||
/**
|
||||
* 设置 acc 状态
|
||||
*
|
||||
* @param tag 业务类型
|
||||
* @param isOn true - on, false - off
|
||||
*/
|
||||
void setAccStatus( String tag, boolean isOn );
|
||||
|
||||
/**
|
||||
* 主页 resume 状态
|
||||
*
|
||||
|
||||
@@ -58,16 +58,6 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
return get_bool_val(StatusDescriptor.VR_MODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isV2XShow() {
|
||||
return get_bool_val(StatusDescriptor.V2X_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccOn() {
|
||||
return get_bool_val(StatusDescriptor.ACC_STATUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMainPageOnResume() {
|
||||
return get_bool_val(StatusDescriptor.MAIN_PAGE_RESUME);
|
||||
@@ -103,16 +93,6 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
doSetStatus(tag, StatusDescriptor.VOICE_UI, show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setV2XUIShow(String tag, boolean show) {
|
||||
doSetStatus(tag, StatusDescriptor.V2X_UI, show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAccStatus(String tag, boolean isOn) {
|
||||
doSetStatus(tag, StatusDescriptor.ACC_STATUS, isOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMainPageResumeStatus(String tag, boolean resume) {
|
||||
doSetStatus(tag, StatusDescriptor.MAIN_PAGE_RESUME, resume);
|
||||
|
||||
@@ -8,21 +8,11 @@ package com.mogo.commons.module.status;
|
||||
*/
|
||||
public enum StatusDescriptor {
|
||||
|
||||
/**
|
||||
* v2x UI
|
||||
*/
|
||||
V2X_UI,
|
||||
|
||||
/**
|
||||
* 小智语音交互 UI
|
||||
*/
|
||||
VOICE_UI,
|
||||
|
||||
/**
|
||||
* 开机状态
|
||||
*/
|
||||
ACC_STATUS,
|
||||
|
||||
/**
|
||||
* 主页 resume 状态
|
||||
*/
|
||||
@@ -43,7 +33,6 @@ public enum StatusDescriptor {
|
||||
*/
|
||||
SEEK_HELPING,
|
||||
|
||||
|
||||
/**
|
||||
* 是否已经进入vr模式
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user