AA-解决充电时不发送每隔5分钟的特征数据
authork.liang <liangkang648253071@126.com>
Mon, 25 Oct 2021 02:39:56 +0000 (10:39 +0800)
committerk.liang <liangkang648253071@126.com>
Mon, 25 Oct 2021 02:39:56 +0000 (10:39 +0800)
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/version_code.properties

index 9e205da..1ce30f5 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":988,"versionName":"2110222005","enabled":true,"outputFile":"ICSer_V988_2110222005_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V988_2110222005_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":990,"versionName":"2110251012","enabled":true,"outputFile":"ICSer_V990_2110251012_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V990_2110251012_release.apk","properties":{}}]
\ No newline at end of file
index 8327c70..7f6a13b 100644 (file)
@@ -13,6 +13,7 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.database.Cursor;
 import android.net.Uri;
+import android.os.BatteryManager;
 import android.os.Handler;
 import android.os.HandlerThread;
 import android.os.IBinder;
@@ -1310,6 +1311,18 @@ public class CoreService extends Service {
                 checkKeepSitting();//检查久坐
                 checkAlarmMessage();//检测是否有报警消息需要显示
                 checkUnreadMessage();//检查未读消息
+
+                IntentFilter intentFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
+                Intent intent = runtime.getContextProxy().context.registerReceiver(null, intentFilter);
+                int batteryChargeState = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
+                if(batteryChargeState != BatteryManager.BATTERY_PLUGGED_AC && batteryChargeState != BatteryManager.BATTERY_PLUGGED_USB && batteryChargeState != BatteryManager.BATTERY_PLUGGED_WIRELESS){
+                    if (runtime.check_stat_do_temp_test()) {
+                        TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER);
+                    }
+                    if (runtime.check_stat_do_ppg_test()) {
+                        HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
+                    }
+                }
                 if (this.mKeepAlive != null) {
                     if (connection.isServerConnected() && runtime.isServerProtocolConnected()) {
                         this.mKeepAlive.onHeartAlarm(this.connection, this.runtime);
index f294bbe..a2cdce1 100644 (file)
@@ -1,2 +1,2 @@
-#Fri Oct 22 20:05:07 CST 2021\r
-VERSION_CODE=988\r
+#Mon Oct 25 10:12:46 CST 2021\r
+VERSION_CODE=990\r