Fixed s123 protocol location upload time too long issues.
authorTrillGates <williamtrillgates@gmail.com>
Wed, 3 Nov 2021 09:35:23 +0000 (17:35 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Wed, 3 Nov 2021 09:35:23 +0000 (17:35 +0800)
app/release/ICSer_V1006_2111021448_release.apk [new file with mode: 0644]
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/NMEAListener.java
app/src/main/java/com/enqualcomm/support/bean/ICLocation.java
app/src/main/java/com/enqualcomm/support/bean/Runtime.java
app/src/main/java/com/enqualcomm/support/utils/CellInfoUtil.java
app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java
app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java
app/version_code.properties

diff --git a/app/release/ICSer_V1006_2111021448_release.apk b/app/release/ICSer_V1006_2111021448_release.apk
new file mode 100644 (file)
index 0000000..91b69c9
Binary files /dev/null and b/app/release/ICSer_V1006_2111021448_release.apk differ
index 7de0e1f..e282773 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1003,"versionName":"2111011034","enabled":true,"outputFile":"ICSer_V1003_2111011034_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1003_2111011034_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1006,"versionName":"2111021448","enabled":true,"outputFile":"ICSer_V1006_2111021448_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1006_2111021448_release.apk","properties":{}}]
\ No newline at end of file
index f5abfba..2a5f715 100644 (file)
@@ -72,11 +72,11 @@ import com.enqualcomm.support.utils.Util;
 import com.enqualcomm.support.utils.VibrateUtil;
 import com.enqualcomm.support.utils.WakeLockUtil;
 import com.enqualcomm.support.utils.mqttConnection;
+
 import com.ic.fzd.weather.IFZDWeatherCallback;
 import com.ic.fzd.weather.IFZDWeatherService;
 import com.ic.jni.ICJniUtils;
-import com.ic.protocolSrv.IFZDCallback;
-import com.ic.protocolSrv.IFZDService;
+
 import com.ic.protocols.protocolAPIHelper;
 import com.ic.s123.IS123WeatherCallback;
 import com.ic.s123.IS123WeatherService;
@@ -297,7 +297,7 @@ public class CoreService extends Service {
                 LocationClient.getInstance().triggerSOSLocationProcess();
                 //Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
                 //开启紧急定位模式,GPS 优先1分钟一次定位,持续5分钟
-                runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD);
+                //runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD);
                 setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
                 //SOS模式,心率测试1分钟一次,持续5分钟
                 if (needHRSTestOnSOS) {
index a84e1e4..294d532 100644 (file)
@@ -261,7 +261,7 @@ public class LocationClient {
                             startNomalLocation = false; //蓝牙定位,直接发GPS坐标
                             if (!TextUtils.isEmpty(runtime.getWifiInfo())) {
                                 StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime);
-                                DeliverMessage(AP01_CMD);
+                                Deliver.sendLocationMSG(AP01_CMD);
                             }
                         }
                     }
@@ -464,7 +464,6 @@ public class LocationClient {
                 1, ACTION_CHECK_LOCATION_RESULT);
     }
 
-
     private final static int msgWhat_WaitAndSendLocation = 100;
     private final static int msgWhat_StartLocationProcess = 0;
     private final static int msgWhat_StartBLEProcess = 1;
@@ -569,7 +568,7 @@ public class LocationClient {
     Handler mhandler;
 
 
-    boolean wifi_ok = false, gps_ok = false, lbs_ok = false, gps_nosignal = false;
+    boolean wifi_ok = false, gps_ok = false, lbs_ok = false, gps_noSignal = false;
 
     private static boolean needCheckAgain = false;
 
@@ -581,14 +580,14 @@ public class LocationClient {
         wifi_ok = false;
         gps_ok = false;
         lbs_ok = false;
-        gps_nosignal = false;
+        gps_noSignal = false;
         checktimes++;
         int mode = runtime.getLocationInstance().getWorkingMod();
         if (runtime.getWifiInfo().length() > 0) wifi_ok = true;
         if (runtime.getLocationInstance().getLocationStat() == ICLocation.LOCATION_STAT.LOCATION_FIXED)
             gps_ok = true;
         if (runtime.getLocationInstance().getLocationStat() == ICLocation.LOCATION_STAT.LOCATION_GPS_TIEMOUT)
-            gps_nosignal = true;
+            gps_noSignal = true;
         ICLogger.d("runtime.getLocationInstance().isDataChanged() ==> " + runtime.getLocationInstance().isDataChanged());
         ICLogger.d("runtime.getLocationInstance() ==> " + runtime.getLocationInstance());
         lbs_ok = (runtime.getLocationInstance().isDataChanged() == false
@@ -612,7 +611,7 @@ public class LocationClient {
                     ICLogger.i("waitAndSendLocation " + checktimes + " timeout");
                     timeout = true;
                 }
-                if (mNoMoveTimeout && (timeout || gps_nosignal)) {
+                if (mNoMoveTimeout && (timeout || gps_noSignal)) {
                     //没有移动,GPS超时或者没信号都会给 计数 加 1
                     gpsTimeoutCountOnNoMove++;
                 }
@@ -622,13 +621,18 @@ public class LocationClient {
                     ICLogger.i("waitAndSendLocation " + timeCost + "> 50000ms timeout");
                     //timeout=true;
                 }
-
+                ICLogger.d("lbs_ok ==> " + lbs_ok);
+                ICLogger.d("gps_ok ==> " + gps_ok);
+                ICLogger.d("wifi_ok ==> " + wifi_ok);
+                ICLogger.d("timeout ==> " + timeout);
+                ICLogger.d("gps_noSignal ==> " + gps_noSignal);
+                ICLogger.d("startSOSLocation ==> " + startSOSLocation);
                 // lbs only +timeout, lbs+wifi+gpsNosignal, libs+ , lbs+gps+wifi, Timeout can override wifi and gps
                 if ((lbs_ok && timeout)
                         || (gps_ok)
                         || (lbs_ok && (gps_ok || startSOSLocation))
                         || (lbs_ok && (gps_ok || startSOSLocation) && wifi_ok)
-                        || (lbs_ok && gps_nosignal && wifi_ok)
+                        || (lbs_ok && gps_noSignal && wifi_ok)
                 ) {
                     String locationtype = "LBS";
                     if (gps_ok) {
@@ -649,11 +653,11 @@ public class LocationClient {
                         if (gps_ok) {
                             if (!TextUtils.isEmpty(runtime.getWifiInfo())) {
                                 StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime);
-                                DeliverMessage(AP01_CMD);
+                                Deliver.sendLocationMSG(AP01_CMD);
                             }
                         } else {
                             StringMessage AP02_CMD = protocolAPIHelper.getLBSLocationMSG(runtime);
-                            DeliverMessage(AP02_CMD);
+                            Deliver.sendLocationMSG(AP02_CMD);
                         }
                     }
                     stopCheckLocationResult();
@@ -710,7 +714,7 @@ public class LocationClient {
                     if (startNomalLocation = true) {
                         startNomalLocation = false;
                         StringMessage AP02_CMD = protocolAPIHelper.getLBSLocationMSG(runtime);
-                        DeliverMessage(AP02_CMD);
+                        Deliver.sendLocationMSG(AP02_CMD);
                     }
 
                     stopCheckLocationResult();
index b80fe11..d3ed8d8 100644 (file)
@@ -113,7 +113,6 @@ public class NMEAListener implements NmeaListener, LocationListener {
             if (message.what == MSG_WHAT_GPS_TIMEOUT || message.what == MSG_WHAT_GPS_NOSTAR) {
                 //no start
                 //do nothing
-
             } else if (message.what == MSG_WHAT_GPS_FIXED) {
                 //fixed
                  /*
@@ -121,9 +120,7 @@ public class NMEAListener implements NmeaListener, LocationListener {
                 延迟三秒后才设置runtime的定位标志,以便稳定坐标值。
                  */
                 runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_FIXED);
-
             }
-
             if (!noStop) {
                 ICLogger.i("handleMessage MSG_WHAT_GPS_TIMEOUT/ MSG_WHAT_GPS_NOSTAR/ MSG_WHAT_GPS_FIXED " + message.what);
 
index 9763027..167a2b6 100644 (file)
@@ -282,8 +282,8 @@ public class ICLocation {
     private String MNC = "0";\r
     private int LAC = 0;\r
     private int CID = 0;\r
-    private int rxlevel = 0;\r
-    private boolean datachanged = false;\r
+    private int rxLevel = 0;\r
+    private boolean dataChanged = false;\r
 \r
     private String lastMCC = "0";\r
     private String lastMNC = "0";\r
@@ -295,13 +295,12 @@ public class ICLocation {
         lastMNC = MNC;\r
         lastLAC = LAC;\r
         lastCID = CID;\r
-        datachanged = false;\r
     }\r
 \r
     public void setMCC(String mcc) {\r
         if (!mcc.equals(lastMCC)) {\r
             MCC = mcc;\r
-            datachanged = true;\r
+            dataChanged = true;\r
         }\r
     }\r
 \r
@@ -309,7 +308,7 @@ public class ICLocation {
         if (!mnc.equals(lastMNC)) {\r
             ICLogger.d("MNC==> " + mnc);\r
             MNC = mnc;\r
-            datachanged = true;\r
+            dataChanged = true;\r
         }\r
     }\r
 \r
@@ -317,23 +316,23 @@ public class ICLocation {
         if (lac != lastLAC) {\r
             ICLogger.d("LAC==> " + lac);\r
             LAC = lac;\r
-            datachanged = true;\r
+            dataChanged = true;\r
         }\r
     }\r
 \r
     public void setCID(int cid) {\r
         if (cid != lastCID) {\r
             CID = cid;\r
-            datachanged = true;\r
+            dataChanged = true;\r
         }\r
     }\r
 \r
-    public void setRxlevel(int level) {\r
-        rxlevel = level;\r
+    public void setRxLevel(int level) {\r
+        rxLevel = level;\r
     }\r
 \r
     public boolean isDataChanged() {\r
-        return datachanged;\r
+        return dataChanged;\r
     }\r
 \r
     public String getMCC() {\r
@@ -344,8 +343,8 @@ public class ICLocation {
         return MNC;\r
     }\r
 \r
-    public int getRxlevel() {\r
-        return rxlevel;\r
+    public int getRxLevel() {\r
+        return rxLevel;\r
     }\r
 \r
     public long getLAC() {\r
@@ -367,8 +366,8 @@ public class ICLocation {
                 ", MNC='" + MNC + '\'' +\r
                 ", LAC=" + LAC +\r
                 ", CID=" + CID +\r
-                ", rxlevel=" + rxlevel +\r
-                ", datachanged=" + datachanged +\r
+                ", rxlevel=" + rxLevel +\r
+                ", datachanged=" + dataChanged +\r
                 ", lastMCC='" + lastMCC + '\'' +\r
                 ", lastMNC='" + lastMNC + '\'' +\r
                 ", lastLAC=" + lastLAC +\r
index 05584b7..fb49a91 100644 (file)
@@ -433,7 +433,7 @@ public class Runtime {
      * 4手表运行静止状态            00000000000000000000000000010000        0x00000010
      * 16SOS 报警                  00000000000000010000000000000000        0x00010000
      * 17低电报警                  00000000000000100000000000000000         0x00020000
-     * 18出围栏报警(逃跑出蓝牙监控范围)   00000000000001000000000000000000        0x00040000
+     * 18出围栏报警(逃跑出蓝牙监控范围)   00000000000001000000000000000000  0x00040000
      * 19进围栏报警(目前没用到)   00000000000010000000000000000000         0x00080000
      * 20手环拆除报警 (表带剪断)    00000000000100000000000000000000          0x00100000
      * 21跌倒报警                  00000000001000000000000000000000         0x00200000
@@ -455,7 +455,6 @@ public class Runtime {
         return hex;
     }
 
-
     private String getSettingsValue(String key) {
         Cursor query = contextProxy.getResolver().query(Uri.parse(ICGlobalSettingsProvider.SETTINGS),
                 new String[]{ICDatabaseHelper.sValue},
@@ -471,7 +470,6 @@ public class Runtime {
         return null;
     }
 
-
     //TODO:要判断是否开启低电量报警
     public void updateFZDDevStatusLowbat(boolean lowbattery) {
         //TODO:
@@ -1336,7 +1334,7 @@ public class Runtime {
                 .append(String.format("%1$03d", mnc))
                 .append(String.format("%1$04X", gpsp.getLAC()))
                 .append(String.format("%1$07X", gpsp.getGSMStationCID()))
-                .append(String.format("%1$02X", gpsp.getRxlevel()));
+                .append(String.format("%1$02X", gpsp.getRxLevel()));
         return sb.toString();
     }
 
index 6c5cb8d..a71c83e 100644 (file)
@@ -2,10 +2,6 @@ package com.enqualcomm.support.utils;
 
 import android.content.Context;
 import android.os.Build;
-import android.os.Handler;
-import android.os.Message;
-import android.os.PowerManager;
-import android.provider.ContactsContract;
 import android.telephony.CellInfo;
 import android.telephony.CellInfoCdma;
 import android.telephony.CellInfoGsm;
@@ -21,17 +17,12 @@ import android.telephony.TelephonyManager;
 import android.telephony.cdma.CdmaCellLocation;
 import android.telephony.gsm.GsmCellLocation;
 
-import com.android.internal.telephony.CallManager;
-import com.android.internal.telephony.CallStateException;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneFactory;
 import com.enqualcomm.support.Config;
-import com.enqualcomm.support.GSensorListener;
-import com.enqualcomm.support.adapter.LBSHelper;
 import com.enqualcomm.support.bean.Runtime;
 import com.sprd.internal.telephony.SprdCallManager;
 
-import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
@@ -226,7 +217,7 @@ public class CellInfoUtil {
                     runtime.setCellinfo(gsmSb.toString());
                     runtime.getLocationInstance().setCID(gsmCell.getCid());
                     runtime.getLocationInstance().setLAC(gsmCell.getLac());
-                    runtime.getLocationInstance().setRxlevel(150 - Math.abs(getSignal(telephonyManager, runtime)));
+                    runtime.getLocationInstance().setRxLevel(150 - Math.abs(getSignal(telephonyManager, runtime)));
                     ICLogger.i("LBS GsmCellLocation " + gsmSb.toString());
                     if (Config.LOG_TOFILE) ICLogger.logToFile("LBS", gsmSb.toString());
 
index a8265a7..030e3f9 100644 (file)
@@ -151,14 +151,11 @@ public class NettyConnection implements Connection {
     }
 
     public boolean sendMsg(String cmd) {
-
         if (cmd == null || cmd.isEmpty()) {
             return false;
         }
 
-
         if (!isServerConnected()) {
-
             log("skiped" + cmd);
             if (Config.LOG_TOFILE) ICLogger.logToFile("APILog", " skiped " + cmd);
             return false;
index 6860e76..9418e66 100644 (file)
@@ -100,7 +100,6 @@ public class mqttConnection implements Connection {
 \r
     @Override\r
     public void send(StringMessage paramStringMessage) {\r
-\r
         if (paramStringMessage == null) {\r
             ICLogger.i("mqtt send StringMessage Null skip!");\r
             return;\r
index eff2e3f..0728b32 100644 (file)
@@ -1,2 +1,2 @@
-#Mon Nov 01 10:34:52 CST 2021\r
-VERSION_CODE=1003\r
+#Tue Nov 02 14:48:11 CST 2021\r
+VERSION_CODE=1006\r