From 54e9c001f4e77384df88faab4f672189cd162cd5 Mon Sep 17 00:00:00 2001 From: snickersun Date: Thu, 21 Jan 2021 19:21:19 +0800 Subject: [PATCH] =?utf8?q?=E5=AE=A2=E6=88=B7ZSH=E5=9B=A0=E7=BD=91=E7=BB=9C?= =?utf8?q?=E8=BE=83=E5=B7=AE=EF=BC=8C=E7=BB=8F=E5=B8=B8=E7=BC=93=E5=AD=98?= =?utf8?q?=E8=BF=87=E5=A4=9A=E6=B6=88=E6=81=AF=E9=80=A0=E6=88=90=E6=97=A0?= =?utf8?q?=E6=B3=95=E5=8F=8A=E6=97=B6=E5=8F=91=E9=80=81=20=E8=A6=81?= =?utf8?q?=E6=B1=82=E7=9B=B4=E6=8E=A5=E5=8F=91=E9=80=81SOS=E4=BF=A1?= =?utf8?q?=E6=81=AF=EF=BC=8C=E4=B8=8D=E5=81=9A=E7=BC=93=E5=AD=98=E3=80=82?= =?utf8?q?=20=E9=80=9A=E8=BF=87=20persist.sys.sos=5Fat=5Fonce=20=E6=8E=A7?= =?utf8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/enqualcomm/support/Config.java | 1 + .../java/com/enqualcomm/support/LocationClient.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index 1775504e..98163c44 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -52,6 +52,7 @@ public class Config { public static final int GPSLocationTimeoutInSeconds=50; public static final int WiFiLocationTimeoutInSeconds=12; + public static final boolean sendSOSAtOnce=Util.getSystemProperties("persist.sys.sos_at_once","false").equals("true"); public static String c43_branch_name="none"; public static String custom_name="none"; diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index 79c91371..a426f6aa 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -552,9 +552,15 @@ public class LocationClient { btHelper.scanBLE(); } } else { - Util.mSleep(1000); + // Util.mSleep(1000); StringMessage waningmsg = protocolAPIHelper.getWarningMSG(runtime); - DeliverMessage(waningmsg); + if(Config.sendSOSAtOnce){ + //客户ZSH因网络较差,经常缓存过多消息造成无法及时发送 + //要求直接发送SOS信息,不做缓存。 + connection.send(waningmsg); + }else { + DeliverMessage(waningmsg); + } } } -- 2.17.1