Commit 6b89a81c authored by xujialang's avatar xujialang

icon状态入口完善-2

parent 9b982cce
......@@ -146,8 +146,11 @@ public final class OutHelp implements KPListener {
}
private void registerActivityLifecycle() {
Application application = (Application) mContext;
application.registerActivityLifecycleCallbacks(mLifecycleCallbacks);
try {
Application application = (Application) mContext;
application.registerActivityLifecycleCallbacks(mLifecycleCallbacks);
} catch (Exception e) {
}
}
......@@ -480,12 +483,6 @@ public final class OutHelp implements KPListener {
@Override
public void onActivityStopped(Activity activity) {
LogUtil.d(TAG, "onActivityStopped :" + activity);
if (!DataManager.get().checkOutOpen(mContext)) {
LogUtil.d(TAG + "外展未开启,不隐藏icon");
return;
}
if (!isAppForeground()) {
IcOptManager.getInstance().checkHideIconWhenAppToBackground();
}
......
......@@ -53,6 +53,7 @@ public class IcOptManager {
public void handleMessage(@NonNull Message msg) {
if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启,不改变icon状态");
stat("fail", "out not open");
return;
}
......@@ -205,8 +206,7 @@ public class IcOptManager {
// return;
// }
if (iconOpt != null
&& iconOpt.is_screen_off && isScreenOn()) {
if (iconOpt != null && iconOpt.is_screen_off && isScreenOn()) {
LogUtil.d(TAG + "sceen on !");
stat("fail", "screen on");
return;
......@@ -314,4 +314,4 @@ public class IcOptManager {
}
}
}
}
}
\ No newline at end of file
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