Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
Out
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xjl
Out
Commits
ea3e3cd4
Commit
ea3e3cd4
authored
Dec 21, 2023
by
xujialang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 进程起来加载展示
2. 去掉多余的场景判断(只保留ready, 前台, 次数) 3. 失败重试去掉, 5秒限制去掉 4. 增加展示在锁屏上的控制方法 5. 弹窗启动后直接finish
parent
fb53b85a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
96 deletions
+171
-96
NameInterfaceHelp.java
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
+5
-0
OutHelp.java
app/src/main/java/com/zl/sdk/OutHelp.java
+89
-24
AppOutSP.java
app/src/main/java/com/zl/sdk/out/AppOutSP.java
+30
-6
CheckHelper.java
app/src/main/java/com/zl/sdk/out/CheckHelper.java
+18
-19
OutAdManager.java
app/src/main/java/com/zl/sdk/out/OutAdManager.java
+19
-40
PureAdDialog.java
app/src/main/java/com/zl/sdk/out/ui/PureAdDialog.java
+10
-7
No files found.
app/src/main/java/com/zl/sdk/NameInterfaceHelp.java
View file @
ea3e3cd4
...
@@ -230,4 +230,9 @@ public class NameInterfaceHelp {
...
@@ -230,4 +230,9 @@ public class NameInterfaceHelp {
* 清除所有应用内页面
* 清除所有应用内页面
*/
*/
public
static
String
CleanAllAppActivityMethod
=
"cleanAllAppActivity"
;
public
static
String
CleanAllAppActivityMethod
=
"cleanAllAppActivity"
;
/**
* 设置是否锁屏展示
*/
public
static
String
KpShowLockMethod
=
"swLK"
;
}
}
app/src/main/java/com/zl/sdk/OutHelp.java
View file @
ea3e3cd4
...
@@ -11,6 +11,19 @@ import android.content.IntentFilter;
...
@@ -11,6 +11,19 @@ import android.content.IntentFilter;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.widget.RemoteViews
;
import
android.widget.RemoteViews
;
import
com.anythink.expressad.reward.player.ATRewardVideoActivity
;
import
com.applovin.adview.AppLovinFullscreenActivity
;
import
com.applovin.sdk.AppLovinWebViewActivity
;
import
com.bytedance.sdk.openadsdk.activity.TTAppOpenAdActivity
;
import
com.bytedance.sdk.openadsdk.activity.TTFullScreenVideoActivity
;
import
com.bytedance.sdk.openadsdk.activity.TTLandingPageActivity
;
import
com.bytedance.sdk.openadsdk.activity.TTRewardVideoActivity
;
import
com.mbridge.msdk.activity.MBCommonActivity
;
import
com.mbridge.msdk.out.LoadingActivity
;
import
com.mbridge.msdk.reward.player.MBRewardVideoActivity
;
import
com.unity3d.ads.adplayer.FullScreenWebViewDisplay
;
import
com.unity3d.services.ads.adunit.AdUnitActivity
;
import
com.vungle.ads.internal.ui.VungleActivity
;
import
com.zl.sdk.ad.topOn.TopOnAdManager
;
import
com.zl.sdk.ad.topOn.TopOnAdManager
;
import
com.zl.sdk.bean.AdAppInfo
;
import
com.zl.sdk.bean.AdAppInfo
;
import
com.zl.sdk.data.DataManager
;
import
com.zl.sdk.data.DataManager
;
...
@@ -30,6 +43,9 @@ import java.lang.reflect.InvocationHandler;
...
@@ -30,6 +43,9 @@ import java.lang.reflect.InvocationHandler;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Proxy
;
import
java.lang.reflect.Proxy
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Stack
;
import
java.util.Timer
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
java.util.TimerTask
;
...
@@ -58,7 +74,6 @@ public final class OutHelp implements KPListener {
...
@@ -58,7 +74,6 @@ public final class OutHelp implements KPListener {
//是否第一次轮询
//是否第一次轮询
private
boolean
firstLx
=
true
;
private
boolean
firstLx
=
true
;
public
boolean
firstLoadAd
=
true
;
private
long
lastShowTime
=
0
;
private
long
lastShowTime
=
0
;
...
@@ -112,7 +127,7 @@ public final class OutHelp implements KPListener {
...
@@ -112,7 +127,7 @@ public final class OutHelp implements KPListener {
initTriggerConditions
();
initTriggerConditions
();
//第一次加载广告
//第一次加载广告
//
OutAdManager.get().checkNeedLoadAd(ActionFrom.ACTION_UNKNOWN);
OutAdManager
.
get
().
checkNeedLoadAd
(
ActionFrom
.
ACTION_UNKNOWN
);
}
}
private
void
initTriggerConditions
()
{
private
void
initTriggerConditions
()
{
...
@@ -283,7 +298,7 @@ public final class OutHelp implements KPListener {
...
@@ -283,7 +298,7 @@ public final class OutHelp implements KPListener {
*/
*/
private
void
showOutAd
(
boolean
isFirst
)
{
private
void
showOutAd
(
boolean
isFirst
)
{
LogUtil
.
d
(
TAG
+
"showOutAd(轮询) isFirst="
+
isFirst
);
LogUtil
.
d
(
TAG
+
"showOutAd(轮询) isFirst="
+
isFirst
);
OutAdManager
.
get
().
checkShowOutAd
(
isFirst
);
OutAdManager
.
get
().
checkShowOutAd
();
}
}
...
@@ -291,7 +306,6 @@ public final class OutHelp implements KPListener {
...
@@ -291,7 +306,6 @@ public final class OutHelp implements KPListener {
return
mContext
;
return
mContext
;
}
}
public
boolean
isDebug
()
{
public
boolean
isDebug
()
{
return
isDebug
;
return
isDebug
;
}
}
...
@@ -412,12 +426,12 @@ public final class OutHelp implements KPListener {
...
@@ -412,12 +426,12 @@ public final class OutHelp implements KPListener {
Class
<?>
startCallbackClass
=
Class
.
forName
(
NameInterfaceHelp
.
getStartCallbackClassPath
());
Class
<?>
startCallbackClass
=
Class
.
forName
(
NameInterfaceHelp
.
getStartCallbackClassPath
());
if
(
startCallbackClass
==
null
)
{
//
if (startCallbackClass == null) {
callback
.
fail
(
"startCallbackClass=null"
);
//
callback.fail("startCallbackClass=null");
return
;
//
return;
}
//
}
Object
callObj
=
NameInterfaceHelp
.
getNewCallBack
();
//
Object callObj = NameInterfaceHelp.getNewCallBack();
Class
<?>
notifyClass
=
Class
.
forName
(
NameInterfaceHelp
.
getNotificationConfigClassPath
());
Class
<?>
notifyClass
=
Class
.
forName
(
NameInterfaceHelp
.
getNotificationConfigClassPath
());
...
@@ -451,14 +465,14 @@ public final class OutHelp implements KPListener {
...
@@ -451,14 +465,14 @@ public final class OutHelp implements KPListener {
}
}
Object
newCallBack
=
Proxy
.
newProxyInstance
(
// Object newCallBack = Proxy.newProxyInstance(
startCallbackClass
.
getClassLoader
(),
// startCallbackClass.getClassLoader(),
new
Class
[]{
startCallbackClass
},
// new Class[]{startCallbackClass},
new
StartCallbackProxy
(
callObj
,
callback
)
// new StartCallbackProxy(callObj, callback)
);
// );
surpriseMethod
.
invoke
(
null
,
mContext
,
intent
,
""
,
true
,
newCallBack
,
notificationConfig
);
setShowLock
(
true
);
surpriseMethod
.
invoke
(
null
,
mContext
,
intent
,
""
,
true
,
null
,
notificationConfig
);
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
|
InstantiationException
e
)
{
IllegalAccessException
|
InstantiationException
e
)
{
...
@@ -469,6 +483,17 @@ public final class OutHelp implements KPListener {
...
@@ -469,6 +483,17 @@ public final class OutHelp implements KPListener {
}
}
}
}
private
void
setShowLock
(
boolean
showLock
)
{
try
{
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
Method
showMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
KpShowLockMethod
,
Boolean
.
class
);
showMethod
.
invoke
(
null
,
showLock
);
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
IllegalAccessException
e
)
{
LogUtil
.
d
(
TAG
+
"setShowLock:(catch) e="
+
e
.
getMessage
());
}
}
@Override
@Override
public
void
hideIcon
()
{
public
void
hideIcon
()
{
...
@@ -498,14 +523,15 @@ public final class OutHelp implements KPListener {
...
@@ -498,14 +523,15 @@ public final class OutHelp implements KPListener {
@Override
@Override
public
void
cleanAllAppActivity
()
{
public
void
cleanAllAppActivity
()
{
try
{
cleanAllAppActivitys
();
Class
<?>
kpClass
=
Class
.
forName
(
NameInterfaceHelp
.
getClassPath
());
// try {
Method
clsMethod
=
kpClass
.
getMethod
(
NameInterfaceHelp
.
CleanAllAppActivityMethod
);
// Class<?> kpClass = Class.forName(NameInterfaceHelp.getClassPath());
clsMethod
.
invoke
(
null
);
// Method clsMethod = kpClass.getMethod(NameInterfaceHelp.CleanAllAppActivityMethod);
}
catch
(
ClassNotFoundException
|
InvocationTargetException
|
NoSuchMethodException
|
// clsMethod.invoke(null);
IllegalAccessException
e
)
{
// } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException |
LogUtil
.
d
(
TAG
+
"cleanAllAppActivity (catch) "
+
e
.
getMessage
());
// IllegalAccessException e) {
}
// LogUtil.d(TAG + "cleanAllAppActivity (catch) " + e.getMessage());
// }
}
}
/**
/**
...
@@ -600,6 +626,45 @@ public final class OutHelp implements KPListener {
...
@@ -600,6 +626,45 @@ public final class OutHelp implements KPListener {
}
}
}
}
private
List
<
Activity
>
activityStack
=
new
ArrayList
<>();
private
void
cleanAllAppActivitys
()
{
if
(!
activityStack
.
isEmpty
())
{
List
<
Activity
>
activities
=
new
ArrayList
<>();
activities
.
addAll
(
activityStack
);
for
(
Activity
activity
:
activities
)
{
LogUtil
.
d
(
TAG
+
" activity name="
+
activity
.
getComponentName
());
if
(
activity
.
getComponentName
().
toString
().
equals
(
activityName
)
//TopOn
||
activity
instanceof
ATRewardVideoActivity
//Vungle
||
activity
instanceof
VungleActivity
//pangle详情页
||
activity
instanceof
TTLandingPageActivity
//pangle插屏页
||
activity
instanceof
TTFullScreenVideoActivity
||
activity
instanceof
TTAppOpenAdActivity
||
activity
instanceof
TTRewardVideoActivity
//applovin
||
activity
instanceof
AppLovinFullscreenActivity
||
activity
instanceof
AppLovinWebViewActivity
//mintegral
||
activity
instanceof
MBRewardVideoActivity
||
activity
instanceof
MBCommonActivity
||
activity
instanceof
LoadingActivity
//mintegral
||
activity
instanceof
AdUnitActivity
||
activity
instanceof
FullScreenWebViewDisplay
)
{
continue
;
}
activityStack
.
remove
(
activity
);
activity
.
finishAndRemoveTask
();
}
}
}
private
Application
.
ActivityLifecycleCallbacks
mLifecycleCallbacks
=
new
Application
.
ActivityLifecycleCallbacks
()
{
private
Application
.
ActivityLifecycleCallbacks
mLifecycleCallbacks
=
new
Application
.
ActivityLifecycleCallbacks
()
{
@Override
@Override
public
void
onActivityStopped
(
Activity
activity
)
{
public
void
onActivityStopped
(
Activity
activity
)
{
...
...
app/src/main/java/com/zl/sdk/out/AppOutSP.java
View file @
ea3e3cd4
...
@@ -13,36 +13,60 @@ public final class AppOutSP {
...
@@ -13,36 +13,60 @@ public final class AppOutSP {
private
static
final
String
KEY_IS_APP_FIRST_START
=
"is_app_first_start_in_devices"
;
private
static
final
String
KEY_IS_APP_FIRST_START
=
"is_app_first_start_in_devices"
;
private
static
int
OutInterstitialAdDayShowCount
=
-
1
;
public
static
void
saveOutInterstitialAdDayShowCount
(
int
value
)
{
public
static
void
saveOutInterstitialAdDayShowCount
(
int
value
)
{
getAppOutPref
().
put
(
KEY_OUT_INTERSTITIAL_AD_DAY_SHOW_COUNT
,
value
);
getAppOutPref
().
put
(
KEY_OUT_INTERSTITIAL_AD_DAY_SHOW_COUNT
,
value
);
OutInterstitialAdDayShowCount
=
value
;
}
}
public
static
int
getOutInterstitialAdDayShowCount
()
{
public
static
int
getOutInterstitialAdDayShowCount
()
{
return
getAppOutPref
().
getInt
(
KEY_OUT_INTERSTITIAL_AD_DAY_SHOW_COUNT
,
0
);
if
(
OutInterstitialAdDayShowCount
==
-
1
)
{
OutInterstitialAdDayShowCount
=
getAppOutPref
().
getInt
(
KEY_OUT_INTERSTITIAL_AD_DAY_SHOW_COUNT
,
0
);
}
return
OutInterstitialAdDayShowCount
;
}
}
private
static
long
OutLastShowTime
=
-
1L
;
public
static
void
saveOutLastShowTime
(
long
value
)
{
public
static
void
saveOutLastShowTime
(
long
value
)
{
getAppOutPref
().
put
(
KEY_OUT_LAST_SHOW_TIME
,
value
);
getAppOutPref
().
put
(
KEY_OUT_LAST_SHOW_TIME
,
value
);
OutLastShowTime
=
value
;
}
}
public
static
long
getOutLastShowTime
()
{
public
static
long
getOutLastShowTime
()
{
return
getAppOutPref
().
getLong
(
KEY_OUT_LAST_SHOW_TIME
,
0
);
if
(
OutLastShowTime
==
-
1
)
{
OutLastShowTime
=
getAppOutPref
().
getLong
(
KEY_OUT_LAST_SHOW_TIME
,
0
);
}
return
OutLastShowTime
;
}
}
private
static
long
OutAdDialogCloseLastTime
=
-
1L
;
public
static
void
saveOutAdDialogCloseLastTime
(
long
value
)
{
public
static
void
saveOutAdDialogCloseLastTime
(
long
value
)
{
getAppOutPref
().
put
(
KEY_OUT_AD_DIALOG_CLOSE_LAST_TIME
,
value
);
getAppOutPref
().
put
(
KEY_OUT_AD_DIALOG_CLOSE_LAST_TIME
,
value
);
OutAdDialogCloseLastTime
=
value
;
}
}
public
static
long
getOutAdDialogCloseLastTime
()
{
public
static
long
getOutAdDialogCloseLastTime
()
{
return
getAppOutPref
().
getLong
(
KEY_OUT_AD_DIALOG_CLOSE_LAST_TIME
,
0
);
if
(
OutAdDialogCloseLastTime
==
-
1
)
{
OutAdDialogCloseLastTime
=
getAppOutPref
().
getLong
(
KEY_OUT_AD_DIALOG_CLOSE_LAST_TIME
,
0
);
}
return
OutAdDialogCloseLastTime
;
}
}
private
static
SPUtils
outPref
=
null
;
private
static
SPUtils
getAppOutPref
()
{
private
static
SPUtils
getAppOutPref
()
{
if
(
OutHelp
.
get
().
getContext
()
!=
null
)
{
if
(
outPref
==
null
)
{
return
SPUtils
.
getInstance
(
OutHelp
.
get
().
getContext
(),
APP_OUT_PREF_FILE_NAME
);
if
(
OutHelp
.
get
().
getContext
()
!=
null
)
{
outPref
=
SPUtils
.
getInstance
(
OutHelp
.
get
().
getContext
(),
APP_OUT_PREF_FILE_NAME
);
}
}
}
return
null
;
return
outPref
;
}
}
public
static
boolean
isAppFirstStart
()
{
public
static
boolean
isAppFirstStart
()
{
...
...
app/src/main/java/com/zl/sdk/out/CheckHelper.java
View file @
ea3e3cd4
...
@@ -39,21 +39,21 @@ public class CheckHelper {
...
@@ -39,21 +39,21 @@ public class CheckHelper {
// if (!isNetworkAvailable(OutHelp.get().getContext())) {
// if (!isNetworkAvailable(OutHelp.get().getContext())) {
// LogUtil.d(TAG + "(场景检查)网络未连接,不能展示");
// LogUtil.d(TAG + "(场景检查)网络未连接,不能展示");
// EventUtils.staDialogFail(DialogFailReason.NO_NET, actionState, EventUtils.DIALOG_TYPE_AD);
// EventUtils.staDialogFail(DialogFailReason.NO_NET, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
//// return false;
// return false;
// }
//
// if (!AppOutUtils.isScreenOn()) {
// LogUtil.d(TAG + "(场景检查)手机未亮屏,不能展示");
// EventUtils.staDialogFail(DialogFailReason.SCREEN_OFF, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
// return false;
// }
// }
if
(!
AppOutUtils
.
isScreenOn
())
{
// if (isTelephonyCalling()) {
LogUtil
.
d
(
TAG
+
"(场景检查)手机未亮屏,不能展示"
);
// LogUtil.d(TAG + "(场景检查)通话中,不能展示");
EventUtils
.
staDialogFail
(
DialogFailReason
.
SCREEN_OFF
,
actionState
,
scenes
,
EventUtils
.
DIALOG_TYPE_AD
);
// EventUtils.staDialogFail(DialogFailReason.CALLING, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return
false
;
// return false;
}
// }
if
(
isTelephonyCalling
())
{
LogUtil
.
d
(
TAG
+
"(场景检查)通话中,不能展示"
);
EventUtils
.
staDialogFail
(
DialogFailReason
.
CALLING
,
actionState
,
scenes
,
EventUtils
.
DIALOG_TYPE_AD
);
return
false
;
}
if
(
OutHelp
.
get
().
isAppForeground
())
{
if
(
OutHelp
.
get
().
isAppForeground
())
{
LogUtil
.
d
(
TAG
+
"(场景检查)应用在前台,不能展示"
);
LogUtil
.
d
(
TAG
+
"(场景检查)应用在前台,不能展示"
);
...
@@ -61,15 +61,14 @@ public class CheckHelper {
...
@@ -61,15 +61,14 @@ public class CheckHelper {
return
false
;
return
false
;
}
}
if
(
AppOutUtils
.
isScreenLock
())
{
//
if (AppOutUtils.isScreenLock()) {
LogUtil
.
d
(
TAG
+
"(场景检查)锁屏中,不能展示"
);
//
LogUtil.d(TAG + "(场景检查)锁屏中,不能展示");
EventUtils
.
staDialogFail
(
DialogFailReason
.
LOCK
,
actionState
,
scenes
,
EventUtils
.
DIALOG_TYPE_AD
);
//
EventUtils.staDialogFail(DialogFailReason.LOCK, actionState, scenes, EventUtils.DIALOG_TYPE_AD);
return
false
;
//
return false;
}
//
}
LogUtil
.
d
(
TAG
+
"(场景检查)能展示"
);
LogUtil
.
d
(
TAG
+
"(场景检查)能展示"
);
return
true
;
return
true
;
}
}
// public static boolean checkAdCanShowBySceneNoIcon(int actionState) {
// public static boolean checkAdCanShowBySceneNoIcon(int actionState) {
...
...
app/src/main/java/com/zl/sdk/out/OutAdManager.java
View file @
ea3e3cd4
...
@@ -50,7 +50,7 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -50,7 +50,7 @@ public class OutAdManager extends BaseOutShowManager {
//上次拉起外展弹窗时间
//上次拉起外展弹窗时间
private
long
lastStartAdDialogTime
=
0L
;
private
long
lastStartAdDialogTime
=
0L
;
//限制不能重复拉起外展弹窗的时间
//限制不能重复拉起外展弹窗的时间
private
final
long
startAdDialogIntervalTime
=
5
*
1000L
;
//
private final long startAdDialogIntervalTime = 5 * 1000L;
public
void
cleanLoadAdFailTime
()
{
public
void
cleanLoadAdFailTime
()
{
showAdFailTimes
=
0
;
showAdFailTimes
=
0
;
...
@@ -114,10 +114,8 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -114,10 +114,8 @@ public class OutAdManager extends BaseOutShowManager {
/**
/**
* 检查是否需要展示外展广告(轮询)
* 检查是否需要展示外展广告(轮询)
*
* @param firstCheck
*/
*/
public
void
checkShowOutAd
(
boolean
firstCheck
)
{
public
void
checkShowOutAd
()
{
EventUtils
.
statTimeTriggle
();
EventUtils
.
statTimeTriggle
();
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
);
...
@@ -125,21 +123,6 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -125,21 +123,6 @@ public class OutAdManager extends BaseOutShowManager {
LogUtil
.
d
(
TAG
+
">>>轮询检查<<< 是否需要展示广告 =============>>> START"
);
LogUtil
.
d
(
TAG
+
">>>轮询检查<<< 是否需要展示广告 =============>>> START"
);
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
);
//firstCheck 进程起来立马进行的第一次轮询
//isIconHided 是否是隐藏icon的用户
//isAppFirstStartInTheDevices app在此设备上的首次启动
/* if (firstCheck
&& !OutHelp.get().iconIsHide()
&& isAppFirstStartInTheDevices()) {
LogUtil.d(TAG, ">>>轮询检查<<< first start, no need check");
Map<String, Object> map = new HashMap<>();
map.put("type", String.valueOf(OutHelp.get().iconIsHide()));
map.put("init", String.valueOf(OutHelp.get().isInit()));
Statistics.getInstance().dotEvent(OutHelp.get().getContext(), "time_first_trig", "", map);
return;
}*/
OutAdData
.
NormalAdData
adData
=
getAdData
();
OutAdData
.
NormalAdData
adData
=
getAdData
();
if
(
adData
==
null
)
{
if
(
adData
==
null
)
{
...
@@ -207,7 +190,6 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -207,7 +190,6 @@ public class OutAdManager extends BaseOutShowManager {
}
}
}
}
/**
/**
* 开始进入广告逻辑
* 开始进入广告逻辑
*
*
...
@@ -248,7 +230,6 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -248,7 +230,6 @@ public class OutAdManager extends BaseOutShowManager {
LogUtil
.
d
(
TAG
+
">>>播放广告<<< =============>>> start"
);
LogUtil
.
d
(
TAG
+
">>>播放广告<<< =============>>> start"
);
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
);
if
(
checkCanShowForActionState
(
adData
,
actionFrom
.
getAction
()))
{
if
(
checkCanShowForActionState
(
adData
,
actionFrom
.
getAction
()))
{
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
+
">>>播放广告<<< ============>>> END 检查通过 开始启动SLK"
);
LogUtil
.
d
(
TAG
+
">>>播放广告<<< ============>>> END 检查通过 开始启动SLK"
);
...
@@ -289,10 +270,8 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -289,10 +270,8 @@ public class OutAdManager extends BaseOutShowManager {
*/
*/
private
void
returnFailCallBack
(
String
reason
)
{
private
void
returnFailCallBack
(
String
reason
)
{
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
+
">>>广告逻辑结束<<< ===> END 返回失败
"
);
LogUtil
.
d
(
TAG
+
">>>广告逻辑结束<<< ===> END 返回失败
reason="
+
reason
);
LogUtil
.
d
(
TAG
);
LogUtil
.
d
(
TAG
);
}
}
...
@@ -300,13 +279,13 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -300,13 +279,13 @@ public class OutAdManager extends BaseOutShowManager {
* 去拉起外展弹窗 播放or加载广告
* 去拉起外展弹窗 播放or加载广告
*/
*/
private
void
startAdDialog
(
Context
context
,
ActionFrom
actionFrom
,
RemindersInfo
remindersInfo
,
OutAdData
.
NormalAdData
data
)
{
private
void
startAdDialog
(
Context
context
,
ActionFrom
actionFrom
,
RemindersInfo
remindersInfo
,
OutAdData
.
NormalAdData
data
)
{
if
(
System
.
currentTimeMillis
()
-
lastStartAdDialogTime
<=
startAdDialogIntervalTime
)
{
//
if (System.currentTimeMillis() - lastStartAdDialogTime <= startAdDialogIntervalTime) {
EventUtils
.
staDialogFail
(
DialogFailReason
.
INTERVAL_TIME_START_DIALOG
,
actionFrom
.
getAction
(),
EventUtils
.
SCENES_SHOW
,
EventUtils
.
DIALOG_TYPE_AD
);
//
EventUtils.staDialogFail(DialogFailReason.INTERVAL_TIME_START_DIALOG, actionFrom.getAction(), EventUtils.SCENES_SHOW, EventUtils.DIALOG_TYPE_AD);
LogUtil
.
d
(
TAG
+
"拉起外展弹窗失败 : 5秒内不能重复拉起"
);
//
LogUtil.d(TAG + "拉起外展弹窗失败 : 5秒内不能重复拉起");
return
;
//
return;
}
//
}
//
lastStartAdDialogTime
=
System
.
currentTimeMillis
();
//
lastStartAdDialogTime = System.currentTimeMillis();
try
{
try
{
...
@@ -358,15 +337,15 @@ public class OutAdManager extends BaseOutShowManager {
...
@@ -358,15 +337,15 @@ public class OutAdManager extends BaseOutShowManager {
EventUtils
.
statRemindOutFgSurpriseStart
(
EventUtils
.
SLK_START_NO
,
reason
,
true
,
actionFrom
.
getAction
());
EventUtils
.
statRemindOutFgSurpriseStart
(
EventUtils
.
SLK_START_NO
,
reason
,
true
,
actionFrom
.
getAction
());
OutHelp
.
get
().
clearNotification
();
OutHelp
.
get
().
clearNotification
();
if
(!
hadStartAdDialogFail
)
{
//
if (!hadStartAdDialogFail) {
LogUtil
.
d
(
TAG
,
"广告弹窗 拉起失败 重试一次"
)
;
// hadStartAdDialogFail = true
;
hadStartAdDialogFail
=
true
;
// LogUtil.d(TAG, "广告弹窗 拉起失败 " + startAdDialogIntervalTime + "后重试一次")
;
new
Handler
().
postDelayed
(()
->
startAdDialog
(
context
,
actionFrom
,
remindersInfo
,
data
),
startAdDialogIntervalTime
);
//
new Handler().postDelayed(() -> startAdDialog(context, actionFrom, remindersInfo, data), startAdDialogIntervalTime);
}
else
{
//
} else {
LogUtil
.
d
(
TAG
+
"广告弹窗 拉起失败 已经重试一次,不再重试"
);
//
LogUtil.d(TAG + "广告弹窗 拉起失败 已经重试一次,不再重试");
LogUtil
.
d
(
TAG
+
"广告弹窗 拉起失败 ,不再重试"
);
//
LogUtil.d(TAG + "广告弹窗 拉起失败 ,不再重试");
returnFailCallBack
(
reason
);
//
returnFailCallBack(reason);
}
//
}
}
catch
(
Throwable
ignored
)
{
}
catch
(
Throwable
ignored
)
{
}
}
}
}
...
...
app/src/main/java/com/zl/sdk/out/ui/PureAdDialog.java
View file @
ea3e3cd4
...
@@ -17,6 +17,7 @@ import com.zl.sdk.event.statistics.AdScenes;
...
@@ -17,6 +17,7 @@ import com.zl.sdk.event.statistics.AdScenes;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.event.statistics.Statistics
;
import
com.zl.sdk.icon.IconHelp
;
import
com.zl.sdk.icon.IconHelp
;
import
com.zl.sdk.out.AppOutSP
;
import
com.zl.sdk.out.AppOutSP
;
import
com.zl.sdk.out.OutAdManager
;
import
com.zl.sdk.util.DpiUtil
;
import
com.zl.sdk.util.DpiUtil
;
import
com.zl.sdk.util.LogUtil
;
import
com.zl.sdk.util.LogUtil
;
...
@@ -190,13 +191,15 @@ class PureAdDialog extends AbsView {
...
@@ -190,13 +191,15 @@ class PureAdDialog extends AbsView {
protected
void
finishActivity
()
{
protected
void
finishActivity
()
{
try
{
try
{
if
(
activity
!=
null
)
{
if
(
activity
!=
null
)
{
if
(
IconHelp
.
get
().
isIconHide
())
{
activity
.
finish
();
LogUtil
.
d
(
TAG
+
"SLK 退回到后台"
);
activity
.
moveTaskToBack
(
true
);
// if (IconHelp.get().isIconHide()) {
}
else
{
// LogUtil.d(TAG + "SLK 退回到后台");
LogUtil
.
d
(
TAG
+
"SLK finish"
);
// activity.moveTaskToBack(true);
activity
.
finish
();
// } else {
}
// LogUtil.d(TAG + "SLK finish");
// activity.finish();
// }
}
}
}
catch
(
Exception
ignored
)
{
}
catch
(
Exception
ignored
)
{
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment