From: SnickerSun Date: Sat, 2 Oct 2021 16:12:37 +0000 (+0800) Subject: release ICProtocol81_V932 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=2699fa5253bbf07d87a7c8f0e9586154d20de854;p=protocol_srv.git release ICProtocol81_V932 LBS 定位,确保每次扫描更新 MOD9 定位,GPS定位历史状态清除,解决上一次GPS定位后每次都会上报GPS已经定位的问题。 --- diff --git a/app/release/ICProtocol81_V931_2109232020_release.apk b/app/release/ICProtocol81_V932_2110030008_release.apk similarity index 78% rename from app/release/ICProtocol81_V931_2109232020_release.apk rename to app/release/ICProtocol81_V932_2110030008_release.apk index 963b26cf..2b2fc659 100644 Binary files a/app/release/ICProtocol81_V931_2109232020_release.apk and b/app/release/ICProtocol81_V932_2110030008_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index b158c259..1c7a2d7b 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/ic/protocolSrv/LocationClient.java b/app/src/main/java/com/ic/protocolSrv/LocationClient.java index 4a87fe20..8f9bb565 100644 --- a/app/src/main/java/com/ic/protocolSrv/LocationClient.java +++ b/app/src/main/java/com/ic/protocolSrv/LocationClient.java @@ -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切换回来有此风险。 diff --git a/app/src/main/java/com/ic/protocolSrv/bean/ICLocation.java b/app/src/main/java/com/ic/protocolSrv/bean/ICLocation.java index 52f73cf1..4217cef8 100644 --- a/app/src/main/java/com/ic/protocolSrv/bean/ICLocation.java +++ b/app/src/main/java/com/ic/protocolSrv/bean/ICLocation.java @@ -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) { diff --git a/app/src/main/java/com/ic/protocolSrv/utils/CellInfoUtil.java b/app/src/main/java/com/ic/protocolSrv/utils/CellInfoUtil.java index 9474b780..b182e9d7 100644 --- a/app/src/main/java/com/ic/protocolSrv/utils/CellInfoUtil.java +++ b/app/src/main/java/com/ic/protocolSrv/utils/CellInfoUtil.java @@ -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) { diff --git a/app/version_code.properties b/app/version_code.properties index ee0092ac..6c5dbd98 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Thu Sep 23 20:20:45 CST 2021 -VERSION_CODE=931 +#Sun Oct 03 00:08:26 CST 2021 +VERSION_CODE=932