opt
This commit is contained in:
@@ -73,9 +73,16 @@ public class MogoServicePaths {
|
||||
|
||||
/**
|
||||
* 免唤醒语音控制
|
||||
*
|
||||
* @deprecated use {@link #PATH_INTENT_MANAGER} instead.
|
||||
*/
|
||||
public static final String PATH_VOICE_MANAGER = "/voicemanager/api";
|
||||
|
||||
/**
|
||||
* 意图控制接口
|
||||
*/
|
||||
public static final String PATH_INTENT_MANAGER = "/intentmanager/api";
|
||||
|
||||
/**
|
||||
* 基础功能监听回调注册
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,13 @@ public interface IMogoFragmentManager extends IProvider {
|
||||
*/
|
||||
void pop();
|
||||
|
||||
/**
|
||||
* 栈大小
|
||||
*
|
||||
* @return 栈内的 fragment 数量
|
||||
*/
|
||||
int getStackSize();
|
||||
|
||||
/**
|
||||
* 退出栈中所有fragment
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.service.intent;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 免唤醒语音监听
|
||||
*/
|
||||
public interface IMogoIntentListener {
|
||||
|
||||
/**
|
||||
* @param intentStr 广播action、语音 command
|
||||
* @param intent 意图
|
||||
*/
|
||||
void onIntentReceived( String intentStr, Intent intent );
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.mogo.service.intent;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 免唤醒语音控制
|
||||
*/
|
||||
public interface IMogoIntentManager extends IProvider {
|
||||
|
||||
/**
|
||||
* 注册意图接收者
|
||||
*
|
||||
* @param intent
|
||||
*/
|
||||
public void registerIntentListener( String intent, IMogoIntentListener listener );
|
||||
|
||||
/**
|
||||
* 注册意图接收者
|
||||
*
|
||||
* @param intent
|
||||
*/
|
||||
public void unregisterIntentListener( String intent );
|
||||
|
||||
/**
|
||||
* 触发意图回调,各业务不用关心
|
||||
*
|
||||
* @param intentStr
|
||||
* @param intent
|
||||
*/
|
||||
public void invoke( String intentStr, Intent intent );
|
||||
}
|
||||
@@ -2,19 +2,15 @@ package com.mogo.service.voice;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 免唤醒语音监听
|
||||
* use {@link IMogoIntentListener} instead.
|
||||
*/
|
||||
public interface IMogoVoiceListener {
|
||||
|
||||
/**
|
||||
* 回调语音意图
|
||||
*
|
||||
* @param command 广播 command
|
||||
* @param intent 意图
|
||||
*/
|
||||
void onIntentReceived( String command, Intent intent );
|
||||
@Deprecated
|
||||
public interface IMogoVoiceListener extends IMogoIntentListener {
|
||||
}
|
||||
|
||||
@@ -2,35 +2,17 @@ package com.mogo.service.voice;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 免唤醒语音控制
|
||||
* <p>
|
||||
* use {@link IMogoIntentManager} instead.
|
||||
*/
|
||||
public interface IMogoVoiceManager extends IProvider {
|
||||
|
||||
/**
|
||||
* 注册意图接收者
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
void registerIntentListener( String command, IMogoVoiceListener listener );
|
||||
|
||||
/**
|
||||
* 注册意图接收者
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
void unregisterIntentListener( String command );
|
||||
|
||||
/**
|
||||
* 触发意图回调,各业务不用关心
|
||||
*
|
||||
* @param command
|
||||
* @param intent
|
||||
*/
|
||||
void invoke( String command, Intent intent );
|
||||
@Deprecated
|
||||
public interface IMogoVoiceManager extends IMogoIntentManager {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user