add socket status listener and remove unfitable code
This commit is contained in:
@@ -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 业务类型
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -53,5 +53,9 @@ public enum StatusDescriptor {
|
||||
*/
|
||||
VR_MODE,
|
||||
|
||||
/**
|
||||
* 云 Socket状态
|
||||
*/
|
||||
CLOUD_SOCKET
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user