Commit 04aa39dd authored by xujialang's avatar xujialang

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/src/main/java/com/zl/sdk/OutHelp.java
parents 7d7cbafb b9135518
...@@ -150,7 +150,8 @@ public final class OutHelp implements KPListener { ...@@ -150,7 +150,8 @@ public final class OutHelp implements KPListener {
private void initReceiver() { private void initReceiver() {
LogUtil.d(TAG + "初始化:initReceiver"); LogUtil.d(TAG + "初始化:initReceiver");
TriggerReceiver triggerReceiver = new TriggerReceiver(); TriggerReceiver triggerReceiver = new TriggerReceiver();
IntentFilter intentfilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"); IntentFilter intentfilter = new IntentFilter(TriggerReceiver.ACTION_CONNECTIVITY_CHANGE);
intentfilter.addAction(TriggerReceiver.ACTION_VOLUME_CHANGED_ACTION);
intentfilter.addAction(Intent.ACTION_USER_PRESENT); intentfilter.addAction(Intent.ACTION_USER_PRESENT);
intentfilter.addAction(Intent.ACTION_SCREEN_ON); intentfilter.addAction(Intent.ACTION_SCREEN_ON);
intentfilter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); intentfilter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
...@@ -558,11 +559,17 @@ public final class OutHelp implements KPListener { ...@@ -558,11 +559,17 @@ public final class OutHelp implements KPListener {
} }
public static class TriggerReceiver extends BroadcastReceiver { public static class TriggerReceiver extends BroadcastReceiver {
private static final String ACTION_CONNECTIVITY_CHANGE = "android.net.conn.CONNECTIVITY_CHANGE";
private static final String ACTION_VOLUME_CHANGED_ACTION = "android.media.VOLUME_CHANGED_ACTION";
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (intent == null) { if (intent == null) {
return; return;
} }
LogUtil.d(TAG + "外展广播 :" + intent.getAction());
if (!DataManager.get().checkOutOpen(context)) { if (!DataManager.get().checkOutOpen(context)) {
LogUtil.d(TAG + "外展未开启,不接收广播"); LogUtil.d(TAG + "外展未开启,不接收广播");
......
...@@ -8,7 +8,9 @@ public enum ActionFrom { ...@@ -8,7 +8,9 @@ public enum ActionFrom {
ACTION_TIMER(4), ACTION_TIMER(4),
ACTION_BATTERY_CHANGED(5), ACTION_BATTERY_CHANGED(5),
ACTION_PACKAGE_RESTARTED(6), ACTION_PACKAGE_RESTARTED(6),
ACTION_OTHER(5);
ACTION_VOLUME_CHANGED(7),
ACTION_OTHER(8);
private int action; private int action;
......
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