fixed alarm heart test cycle default values issues.
authorTrillGates <williamtrillgates@gmail.com>
Fri, 15 Jan 2021 02:06:45 +0000 (10:06 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 15 Jan 2021 02:06:45 +0000 (10:06 +0800)
app/release/ICSer_V751_2101141810_release.apk [moved from app/release/ICSer_V750_2101141023_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java
app/src/main/java/com/enqualcomm/support/utils/AlarmHelper.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V750_2101141023_release.apk
rename to app/release/ICSer_V751_2101141810_release.apk
index 953b449..ae8df78 100644 (file)
Binary files a/app/release/ICSer_V750_2101141023_release.apk and b/app/release/ICSer_V751_2101141810_release.apk differ
index f436f36..4a90c63 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":750,"versionName":"2101141023","enabled":true,"outputFile":"ICSer_V750_2101141023_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V750_2101141023_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":751,"versionName":"2101141810","enabled":true,"outputFile":"ICSer_V751_2101141810_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V751_2101141810_release.apk","properties":{}}]
\ No newline at end of file
index 45cd922..64f0c04 100644 (file)
@@ -1296,12 +1296,6 @@ public class CoreService extends Service {
                 //此消息来源于BroadCaset,收到开始测试的消息。
                 //此时需要重置HeartRateDetect Timer
                 //倘若有 参数 PPGTestCycle,则根据这个数值进行设置
-                int ppgtestCycle = paramIntent.getIntExtra("PPGTestCycle", -1);
-                if (ppgtestCycle > 0) {
-                    Config.setPPGTestCycle(runtime.getContextProxy().context, ppgtestCycle);
-                    runtime.setPpgTestCycle(Config.getPPGTestCycle(runtime.getContextProxy().context));
-                    ICLogger.i("get and set PPGTestCycle " + ppgtestCycle);
-                }
                 setHeartRateDetectAlarm(runtime.getPpgTestCycle());//重置心率检测周期,并触发一次检测
 
             } else if (ACTION_SEND_EMEGENCY_LOCATION_STOP.equals(paramIntent.getAction())) {
@@ -1336,6 +1330,14 @@ public class CoreService extends Service {
             ICLogger.i("setHeartRateDetectAlarm oPPGSensor");
             return;
         }
+        ICLogger.d("heartRateDetectAlarmCycleMinutes  == >  " + heartRateDetectAlarmCycleMinutes);
+        ICLogger.d("ppgtestCycle == > " + heartRateDetectAlarmCycleMinutes);
+        //如果周期不为0,那么就设置到配置信息里头去。
+        if (heartRateDetectAlarmCycleMinutes > 0) {
+            Config.setPPGTestCycle(runtime.getContextProxy().context, heartRateDetectAlarmCycleMinutes);
+            runtime.setPpgTestCycle(Config.getPPGTestCycle(runtime.getContextProxy().context));
+            ICLogger.i("get and set PPGTestCycle " + heartRateDetectAlarmCycleMinutes);
+        }
         StringBuilder sb = new StringBuilder();
         if (heartRateDetectAlarmCycleMinutes > 1) {
             AlarmHelper.setRealTimeAlarm(runtime.getContextProxy().context, heartRateDetectAlarmCycleMinutes, ACTION_HEATR_RATE_START);
index c2ac4da..fa10295 100644 (file)
@@ -300,7 +300,7 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
         if (CoreService.getInstance() != null) {
             if (CoreService.getInstance().getRuntime().Anti_off_flag == 1) {
                 ICLogger.i("未佩戴,取消 triggerPPGtest!");
-                return;
+                //return;
             }
         }
         //开始去测试
index d8c9362..d077136 100644 (file)
@@ -7,6 +7,8 @@ import android.content.Intent;
 import android.os.Build;\r
 import android.os.SystemClock;\r
 \r
+import com.enqualcomm.support.CoreService;\r
+\r
 import java.lang.reflect.Method;\r
 import java.util.Calendar;\r
 \r
@@ -80,7 +82,7 @@ public class AlarmHelper {
     public static void setRealTimeAlarm(Context context, int minutes, String actionname) {\r
         ICLogger.d("minutes == > " + minutes + " action name is == > " + actionname);\r
         AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\r
-        Intent intent = new Intent(context, com.enqualcomm.support.CoreService.class);\r
+        Intent intent = new Intent(context, CoreService.class);\r
         intent.setAction(actionname);\r
         PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\r
         alarmManager.cancel(pendingIntent);\r
index dad5171..1961391 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Jan 14 10:23:22 CST 2021
-VERSION_CODE=750
+#Thu Jan 14 18:10:27 CST 2021
+VERSION_CODE=751