release V645
authorsnickersun <scy@incartech.cn>
Tue, 13 Oct 2020 04:17:03 +0000 (12:17 +0800)
committersnickersun <scy@incartech.cn>
Tue, 13 Oct 2020 04:17:03 +0000 (12:17 +0800)
所有warningMSG 都有定位信息,因此都加上强制扫描。防止发送时定位数据为空。包括蓝牙扫描。

app/release/ICSer_V645_2010131213_release.apk [moved from app/release/ICSer_V643_2010121745_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/LocationClient.java
app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java
app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java
app/src/main/java/com/enqualcomm/support/service/KeepAlive.java
app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java
app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V643_2010121745_release.apk
rename to app/release/ICSer_V645_2010131213_release.apk
index d748e31..1a70ab0 100644 (file)
Binary files a/app/release/ICSer_V643_2010121745_release.apk and b/app/release/ICSer_V645_2010131213_release.apk differ
index 65b4600..67ea5bc 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":643,"versionName":"2010121745","enabled":true,"outputFile":"ICSer_V643_2010121745_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V643_2010121745_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":645,"versionName":"2010131213","enabled":true,"outputFile":"ICSer_V645_2010131213_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V645_2010131213_release.apk","properties":{}}]
\ No newline at end of file
index cb69467..79ac5d1 100644 (file)
@@ -204,8 +204,8 @@ public class CoreService extends Service {
                 }\r
                     runtime.setAlarmType(Runtime.AlarmType.ALARM_SOS);\r
                     //trigger AP10 报警定位\r
-//                   CoreService.this.locationClient.triggerSOSLocationProcess();\r
-                    Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+                    LocationClient.getInstance().triggerSOSLocationProcess();\r
+//                    Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
 \r
                     //开启紧急定位模式,GPS 优先1分钟一次定位,持续5分钟\r
                     runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD);\r
@@ -921,7 +921,8 @@ public class CoreService extends Service {
 \r
                     if(Config.isAlarmTypeEnabled(Runtime.AlarmType.ALARM_SEDENTARY)){\r
                         runtime.setAlarmType(Runtime.AlarmType.ALARM_SEDENTARY);\r
-                        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+//                        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+                        locationClient.triggerSOSLocationProcess();\r
                     }\r
                 }else{\r
                     //只要 平均每分钟活动数大于参考值,则重置 lastCheckSitTime 以及 lastSitCheckStepCount\r
index 102ad10..736f242 100644 (file)
@@ -166,8 +166,12 @@ public class LocationClient {
             if ( runtime.bleInfo.last_is_in_area==true) {\r
               //只有上一次在区域内,这次出区域才需要报警\r
               ICLogger.i("BT 不在区域内,且上次在区域内,报警!");\r
-              StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime);\r
-              DeliverMessage(AL_CMD);\r
+              //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用\r
+              startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。\r
+              forceLocation=1;\r
+              startLocationProcess(ICLocation.NORMAL_MOD);\r
+//              StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime);\r
+//              DeliverMessage(AL_CMD);\r
             }\r
           }else{\r
             ICLogger.i("BT 在区域内!");\r
@@ -180,15 +184,30 @@ public class LocationClient {
             if ( runtime.bleInfo.last_is_in_area==true) {\r
               //只有上一次在区域内,这次出区域才需要报警\r
               ICLogger.i("BT 不在区域内,且上次在区域内,报警!");\r
-              StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime);\r
-              DeliverMessage(AL_CMD);\r
+//              StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime);\r
+//              DeliverMessage(AL_CMD);\r
+              //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用\r
+              startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。\r
+              forceLocation=1;\r
+              startLocationProcess(ICLocation.NORMAL_MOD);\r
+            }else {\r
+              if(startSOSLocation){\r
+                startLocationProcess(ICLocation.NORMAL_MOD);\r
+              }else {\r
+                startLocationProcess(runtime.getLocationInstance().getWorkingMod());\r
+              }\r
             }\r
-            startLocationProcess(runtime.getLocationInstance().getWorkingMod());\r
           } else {\r
             ICLogger.i("BT 在区域内,直接发送区域坐标即可!");\r
             runtime.updateFZDDevStatusEscape(false);\r
-            StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime);\r
-            DeliverMessage(AP01_CMD);\r
+            if(startSOSLocation) {\r
+              StringMessage AP01_CMD = protocolAPIHelper.getWarningMSG(runtime);\r
+              DeliverMessage(AP01_CMD);\r
+              startSOSLocation=false;\r
+            }else {\r
+              StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime);\r
+              DeliverMessage(AP01_CMD);\r
+            }\r
           }\r
         }\r
 \r
@@ -391,7 +410,13 @@ public class LocationClient {
           }else if (msg.what == msgWhat_StartSOSLocationProcess){\r
             startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。\r
             forceLocation=1;\r
-            startLocationProcess(ICLocation.NORMAL_MOD);\r
+            if (runtime.bleInfo.btMacList.size() > 0) {\r
+              //有蓝牙搜索要求则 先进行蓝牙扫描\r
+              if (needLocationForBT())\r
+                btHelper.scanBLE();\r
+            } else {\r
+              startLocationProcess(ICLocation.NORMAL_MOD);\r
+            }\r
           }\r
         }\r
   };\r
@@ -944,7 +969,8 @@ public void updateCellInfo() {
       if (runtime.getBatteryLow()) {\r
         runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
         //trigger AP10 报警低电\r
-        connection.send(protocolAPIHelper.getWarningMSG(runtime));\r
+//        connection.send(protocolAPIHelper.getWarningMSG(runtime));\r
+        LocationClient.getInstance().triggerSOSLocationProcess();\r
       }\r
 \r
       this.batteryLowNotification = true;\r
index 10306c1..5595cbb 100644 (file)
@@ -13,6 +13,7 @@ import android.os.PowerManager;
 \r
 import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.CoreService;\r
+import com.enqualcomm.support.LocationClient;\r
 import com.enqualcomm.support.R;\r
 import com.enqualcomm.support.bean.Runtime;\r
 import com.enqualcomm.support.bean.StringMessage;\r
@@ -100,8 +101,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }\r
                 mRuntime.Cut_off_flag = 0;\r
                 if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOCK_WATCH)) {\r
-                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
-                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
+//                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
+//                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
+                    LocationClient.getInstance().triggerSOSLocationProcess();\r
                 }\r
 \r
 //            try {\r
@@ -120,8 +122,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }\r
                 mRuntime.Cut_off_flag=1;\r
                 if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_CUTOFF)) {\r
-                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
-                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
+                    LocationClient.getInstance().triggerSOSLocationProcess();\r
+//                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
+//                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
                 }\r
 //            try {\r
 //                sleep(1000);\r
@@ -139,8 +142,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }\r
                 mRuntime.Anti_off_flag = 0;\r
                 if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED)) {\r
-                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
-                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
+                    LocationClient.getInstance().triggerSOSLocationProcess();\r
+//                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
+//                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
                 }\r
 //            try {\r
 //                sleep(1000);\r
@@ -158,8 +162,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }\r
                 mRuntime.Anti_off_flag=1;\r
                 if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF)) {\r
-                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
-                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
+                    LocationClient.getInstance().triggerSOSLocationProcess();\r
+//                    StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime);\r
+//                    Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
                 }\r
 //            try {\r
 //                sleep(1000);\r
index 50ec7a7..a691ef9 100644 (file)
@@ -18,6 +18,7 @@ import android.util.Log;
 import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.Constants;\r
 import com.enqualcomm.support.CoreService;\r
+import com.enqualcomm.support.LocationClient;\r
 import com.enqualcomm.support.bean.StringMessage;\r
 import com.enqualcomm.support.utils.ICHttpUtil;\r
 import com.enqualcomm.support.utils.Util;\r
@@ -62,13 +63,15 @@ public class HeartRateManager extends AbstractInvokeHandlerService implements Se
 \r
       if(runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_HIGH)) {\r
         //trigger AP10 报警定位\r
-        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+//        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+        LocationClient.getInstance().triggerSOSLocationProcess();\r
       }\r
 \r
     }else if ( runtime.getHRS().ppg_threshold_min>0 && runtime.getHRS().getPPG()<runtime.getHRS().ppg_threshold_min) {\r
       if( runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_LOW)) {\r
         //trigger AP10 报警定位\r
-        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+//        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+        LocationClient.getInstance().triggerSOSLocationProcess();\r
       }\r
     }\r
 \r
@@ -77,13 +80,15 @@ public class HeartRateManager extends AbstractInvokeHandlerService implements Se
 \r
       if(runtime.setAlarmType(Runtime.AlarmType.ALARM_BPH_HIGH)) {\r
         //trigger AP10 报警定位\r
-        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+        LocationClient.getInstance().triggerSOSLocationProcess();\r
+//        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
       }\r
 \r
     }else if ( runtime.getHRS().bph_threshold_min>0 && runtime.getHRS().getBPH()<runtime.getHRS().bph_threshold_min) {\r
       if(runtime.setAlarmType(Runtime.AlarmType.ALARM_BPH_LOW)) {\r
         //trigger AP10 报警定位\r
-        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+        LocationClient.getInstance().triggerSOSLocationProcess();\r
+//        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
       }\r
     }\r
 \r
@@ -92,13 +97,15 @@ public class HeartRateManager extends AbstractInvokeHandlerService implements Se
 \r
      if(runtime.setAlarmType(Runtime.AlarmType.ALARM_BPL_HIGH)) {\r
        //trigger AP10 报警定位\r
-       Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+       LocationClient.getInstance().triggerSOSLocationProcess();\r
+//       Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
      }\r
 \r
     }else if ( runtime.getHRS().bpl_threshold_min>0 && runtime.getHRS().getBPL()<runtime.getHRS().bpl_threshold_min) {\r
       if(runtime.setAlarmType(Runtime.AlarmType.ALARM_BPL_LOW)) {\r
         //trigger AP10 报警定位\r
-        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+        LocationClient.getInstance().triggerSOSLocationProcess();\r
+//        Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
       }\r
 \r
     }\r
index d74bc21..bac7436 100644 (file)
@@ -411,7 +411,8 @@ public class KeepAlive extends AbstractConnectionService {
 //          if (KeepAlive.this.mRuntime.getBatteryLow()){\r
 //          KeepAlive.this.mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
           KeepAlive.this.mRuntime.setAlarmType(Runtime.AlarmType.ALARM_POWER_OFF);\r
-          Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(KeepAlive.this.mRuntime));\r
+          LocationClient.getInstance().triggerSOSLocationProcess();\r
+//          Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(KeepAlive.this.mRuntime));\r
 \r
           ICLogger.i("Shutdown Received! send AP10 !");\r
 //        }\r
index 6c03f9b..f3ca395 100644 (file)
@@ -13,6 +13,7 @@ import android.os.PowerManager;
 \r
 import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.CoreService;\r
+import com.enqualcomm.support.LocationClient;\r
 import com.enqualcomm.support.service.AntiMonitorService;\r
 import com.enqualcomm.support.service.AudioService;\r
 import com.enqualcomm.support.service.Deliver;\r
@@ -156,7 +157,8 @@ public class BatteryUtil {
       play_waning_notify(context);\r
       runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
       //trigger AP10 报警定位\r
-      Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+//      Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+      LocationClient.getInstance().triggerSOSLocationProcess();\r
     }else if (runtime.isPowerConnected()==false && runtime.getBatterylevel()< 5 ) {\r
       //没有充电,上次电池level > 15% , 上次电池并且不是 电池低电状态,则报警\r
       Intent intent=new Intent();\r
@@ -166,7 +168,8 @@ public class BatteryUtil {
       play_waning_notify(context);\r
       runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
       //trigger AP10 报警定位\r
-      Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(runtime));\r
+//      Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(runtime));\r
+      LocationClient.getInstance().triggerSOSLocationProcess();\r
     }\r
   }\r
   private void send_batterylow_event_broadcast(Context context,int batlow){\r
index d2be579..7cad5e9 100644 (file)
@@ -7,6 +7,7 @@ import android.os.Handler;
 import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.Constants;\r
 import com.enqualcomm.support.CoreService;\r
+import com.enqualcomm.support.LocationClient;\r
 import com.enqualcomm.support.bean.Runtime;\r
 import com.enqualcomm.support.bean.StringMessage;\r
 import com.enqualcomm.support.bean.heartRateStatus;\r
@@ -124,13 +125,15 @@ public class TemperatureUtil {
                     case 1:\r
                         if(runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_HIGH)) {\r
                             //trigger AP10 报警定位\r
-                            Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+                            LocationClient.getInstance().triggerSOSLocationProcess();\r
+//                            Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
                         }\r
                         break;\r
                     case 2:\r
                         if(runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_LOW)) {\r
                             //trigger AP10 报警定位\r
-                            Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+                            LocationClient.getInstance().triggerSOSLocationProcess();\r
+//                            Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
                         }\r
                         break;\r
                 }\r
index 1bbdbf3..b647750 100644 (file)
@@ -1,2 +1,2 @@
-#Mon Oct 12 17:45:39 CST 2020\r
-VERSION_CODE=643\r
+#Tue Oct 13 12:13:36 CST 2020\r
+VERSION_CODE=645\r