This commit is contained in:
wangcongtao
2020-06-12 11:55:48 +08:00
parent f29bcab11d
commit a411944a29
10 changed files with 77 additions and 44 deletions

View File

@@ -103,6 +103,13 @@ public interface IMogoStatusManager extends IProvider {
*/
boolean isUploading();
/**
* 主页是否已启动
*
* @return
*/
boolean isMainPageLaunched();
/**
* 设置小智语音UI状态
*
@@ -207,6 +214,14 @@ public interface IMogoStatusManager extends IProvider {
*/
void setUploadingStatus( String tag, boolean uploading );
/**
* 设置主页是否启动
*
* @param tag
* @param launched
*/
void setMainPageLaunchedStatus( String tag, boolean launched );
/**
* 注册监听
*

View File

@@ -73,5 +73,10 @@ public enum StatusDescriptor {
/**
* 上报状态
*/
UPLOADING;
UPLOADING,
/**
* 是否已经进入过主页
*/
MAIN_PAGE_CREATED;
}

View File

@@ -116,6 +116,11 @@ public class MogoStatusManager implements IMogoStatusManager {
return get_bool_val( StatusDescriptor.UPLOADING );
}
@Override
public boolean isMainPageLaunched() {
return get_bool_val( StatusDescriptor.MAIN_PAGE_CREATED );
}
private boolean get_bool_val( StatusDescriptor descriptor ) {
Boolean val = mStatus.get( descriptor );
return val == null ? false : val;
@@ -193,6 +198,11 @@ public class MogoStatusManager implements IMogoStatusManager {
doSetStatus( tag, StatusDescriptor.UPLOADING, uploading );
}
@Override
public void setMainPageLaunchedStatus( String tag, boolean launched ) {
doSetStatus( tag, StatusDescriptor.MAIN_PAGE_CREATED, launched );
}
private void doSetStatus( String tag, StatusDescriptor target, boolean value ) {
mStatus.put( target, value );
invokeStatusChangedListener( target, value );