修改定位上传逻辑.
authorTrillGates <williamtrillgates@gmail.com>
Mon, 7 Mar 2022 06:38:01 +0000 (14:38 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 7 Mar 2022 06:38:01 +0000 (14:38 +0800)
app/src/main/java/com/enqualcomm/support/LocationClient.java

index 9e08123..f2d29ad 100644 (file)
@@ -587,9 +587,7 @@ public class LocationClient {
     private static boolean needCheckAgain = false;
 
     public void waitAndSendLocation() {
-
         this.mLbsHelper.getWifiResult();
-
         long timeCost = 0L;
         wifi_ok = false;
         gps_ok = false;
@@ -653,18 +651,11 @@ public class LocationClient {
                         startSOSLocation = false;
                     }
 
-                    if (startNomalLocation = true) {
+                    ICLogger.d("startNomalLocation =-=> " + startNomalLocation);
+                    if (startNomalLocation) {
                         startNomalLocation = false;
-                        if (gps_ok) {
-                            if (!TextUtils.isEmpty(runtime.getWifiInfo())) {
-                                StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime);
-                                DeliverMessage(AP01_CMD);
-                            }
-                        } else {
-                            StringMessage AP02_CMD = protocolAPIHelper.getLBSLocationMSG(runtime);
-                            DeliverMessage(AP02_CMD);
-                        }
-
+                        StringMessage AP01_CMD = protocolAPIHelper.getGPSLocationMSG(runtime);
+                        DeliverMessage(AP01_CMD);
                     }
                     stopCheckLocationResult();
                     String msg = "Location Fixed Type " + runtime.getLocationInstance().getLocationType() + " at " + runtime.getLocationInstance().getLocationTime() + " timeout " + timeout;
@@ -713,16 +704,16 @@ public class LocationClient {
                     runtime.getLocationInstance().setLocationType(locationtype);
                     runtime.getLocationInstance().setLocationTime(TimeUtil.getSystemTime3());
 
-                    if (startSOSLocation == true) {
+                    if (startSOSLocation) {
                         StringMessage AP10_CMD = protocolAPIHelper.getWarningMSG(runtime);
                         DeliverMessage(AP10_CMD);
                         runtime.setAlarmType(Runtime.AlarmType.ALARM_REMOVE_SOS);
                         startSOSLocation = false;
                     }
-                    if (startNomalLocation = true) {
+                    if (startNomalLocation) {
                         startNomalLocation = false;
-                        StringMessage AP02_CMD = protocolAPIHelper.getLBSLocationMSG(runtime);
-                        DeliverMessage(AP02_CMD);
+                        StringMessage AP01_CMD = protocolAPIHelper.getLBSLocationMSG(runtime);
+                        DeliverMessage(AP01_CMD);
                     }
                     stopCheckLocationResult();
                     String msg = "Location Fixed Type " + runtime.getLocationInstance().getLocationType() + " at " + runtime.getLocationInstance().getLocationTime() + " timeout " + timeout;