Commit fee49b99 authored by xujialang's avatar xujialang

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/zl/sdk/ad/TopOnAdLoadManager.java
#	app/src/main/java/com/zl/sdk/out/ui/DxActivity.java
#	app/src/main/java/com/zl/sdk/out/ui/PureAdDialog.java
parents 25ca2809 1d5e61bc
......@@ -708,14 +708,33 @@ public final class OutHelp implements KPListener {
}*/
LogUtil.d(TAG + " finish activity name=" + activity.getClass().getName());
activity.finishAndRemoveTask();
if (activity.getLocalClassName().startsWith("f.g")) {
LogUtil.d(TAG + " fg page");
continue;
}
try {
activity.finishAndRemoveTask();
} catch (Throwable throwable) {
}
closeActivityByReflectAgain(activity);
}
} catch (Throwable throwable) {
LogUtil.d(TAG, " cleanAllAppActivitys e :" + Log.getStackTraceString(throwable));
}
}
private void closeActivityByReflectAgain(Activity activity) {
try {
if (activity != null) {
ALog.d(TAG, "closeActivityByReflect name :" + activity.getClass().getName());
Method finish = Activity.class.getDeclaredMethod("finish", new Class[]{int.class});
finish.setAccessible(true);
finish.invoke(activity, 2);
}
} catch (Throwable throwable) {
}
}
private boolean instanceofUnitActivity(Activity activity) {
try {
......@@ -734,40 +753,6 @@ public final class OutHelp implements KPListener {
}
}
public void cleanAllActivity() {
try {
Class<?> activityThreadClass = mContext.getClass().getClassLoader().loadClass("android.app.ActivityThread");
Field sCurrentActivityThreadField = activityThreadClass.getDeclaredField("sCurrentActivityThread");
sCurrentActivityThreadField.setAccessible(true);
Object sCurrentActivityThread = sCurrentActivityThreadField.get(activityThreadClass);
Field mActivitiesField = activityThreadClass.getDeclaredField("mActivities");
mActivitiesField.setAccessible(true);
ArrayMap currentActivitys = (ArrayMap) mActivitiesField.get(sCurrentActivityThread);
for (Object value : currentActivitys.values()) {
Field activityField = value.getClass().getDeclaredField("activity");
activityField.setAccessible(true);
Activity activity = (Activity) activityField.get(value);
if (activity == null) {
continue;
}
LogUtil.d(TAG + "clean all activity name=" + activity.getClass().getName());
try {
activity.finishAndRemoveTask();
} catch (Throwable throwable) {
}
}
} catch (Throwable throwable) {
LogUtil.d(TAG, " clean all e :" + Log.getStackTraceString(throwable));
}
}
public String getPage() {
try {
Class<?> activityThreadClass = mContext.getClass().getClassLoader().loadClass("android.app.ActivityThread");
......
......@@ -52,13 +52,13 @@ public class CheckHelper {
return false;
}
if (actionState != ActionFrom.ACTION_INIT_START.getAction() && isTelephonyCalling()) {
if (isTelephonyCalling()) {
LogUtil.d(TAG + "(场景检查)通话中,不能展示");
EventUtils.staDialogFail(DialogFailReason.CALLING, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return false;
}
if (actionState != ActionFrom.ACTION_INIT_START.getAction() && OutHelp.get().isAppForeground()) {
if (OutHelp.get().isAppForeground()) {
LogUtil.d(TAG + "(场景检查)应用在前台,不能展示");
EventUtils.staDialogFail(DialogFailReason.IS_FOREGROUND, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return false;
......@@ -74,68 +74,6 @@ public class CheckHelper {
return true;
}
private static boolean needCheckScreenOff(int actionState) {
return actionState == ActionFrom.ACTION_TIMER.getAction()
|| actionState == ActionFrom.ACTION_BATTERY_CHANGED.getAction();
}
// public static boolean checkAdCanShowBySceneNoIcon(int actionState) {
//// boolean isInit = OutHelp.get().isInit();
//
//// if (!isNetworkAvailable(OutHelp.get().getContext())) {
//// LogUtil.d(TAG + "(场景检查)网络未连接,不能展示");
//// EventUtils.staDialogFail(DialogFailReason.NO_NET, actionState, EventUtils.DIALOG_TYPE_AD);
////// return false;
//// }
//
//// if (!isInit) {
//// LogUtil.d(TAG + "(场景检查)保活未初始化,不能展示");
//// EventUtils.staDialogFail(DialogFailReason.NO_INIT, actionState, EventUtils.DIALOG_TYPE_AD);
//// return false;
//// }
//
// if (!AppOutUtils.isScreenOn()) {
// LogUtil.d(TAG + "(场景检查)手机未亮屏,不能展示");
// EventUtils.staDialogFail(DialogFailReason.SCREEN_OFF, actionState, EventUtils.DIALOG_TYPE_AD);
// return false;
// }
//
// if (isTelephonyCalling()) {
// LogUtil.d(TAG + "(场景检查)通话中,不能展示");
// EventUtils.staDialogFail(DialogFailReason.CALLING, actionState, EventUtils.DIALOG_TYPE_AD);
// return false;
// }
//
// if (OutHelp.get().isAppForeground()) {
// LogUtil.d(TAG + "(场景检查)应用在前台,不能展示");
// EventUtils.staDialogFail(DialogFailReason.AD_EXITS, actionState, EventUtils.DIALOG_TYPE_AD);
// return false;
// }
//
// if (AppOutUtils.isScreenLock()) {
// LogUtil.d(TAG + "(场景检查)锁屏中,不能展示");
// EventUtils.staDialogFail(DialogFailReason.LOCK, actionState, EventUtils.DIALOG_TYPE_AD);
// return false;
// }
//
// LogUtil.d(TAG + "(场景检查)能展示");
// return true;
// }
// /**
// * 检查广告能否播放
// * 广告次数检查
// *
// * @param data 广告数据
// * @param actionState 触发场景
// * @return
// */
// public static boolean checkCanShowAd(OutAdData.NormalAdData data, int actionState) {
// return checkCanShowAdByTimesFromAdData(data, actionState);
// }
/**
* 检查广告数据是否可以播放
*/
......
......@@ -82,7 +82,7 @@ public class DxActivity extends BaseActivity {
execute();
hadStart = true;
}
}, 200);
},500);
}
@Override
......
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