From: snickersun Date: Tue, 13 Oct 2020 04:17:03 +0000 (+0800) Subject: release V645 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=8e455fc48cb8fb534239651797547df4a600d736;p=protocol_srv.git release V645 所有warningMSG 都有定位信息,因此都加上强制扫描。防止发送时定位数据为空。包括蓝牙扫描。 --- diff --git a/app/release/ICSer_V643_2010121745_release.apk b/app/release/ICSer_V645_2010131213_release.apk similarity index 78% rename from app/release/ICSer_V643_2010121745_release.apk rename to app/release/ICSer_V645_2010131213_release.apk index d748e317..1a70ab0f 100644 Binary files a/app/release/ICSer_V643_2010121745_release.apk and b/app/release/ICSer_V645_2010131213_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 65b46002..67ea5bc8 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index cb69467e..79ac5d11 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -204,8 +204,8 @@ public class CoreService extends Service { } runtime.setAlarmType(Runtime.AlarmType.ALARM_SOS); //trigger AP10 报警定位 -// CoreService.this.locationClient.triggerSOSLocationProcess(); - Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); + LocationClient.getInstance().triggerSOSLocationProcess(); +// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); //开启紧急定位模式,GPS 优先1分钟一次定位,持续5分钟 runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD); @@ -921,7 +921,8 @@ public class CoreService extends Service { if(Config.isAlarmTypeEnabled(Runtime.AlarmType.ALARM_SEDENTARY)){ runtime.setAlarmType(Runtime.AlarmType.ALARM_SEDENTARY); - Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); +// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); + locationClient.triggerSOSLocationProcess(); } }else{ //只要 平均每分钟活动数大于参考值,则重置 lastCheckSitTime 以及 lastSitCheckStepCount diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index 102ad104..736f2420 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -166,8 +166,12 @@ public class LocationClient { if ( runtime.bleInfo.last_is_in_area==true) { //只有上一次在区域内,这次出区域才需要报警 ICLogger.i("BT 不在区域内,且上次在区域内,报警!"); - StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); - DeliverMessage(AL_CMD); + //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用 + startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。 + forceLocation=1; + startLocationProcess(ICLocation.NORMAL_MOD); +// StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); +// DeliverMessage(AL_CMD); } }else{ ICLogger.i("BT 在区域内!"); @@ -180,15 +184,30 @@ public class LocationClient { if ( runtime.bleInfo.last_is_in_area==true) { //只有上一次在区域内,这次出区域才需要报警 ICLogger.i("BT 不在区域内,且上次在区域内,报警!"); - StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); - DeliverMessage(AL_CMD); +// StringMessage AL_CMD = protocolAPIHelper.getWarningMSG(runtime); +// DeliverMessage(AL_CMD); + //如果需要报警定位,则强制进行sos定位,不能通过triggerSOS,因为函数中调用了BLEScan会造成循环调用 + startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。 + forceLocation=1; + startLocationProcess(ICLocation.NORMAL_MOD); + }else { + if(startSOSLocation){ + startLocationProcess(ICLocation.NORMAL_MOD); + }else { + startLocationProcess(runtime.getLocationInstance().getWorkingMod()); + } } - startLocationProcess(runtime.getLocationInstance().getWorkingMod()); } else { ICLogger.i("BT 在区域内,直接发送区域坐标即可!"); runtime.updateFZDDevStatusEscape(false); - StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime); - DeliverMessage(AP01_CMD); + if(startSOSLocation) { + StringMessage AP01_CMD = protocolAPIHelper.getWarningMSG(runtime); + DeliverMessage(AP01_CMD); + startSOSLocation=false; + }else { + StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime); + DeliverMessage(AP01_CMD); + } } } @@ -391,7 +410,13 @@ public class LocationClient { }else if (msg.what == msgWhat_StartSOSLocationProcess){ startSOSLocation=true;//启动SOS定位,为了快速响应,只要wifi定位即可。 forceLocation=1; - startLocationProcess(ICLocation.NORMAL_MOD); + if (runtime.bleInfo.btMacList.size() > 0) { + //有蓝牙搜索要求则 先进行蓝牙扫描 + if (needLocationForBT()) + btHelper.scanBLE(); + } else { + startLocationProcess(ICLocation.NORMAL_MOD); + } } } }; @@ -944,7 +969,8 @@ public void updateCellInfo() { if (runtime.getBatteryLow()) { runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY); //trigger AP10 报警低电 - connection.send(protocolAPIHelper.getWarningMSG(runtime)); +// connection.send(protocolAPIHelper.getWarningMSG(runtime)); + LocationClient.getInstance().triggerSOSLocationProcess(); } this.batteryLowNotification = true; diff --git a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java index 10306c1c..5595cbbc 100644 --- a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java +++ b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java @@ -13,6 +13,7 @@ import android.os.PowerManager; import com.enqualcomm.support.Config; import com.enqualcomm.support.CoreService; +import com.enqualcomm.support.LocationClient; import com.enqualcomm.support.R; import com.enqualcomm.support.bean.Runtime; import com.enqualcomm.support.bean.StringMessage; @@ -100,8 +101,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { } mRuntime.Cut_off_flag = 0; if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOCK_WATCH)) { - StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); - Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! +// StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); +// Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! + LocationClient.getInstance().triggerSOSLocationProcess(); } // try { @@ -120,8 +122,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { } mRuntime.Cut_off_flag=1; if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_CUTOFF)) { - StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); - Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! + LocationClient.getInstance().triggerSOSLocationProcess(); +// StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); +// Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! } // try { // sleep(1000); @@ -139,8 +142,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { } mRuntime.Anti_off_flag = 0; if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED)) { - StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); - Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! + LocationClient.getInstance().triggerSOSLocationProcess(); +// StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); +// Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! } // try { // sleep(1000); @@ -158,8 +162,9 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { } mRuntime.Anti_off_flag=1; if(mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF)) { - StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); - Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! + LocationClient.getInstance().triggerSOSLocationProcess(); +// StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); +// Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! } // try { // sleep(1000); diff --git a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java index 50ec7a73..a691ef95 100644 --- a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java +++ b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java @@ -18,6 +18,7 @@ import android.util.Log; import com.enqualcomm.support.Config; import com.enqualcomm.support.Constants; import com.enqualcomm.support.CoreService; +import com.enqualcomm.support.LocationClient; import com.enqualcomm.support.bean.StringMessage; import com.enqualcomm.support.utils.ICHttpUtil; import com.enqualcomm.support.utils.Util; @@ -62,13 +63,15 @@ public class HeartRateManager extends AbstractInvokeHandlerService implements Se if(runtime.setAlarmType(Runtime.AlarmType.ALARM_HEART_RATE_HIGH)) { //trigger AP10 报警定位 - Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); +// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); + LocationClient.getInstance().triggerSOSLocationProcess(); } }else if ( runtime.getHRS().ppg_threshold_min>0 && runtime.getHRS().getPPG()0 && runtime.getHRS().getBPH()0 && runtime.getHRS().getBPL() 15% , 上次电池并且不是 电池低电状态,则报警 Intent intent=new Intent(); @@ -166,7 +168,8 @@ public class BatteryUtil { play_waning_notify(context); runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY); //trigger AP10 报警定位 - Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(runtime)); +// Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(runtime)); + LocationClient.getInstance().triggerSOSLocationProcess(); } } private void send_batterylow_event_broadcast(Context context,int batlow){ diff --git a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java index d2be579a..7cad5e9e 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java @@ -7,6 +7,7 @@ import android.os.Handler; import com.enqualcomm.support.Config; import com.enqualcomm.support.Constants; import com.enqualcomm.support.CoreService; +import com.enqualcomm.support.LocationClient; import com.enqualcomm.support.bean.Runtime; import com.enqualcomm.support.bean.StringMessage; import com.enqualcomm.support.bean.heartRateStatus; @@ -124,13 +125,15 @@ public class TemperatureUtil { case 1: if(runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_HIGH)) { //trigger AP10 报警定位 - Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); + LocationClient.getInstance().triggerSOSLocationProcess(); +// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); } break; case 2: if(runtime.setAlarmType(Runtime.AlarmType.ALARM_TEMP_LOW)) { //trigger AP10 报警定位 - Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); + LocationClient.getInstance().triggerSOSLocationProcess(); +// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime)); } break; } diff --git a/app/version_code.properties b/app/version_code.properties index 1bbdbf3d..b647750f 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Mon Oct 12 17:45:39 CST 2020 -VERSION_CODE=643 +#Tue Oct 13 12:13:36 CST 2020 +VERSION_CODE=645