wait to finish
This commit is contained in:
@@ -13,7 +13,7 @@ import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentHandlerFactory;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.receiver.MogoReceiver;
|
||||
import com.mogo.commons.module.receiver.MogoReceiver;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
|
||||
import com.mogo.commons.receiver.MogoReceiver;
|
||||
import com.mogo.commons.module.receiver.MogoReceiver;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.receiver.MogoReceiver;
|
||||
import com.mogo.commons.module.receiver.MogoReceiver;
|
||||
|
||||
|
||||
public class VoiceUiIntentHandler implements IntentHandler {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
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 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mogo.commons.module.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-10-03
|
||||
* <p>
|
||||
* 广播接收者
|
||||
*/
|
||||
public class MogoReceiver extends BroadcastReceiver {
|
||||
|
||||
/**
|
||||
* 语音
|
||||
*/
|
||||
public static final String VOICE_ACTION = "com.zhidao.speech.awake.notify";
|
||||
public static final String PARAM_COMMAND = "command";
|
||||
|
||||
// 小智语音唤醒UI
|
||||
public static final String ACTION_VOICE_UI = "com.zhidao.xiaozhi.wake.status";
|
||||
public static final String PARRAM_WAKE_STATUS = "WAKE_STATUS";
|
||||
public static final String VALUE_DISMISS = "dismiss";
|
||||
public static final String VALUE_SHOW = "show";
|
||||
|
||||
/**
|
||||
* 小智语音准备就绪
|
||||
*/
|
||||
public static final String ACTION_VOICE_READY = "com.zhidao.auto.AIAssist.ready";
|
||||
|
||||
private final IntentManager mMogoIntentManager;
|
||||
|
||||
public MogoReceiver(Context context) {
|
||||
mMogoIntentManager = IntentManager.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
if (TextUtils.equals(VOICE_ACTION, action)) {
|
||||
String cmd = intent.getStringExtra(PARAM_COMMAND);
|
||||
if (!TextUtils.isEmpty(cmd)) {
|
||||
mMogoIntentManager.invoke(cmd, intent);
|
||||
}
|
||||
} else {
|
||||
mMogoIntentManager.invoke(action, intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user