Commit 4346a31ea8dfc7cd02fe9265918ce5b13b3511ba

Authored by 杨帅
1 parent fbf68a7b

1 修改服务保活逻辑

config.gradle
@@ -21,7 +21,7 @@ ext { @@ -21,7 +21,7 @@ ext {
21 //编译方式 21 //编译方式
22 debug : false, 22 debug : false,
23 //版本号 23 //版本号
24 - version: "0.5.1", 24 + version: "0.5.2",
25 //Lib库前缀 25 //Lib库前缀
26 packeg : "com.cnlive.module", 26 packeg : "com.cnlive.module",
27 //Lib库名称 27 //Lib库名称
moudle_pedometer/src/main/java/com/cnlive/moudle/collectionTrace/service/CollKeepLiveService.java
@@ -96,6 +96,9 @@ public class CollKeepLiveService extends Service implements MediaPlayer.OnComple @@ -96,6 +96,9 @@ public class CollKeepLiveService extends Service implements MediaPlayer.OnComple
96 IntentFilter intentFilter = new IntentFilter(); 96 IntentFilter intentFilter = new IntentFilter();
97 intentFilter.addAction(Intent.ACTION_SCREEN_OFF); 97 intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
98 intentFilter.addAction(Intent.ACTION_SCREEN_ON); 98 intentFilter.addAction(Intent.ACTION_SCREEN_ON);
  99 + intentFilter.addAction(Intent.ACTION_TIME_CHANGED);
  100 + intentFilter.addAction(Intent.ACTION_TIME_TICK);
  101 + intentFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
99 // intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED); 102 // intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
100 // intentFilter.addAction(Intent.ACTION_TIME_CHANGED); 103 // intentFilter.addAction(Intent.ACTION_TIME_CHANGED);
101 // intentFilter.addAction(Intent.ACTION_POWER_CONNECTED); 104 // intentFilter.addAction(Intent.ACTION_POWER_CONNECTED);
moudle_pedometer/src/main/java/com/cnlive/moudle/pedometer/service/KeepLiveService.java
@@ -106,7 +106,9 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion @@ -106,7 +106,9 @@ public class KeepLiveService extends Service implements MediaPlayer.OnCompletion
106 IntentFilter intentFilter = new IntentFilter(); 106 IntentFilter intentFilter = new IntentFilter();
107 intentFilter.addAction(Intent.ACTION_SCREEN_OFF); 107 intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
108 intentFilter.addAction(Intent.ACTION_SCREEN_ON); 108 intentFilter.addAction(Intent.ACTION_SCREEN_ON);
109 -// intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED); 109 + intentFilter.addAction(Intent.ACTION_TIME_CHANGED);
  110 + intentFilter.addAction(Intent.ACTION_TIME_TICK);
  111 + intentFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
110 // intentFilter.addAction(Intent.ACTION_TIME_CHANGED); 112 // intentFilter.addAction(Intent.ACTION_TIME_CHANGED);
111 // intentFilter.addAction(Intent.ACTION_POWER_CONNECTED); 113 // intentFilter.addAction(Intent.ACTION_POWER_CONNECTED);
112 // intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED); 114 // intentFilter.addAction(Intent.ACTION_POWER_DISCONNECTED);