release ICProtocol81_V932
authorSnickerSun <scy@incartech.cn>
Sat, 2 Oct 2021 16:12:37 +0000 (00:12 +0800)
committerSnickerSun <scy@incartech.cn>
Sat, 2 Oct 2021 16:12:37 +0000 (00:12 +0800)
LBS 定位,确保每次扫描更新
MOD9 定位,GPS定位历史状态清除,解决上一次GPS定位后每次都会上报GPS已经定位的问题。

app/release/ICProtocol81_V932_2110030008_release.apk [moved from app/release/ICProtocol81_V931_2109232020_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/ic/protocolSrv/LocationClient.java
app/src/main/java/com/ic/protocolSrv/bean/ICLocation.java
app/src/main/java/com/ic/protocolSrv/utils/CellInfoUtil.java
app/version_code.properties

similarity index 78%
rename from app/release/ICProtocol81_V931_2109232020_release.apk
rename to app/release/ICProtocol81_V932_2110030008_release.apk
index 963b26c..2b2fc65 100644 (file)
Binary files a/app/release/ICProtocol81_V931_2109232020_release.apk and b/app/release/ICProtocol81_V932_2110030008_release.apk differ
index b158c25..1c7a2d7 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":931,"versionName":"2109232020","enabled":true,"outputFile":"ICProtocol81_V931_2109232020_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V931_2109232020_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":932,"versionName":"2110030008","enabled":true,"outputFile":"ICProtocol81_V932_2110030008_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V932_2110030008_release.apk","properties":{}}]
\ No newline at end of file
index 4a87fe2..8f9bb56 100644 (file)
@@ -414,7 +414,7 @@ public class LocationClient {
 
         boolean FactryModeOpening = DeviceInfoUtil.isFactoryTestTopActivity(runtime.getContextProxy().context);
         boolean needReOpenGPS = runtime.getFactoryTestingStat();
-
+        runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_OPEN);
         //防止与工厂测试冲突
         if (FactryModeOpening == false || needReOpenGPS == true) {
 
@@ -591,7 +591,7 @@ public class LocationClient {
         if (runtime.getLocationInstance().getLocationStat() == ICLocation.LOCATION_STAT.LOCATION_GPS_TIEMOUT)
             gps_nosignal = true;
         lbs_ok = (
-                runtime.getLocationInstance().isDataChanged() == false  /*如果mcc,mnc等都没有变过 */||
+                runtime.getLocationInstance().isDataChanged() == false  /*如果mcc,mnc等都没有赋过值 */||
                 ( runtime.getLocationInstance().getMNC().equals("0")   && runtime.getLocationInstance().getMCC().equals("0")
                   && runtime.getLocationInstance().getGSMStationCID() == 0  && runtime.getLocationInstance().getLAC() == 0
                 )
@@ -690,6 +690,7 @@ public class LocationClient {
                     ICLogger.i("waitAndSendLocation WiFi TimeOut " + checktimes + " > "+WiFiLocationTimeoutInSeconds + " or timeCost "+timeCost+"> "+WiFiLocationTimeoutInSeconds*1000+"ms ");
                     if (!wifi_timeout)
                     {
+                        gpsTimeoutCountOnNoMove = 0; //只要有一次不是GPS定位,则清零。
                         startGpsLocate();
                     }
                     wifi_timeout = true;
@@ -1143,6 +1144,8 @@ public class LocationClient {
                         nmeaListener.setNoStop(false);
                     }
                     //所有定位逻辑都和CUSTOM_MOD8_GPS 一致,除了开始GPS定位。后期开始就不用clean GPS状态了
+                    //为了保证历史GPS状态不会影响当前状态,首先清除上一次的 定位状态
+                    runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_UNKNOWN);
 //                    startGpsLocate();
                 } else {
                     clearGPSlocateStat(); //如果wifi优先,则确保gps关闭,防止切换回来gps状态错误,尤其是不NoStop模式下的gps切换回来有此风险。
index 52f73cf..4217cef 100644 (file)
@@ -84,6 +84,7 @@ public class ICLocation {
         LOCATION_GPS_TIEMOUT,
         LOCATION_WIFI_FAILED,
         LOCATION_CLOSED,
+        LOCATION_UNKNOWN,
     }
 
 
@@ -284,25 +285,46 @@ public class ICLocation {
     private int rxlevel = 0;
     private boolean datachanged = false;
 
+    private String lastMCC="0";
+    private String lastMNC = "0";
+    private int lastLAC = 0;
+    private int lastCID = 0;
+
+    public void save_last_MCC_MNC_LAC_CID(){
+        lastMCC=MCC;
+        lastMNC=MNC;
+        lastLAC=LAC;
+        lastCID=CID;
+        datachanged = false;
+    }
     public void setMCC(String mcc) {
-        MCC = mcc;
-        datachanged = true;
+        if (!mcc.equals(lastMCC)) {
+            MCC = mcc;
+            datachanged = true;
+        }
     }
 
     public void setMNC(String mnc) {
-        ICLogger.d("MNC==> " + mnc);
-        MNC = mnc;
-        datachanged = true;
+       if(!mnc.equals(lastMNC)) {
+           ICLogger.d("MNC==> " + mnc);
+           MNC = mnc;
+           datachanged = true;
+       }
     }
 
     public void setLAC(int lac) {
-        LAC = lac;
-        datachanged = true;
+        if(lac!=lastLAC) {
+            ICLogger.d("LAC==> " + lac);
+            LAC = lac;
+            datachanged = true;
+        }
     }
 
     public void setCID(int cid) {
-        CID = cid;
-        datachanged = true;
+        if(cid!=lastCID) {
+            CID = cid;
+            datachanged = true;
+        }
     }
 
     public void setRxlevel(int level) {
index 9474b78..b182e9d 100644 (file)
@@ -141,6 +141,7 @@ public class CellInfoUtil {
          * CID,Cell Identity,基站编号。
          * BSSS,Base station signal strength,基站信号强度。
          */
+        runtime.getLocationInstance().save_last_MCC_MNC_LAC_CID();
         int maxstationCount = 0;
         String mccmnc;
         if (Build.VERSION.SDK_INT > 23) {
index ee0092a..6c5dbd9 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Sep 23 20:20:45 CST 2021\r
-VERSION_CODE=931\r
+#Sun Oct 03 00:08:26 CST 2021\r
+VERSION_CODE=932\r