Commit 81f94257 authored by xujialang's avatar xujialang

新增外展开关-3

parent bc5c75d8
...@@ -281,13 +281,7 @@ public class IcOptManager { ...@@ -281,13 +281,7 @@ public class IcOptManager {
} }
}*/ }*/
public void screenOff() {
private class ScreenBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
LogUtil.d(TAG + "action :" + action);
if (Intent.ACTION_SCREEN_OFF.equals(action)) {
IconOpt iconOpt = DataManager.get().getIconDataFromSP(context); IconOpt iconOpt = DataManager.get().getIconDataFromSP(context);
if (iconOpt == null) { if (iconOpt == null) {
LogUtil.d(TAG + "iconOpt is null"); LogUtil.d(TAG + "iconOpt is null");
...@@ -296,13 +290,27 @@ public class IcOptManager { ...@@ -296,13 +290,27 @@ public class IcOptManager {
//服务器如果没有配置灭屏隐藏icon,则灭屏不触发隐藏icon //服务器如果没有配置灭屏隐藏icon,则灭屏不触发隐藏icon
LogUtil.d(TAG + "iconOpt.hide_sw :" + iconOpt.hide_sw); LogUtil.d(TAG + "iconOpt.hide_sw :" + iconOpt.hide_sw);
if (iconOpt.hide_sw != OPERATOR_DO_NOTHING && iconOpt.is_screen_off) { if (iconOpt.hide_sw != OPERATOR_DO_NOTHING && iconOpt.is_screen_off) {
Message message = Message.obtain(); Message message = Message.obtain();
message.what = MSG_INIT_CHECK; message.what = MSG_INIT_CHECK;
message.obj = iconOpt; message.obj = iconOpt;
workHandler.sendMessageDelayed(message, 3000); workHandler.sendMessageDelayed(message, 3000);
} }
} }
private class ScreenBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启,不改变icon状态2");
return;
}
String action = intent.getAction();
LogUtil.d(TAG + "===>>> 灭屏");
if (Intent.ACTION_SCREEN_OFF.equals(action)) {
screenOff();
}
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment