Commit 6b89a81c authored by xujialang's avatar xujialang

icon状态入口完善-2

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