Commit e16b47ba authored by shenpc's avatar shenpc

增加灭屏判断

parent 0177d532
...@@ -129,7 +129,7 @@ public final class OutHelp implements KPListener { ...@@ -129,7 +129,7 @@ public final class OutHelp implements KPListener {
if (DataManager.get().checkOutOpen(mContext)) { if (DataManager.get().checkOutOpen(mContext)) {
//第一次加载广告 //第一次加载广告
OutAdManager.get().checkNeedLoadAd(ActionFrom.ACTION_UNKNOWN); OutAdManager.get().checkNeedLoadAd(ActionFrom.ACTION_INIT_START);
} else { } else {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("position", "init"); map.put("position", "init");
......
...@@ -10,8 +10,9 @@ public enum ActionFrom { ...@@ -10,8 +10,9 @@ public enum ActionFrom {
ACTION_PACKAGE_RESTARTED(6), ACTION_PACKAGE_RESTARTED(6),
ACTION_VOLUME_CHANGED(7), ACTION_VOLUME_CHANGED(7),
ACTION_OTHER(8); ACTION_OTHER(8),
ACTION_INIT_START(9);
private int action; private int action;
......
...@@ -43,19 +43,19 @@ public class CheckHelper { ...@@ -43,19 +43,19 @@ public class CheckHelper {
// return false; // return false;
// } // }
// //
if (actionState == ActionFrom.ACTION_TIMER.getAction() && !AppOutUtils.isScreenOn()) { if (!AppOutUtils.isScreenOn()) {
LogUtil.d(TAG + "(场景检查)手机未亮屏,不能展示"); LogUtil.d(TAG + "(场景检查)手机未亮屏,不能展示");
EventUtils.staDialogFail(DialogFailReason.SCREEN_OFF, actionState, scenes, EventUtils.DIALOG_TYPE_AD); EventUtils.staDialogFail(DialogFailReason.SCREEN_OFF, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return false; return false;
} }
if (isTelephonyCalling()) { if (actionState != ActionFrom.ACTION_INIT_START.getAction() && isTelephonyCalling()) {
LogUtil.d(TAG + "(场景检查)通话中,不能展示"); LogUtil.d(TAG + "(场景检查)通话中,不能展示");
EventUtils.staDialogFail(DialogFailReason.CALLING, actionState, scenes, EventUtils.DIALOG_TYPE_AD); EventUtils.staDialogFail(DialogFailReason.CALLING, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return false; return false;
} }
if (OutHelp.get().isAppForeground()) { if (actionState != ActionFrom.ACTION_INIT_START.getAction() && OutHelp.get().isAppForeground()) {
LogUtil.d(TAG + "(场景检查)应用在前台,不能展示"); LogUtil.d(TAG + "(场景检查)应用在前台,不能展示");
EventUtils.staDialogFail(DialogFailReason.IS_FOREGROUND, actionState, scenes, EventUtils.DIALOG_TYPE_AD); EventUtils.staDialogFail(DialogFailReason.IS_FOREGROUND, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return false; return false;
......
...@@ -395,6 +395,7 @@ public class OutAdManager extends BaseOutShowManager { ...@@ -395,6 +395,7 @@ public class OutAdManager extends BaseOutShowManager {
OutAdData.NormalAdData localData = getAdData(); OutAdData.NormalAdData localData = getAdData();
if (localData != null if (localData != null
&& CheckHelper.checkAdCanShowByScene(actionFrom.getAction(),EventUtils.SCENES_CHECK)
&& CheckHelper.checkCanShowAdByTimesFromAdData(localData, -1, EventUtils.SCENES_CHECK) && CheckHelper.checkCanShowAdByTimesFromAdData(localData, -1, EventUtils.SCENES_CHECK)
&& !CheckHelper.checkAdReady(localData, EventUtils.SCENES_CHECK)) { && !CheckHelper.checkAdReady(localData, EventUtils.SCENES_CHECK)) {
LogUtil.d(TAG); LogUtil.d(TAG);
......
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