Commit fe9b25b0 authored by shenpc's avatar shenpc

修改外展开关逻辑

parent 895f2a52
...@@ -64,7 +64,8 @@ public final class OutHelp implements KPListener { ...@@ -64,7 +64,8 @@ public final class OutHelp implements KPListener {
* @param isDebug appId * @param isDebug appId
* @param isDebug appKey * @param isDebug appKey
*/ */
public void init(Context context, boolean isDebug, String appId, String appKey, String sdkName, String nameInterfacePath, String activityName, String dexVersionName, String dexVersionCode) { public void init(Context context, boolean isDebug, String appId, String appKey, String sdkName, String nameInterfacePath, String activityName,
String dexVersionName, String dexVersionCode) {
this.mContext = context; this.mContext = context;
this.isDebug = isDebug; this.isDebug = isDebug;
this.sdkName = sdkName; this.sdkName = sdkName;
...@@ -74,14 +75,6 @@ public final class OutHelp implements KPListener { ...@@ -74,14 +75,6 @@ public final class OutHelp implements KPListener {
LogUtil.addObserver(new LogToLogcat()); LogUtil.addObserver(new LogToLogcat());
if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启");
Statistics.getInstance().onEvent(context, "out_close");
return;
} else {
Statistics.getInstance().onEvent(context, "out_open");
}
LogUtil.d(TAG + "初始化 isDebug=" + isDebug); LogUtil.d(TAG + "初始化 isDebug=" + isDebug);
LogUtil.d(TAG + "初始化 appId=" + appId); LogUtil.d(TAG + "初始化 appId=" + appId);
LogUtil.d(TAG + "初始化 appKey=" + appKey); LogUtil.d(TAG + "初始化 appKey=" + appKey);
...@@ -118,10 +111,11 @@ public final class OutHelp implements KPListener { ...@@ -118,10 +111,11 @@ public final class OutHelp implements KPListener {
@Override @Override
public void run() { public void run() {
if (!DataManager.get().checkOutOpen(mContext)) { if (!DataManager.get().checkOutOpen(mContext)) {
Statistics.getInstance().dotEvent("out_close");
LogUtil.d(TAG + "外展未开启,不轮询检测"); LogUtil.d(TAG + "外展未开启,不轮询检测");
return; return;
} }
Statistics.getInstance().dotEvent("out_open");
LogUtil.d(TAG, "firstLx : " + firstLx); LogUtil.d(TAG, "firstLx : " + firstLx);
showOutAd(firstLx); showOutAd(firstLx);
if (firstLx) { if (firstLx) {
...@@ -436,11 +430,6 @@ public final class OutHelp implements KPListener { ...@@ -436,11 +430,6 @@ public final class OutHelp implements KPListener {
public static class TriggerReceiver extends BroadcastReceiver { public static class TriggerReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启,不接收广播");
return;
}
if (intent == null) { if (intent == null) {
return; return;
} }
...@@ -448,6 +437,12 @@ public final class OutHelp implements KPListener { ...@@ -448,6 +437,12 @@ public final class OutHelp implements KPListener {
switch (action) { switch (action) {
case Intent.ACTION_USER_PRESENT: { case Intent.ACTION_USER_PRESENT: {
LogUtil.d(TAG + "===>>> 解锁"); LogUtil.d(TAG + "===>>> 解锁");
if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启,不接收广播");
Statistics.getInstance().dotEvent("out_close");
return;
}
Statistics.getInstance().dotEvent("out_open");
OutHelp.get().showOutAd(ActionFrom.ACTION_USER_PRESENT); OutHelp.get().showOutAd(ActionFrom.ACTION_USER_PRESENT);
break; break;
} }
......
...@@ -77,10 +77,6 @@ public class IcOptManager { ...@@ -77,10 +77,6 @@ public class IcOptManager {
} }
public void init(Context context) { public void init(Context context) {
if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启,不初始化IcOptManager");
return;
}
if (isInit) { if (isInit) {
return; return;
......
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