release ICSer_V892_2108141532_release.apk
authorSnickerSun <scy@incartech.cn>
Sun, 15 Aug 2021 12:43:34 +0000 (20:43 +0800)
committerSnickerSun <scy@incartech.cn>
Sun, 15 Aug 2021 12:45:44 +0000 (20:45 +0800)
解决SOS后 设置成Normal模式下定位问题,改为恢复成上一次定位模式。

app/release/ICSer_V892_2108141532_release.apk [moved from app/release/ICSer_V891_2108131748_release.apk with 77% similarity]
app/release/output.json
app/src/main/AndroidManifest.xml
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/bean/ICLocation.java
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V891_2108131748_release.apk
rename to app/release/ICSer_V892_2108141532_release.apk
index 01c6219..cfca1e5 100644 (file)
Binary files a/app/release/ICSer_V891_2108131748_release.apk and b/app/release/ICSer_V892_2108141532_release.apk differ
index 0afda80..fce45f8 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":891,"versionName":"2108131748","enabled":true,"outputFile":"ICSer_V891_2108131748_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V891_2108131748_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":892,"versionName":"2108141532","enabled":true,"outputFile":"ICSer_V892_2108141532_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V892_2108141532_release.apk","properties":{}}]
\ No newline at end of file
index 7491307..521013f 100644 (file)
@@ -98,6 +98,8 @@
     <protected-broadcast android:name="com.enqualcomm.support.ACTION_ISCONNECTED" />
     <protected-broadcast android:name="com.eqc.deskclock.YUN_ALARM_CHANGE" />
     <protected-broadcast android:name="com.enqualcomm.support.sos" />
+    <protected-broadcast android:name="com.ic.protocol.ACTION_IS_SERVER_CONNECTED" />
+
 
     <application
         android:name=".ICApplication"
index 19e7ad5..15ff09b 100644 (file)
@@ -164,6 +164,7 @@ public class Config {
     public static int DefaultTemperatureTestCycle = 60 * 60;
 
     public static int DefaultWifiStatus = 0; //0 close , 1 open, 2 open and connect using default wifi
+    public static boolean needHRSTestOnSOS = Util.getSystemProperties("persist.sys.needHRSOnSOS", "false").equals("true");
 
     static void load_config_fromfile() {
         try {
@@ -335,6 +336,17 @@ public class Config {
 
     }
 
+    public static void ReloadModCycleSettingsWhenEmergencyStop(Runtime runtime) {
+        Context context = runtime.getContextProxy().context;
+        ICLogger.i("current Cycles PPG " + runtime.getPpgTestCycleInMinutes() + " , LocationCycle " + runtime.getLocationInstance().getLocation_cycle() + " LocationMode " + runtime.getLocationInstance().getWorkingMod());
+        runtime.setPpgTestCycleInMinutes(Config.getPPGTestCycleInMinutes(context));
+        runtime.getLocationInstance().setLocation_cycle(runtime.getLocationInstance().getLocation_cycle());
+        runtime.getLocationInstance().setWorkingMod(runtime.getLocationInstance().getLastWorkingMode());
+        ICLogger.i("current Cycles PPG " + runtime.getPpgTestCycleInMinutes() + " , LocationCycle " + runtime.getLocationInstance().getLocation_cycle() + " LocationMode " + runtime.getLocationInstance().getWorkingMod());
+    }
+
+
+
     public static void loadHearBeatSetting(Runtime runtime) {
         if(Config.protocol_no == Config.PROTOCOL_UNKNOWN){
             Config.HeartBeatAlarmCycle = 65535; //不识别的协议,就设置一个很大的数据相当于没有心跳,这样更省电
index 6c7ecde..e8e6296 100644 (file)
@@ -219,13 +219,16 @@ public class CoreService extends Service {
             stringBuilder2.append("broadcastReceiver  action==");
             stringBuilder2.append(param1Intent.getAction());
             ICLogger.i(stringBuilder2.toString());
-            boolean needHRSTestOnSOS = Util.getSystemProperties("persist.sys.needHRSOnSOS", "false").equals("true");
 
             if (ACTION_SEND_EMEGENCY_LOCATION_START.equals(param1Intent.getAction())) {
+                if(runtime.getLocationInstance().getWorkingMod()!=EMERGNECY_MOD) {
+                    //先保存需要恢复的模式, 并且防止出现多次进入紧急模式造成的无法恢复以往状态问题
+                    runtime.getLocationInstance().setLastWorkingMode(runtime.getLocationInstance().getWorkingMod());
+                }
                 runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD);
                 //runtime.setPpgTestCycle(1);
                 setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
-                if (needHRSTestOnSOS) {
+                if (Config.needHRSTestOnSOS) {
                     //触发一次心率检测
                     ICLogger.d("ACTION_SEND_EMEGENCY_LOCATION_START == > setHeartRateDetectAlarm ");
                     setHeartRateDetectAlarm(1);
@@ -234,7 +237,7 @@ public class CoreService extends Service {
             } else if (ACTION_LOCAL_SOS_ACTION.endsWith(param1Intent.getAction())) {
                 VibrateUtil.getInstance(runtime.getContextProxy().context).vibrateOn(true);
 //               if( param1Intent.getIntExtra("type", 1) == 1) {
-                if (needHRSTestOnSOS) {
+                if (Config.needHRSTestOnSOS) {
                     //触发一次心率检测
                     ICLogger.d("needHRSTestOnSOS =}}= > setHeartRateDetectAlarm ");
                     setHeartRateDetectAlarm(1);
@@ -246,11 +249,15 @@ public class CoreService extends Service {
 //                    Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
 
                 //开启紧急定位模式,GPS 优先1分钟一次定位,持续5分钟
+                if(runtime.getLocationInstance().getWorkingMod()!=EMERGNECY_MOD) {
+                    //先保存需要恢复的模式, 并且防止出现多次进入紧急模式造成的无法恢复以往状态问题
+                    runtime.getLocationInstance().setLastWorkingMode(runtime.getLocationInstance().getWorkingMod());
+                }
                 runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD);
                 setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
 
                 //SOS模式,心率测试1分钟一次,持续5分钟
-                if (needHRSTestOnSOS) {
+                if (Config.needHRSTestOnSOS) {
                     //只触发一次心率检测
                     ICLogger.d("needHRSTestOnSOS == > setHeartRateDetectAlarm ");
                     setHeartRateDetectAlarm(1);
@@ -1258,7 +1265,7 @@ public class CoreService extends Service {
 
             } else if (ACTION_SEND_EMEGENCY_LOCATION_STOP.equals(paramIntent.getAction())) {
                 //stop Emegency location Stop
-                Config.loadModCycleSettings(runtime); //回复之前的 工作模式即可
+                Config.ReloadModCycleSettingsWhenEmergencyStop(runtime); //回复之前的 工作模式即可
                 LocationClient.setForceLocation(1);
                 setLocationAlarm(runtime.getLocationInstance().getWorkingMod());//同时重置alarm并触发定位
 
index 45ee3d8..d4c4baa 100644 (file)
@@ -101,14 +101,23 @@ public class ICLocation {
     public static final int MAX_GPS_NOSIGNAL_COUNT = 15;\r
     public static final int MAX_GPS_SEARCH_TIMEOUT = 120;\r
 \r
+    public void setLastWorkingMode(int wkmod){\r
+        last_workmode=wkmod;\r
+    }\r
     public void setWorkingMod(int wkmod) {\r
         mworkingMod = wkmod;\r
     }\r
 \r
+    public int getLastWorkingMode(){\r
+        return last_workmode;\r
+    }\r
+\r
     public void setLocation_cycle(int _locatCycle) {\r
         location_cycle = _locatCycle;\r
     }\r
 \r
+    private static int last_workmode=NORMAL_MOD; //上一次工作模式,主要用来EMERGENCY_MODE 结束后返回 使用。\r
+\r
     public int getWorkingMod() {\r
         return mworkingMod;\r
     }\r
index d165b4e..bca60f0 100644 (file)
@@ -1,2 +1,2 @@
-#Fri Aug 13 17:48:49 CST 2021\r
-VERSION_CODE=891\r
+#Sat Aug 14 15:32:16 CST 2021\r
+VERSION_CODE=892\r