add socket status listener and remove unfitable code

This commit is contained in:
zhongchao
2022-12-02 11:03:34 +08:00
parent 75cd5fb61d
commit 60094ced77
10 changed files with 35 additions and 146 deletions

View File

@@ -58,6 +58,19 @@ public interface IMogoStatusManager extends IProvider {
*/
boolean isMainPageLaunched();
/**
* 长链是否在线
* @return
*/
boolean isSocketOnLine();
/**
* 设置云端 socket 状态
* @param tag 业务类型
* @param mode true - 在线 false 不在线
*/
void setCloudSocketMode(String tag, boolean mode);
/**
* 设置vrMode状态
* @param tag 业务类型

View File

@@ -83,6 +83,16 @@ public class MogoStatusManager implements IMogoStatusManager {
return get_bool_val(StatusDescriptor.MAIN_PAGE_CREATED);
}
@Override
public boolean isSocketOnLine() {
return get_bool_val(StatusDescriptor.CLOUD_SOCKET);
}
@Override
public void setCloudSocketMode(String tag, boolean mode) {
doSetStatus(tag, StatusDescriptor.CLOUD_SOCKET, mode);
}
private boolean get_bool_val(StatusDescriptor descriptor) {
Boolean val = mStatus.get(descriptor);
return val != null && val;

View File

@@ -53,5 +53,9 @@ public enum StatusDescriptor {
*/
VR_MODE,
/**
* 云 Socket状态
*/
CLOUD_SOCKET
}