From: TrillGates Date: Wed, 3 Nov 2021 09:35:23 +0000 (+0800) Subject: Fixed s123 protocol location upload time too long issues. X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=850d799d17de7738c4e3fb8f38d1e1a175c8046d;p=icsupport.git Fixed s123 protocol location upload time too long issues. --- diff --git a/app/release/ICSer_V1006_2111021448_release.apk b/app/release/ICSer_V1006_2111021448_release.apk new file mode 100644 index 00000000..91b69c9c Binary files /dev/null and b/app/release/ICSer_V1006_2111021448_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 7de0e1fd..e2827736 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index f5abfba9..2a5f7155 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -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) { diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index a84e1e4c..294d5322 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -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(); diff --git a/app/src/main/java/com/enqualcomm/support/NMEAListener.java b/app/src/main/java/com/enqualcomm/support/NMEAListener.java index b80fe11f..d3ed8d81 100644 --- a/app/src/main/java/com/enqualcomm/support/NMEAListener.java +++ b/app/src/main/java/com/enqualcomm/support/NMEAListener.java @@ -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); diff --git a/app/src/main/java/com/enqualcomm/support/bean/ICLocation.java b/app/src/main/java/com/enqualcomm/support/bean/ICLocation.java index 9763027c..167a2b67 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/ICLocation.java +++ b/app/src/main/java/com/enqualcomm/support/bean/ICLocation.java @@ -282,8 +282,8 @@ public class ICLocation { private String MNC = "0"; private int LAC = 0; private int CID = 0; - private int rxlevel = 0; - private boolean datachanged = false; + private int rxLevel = 0; + private boolean dataChanged = false; private String lastMCC = "0"; private String lastMNC = "0"; @@ -295,13 +295,12 @@ public class ICLocation { lastMNC = MNC; lastLAC = LAC; lastCID = CID; - datachanged = false; } public void setMCC(String mcc) { if (!mcc.equals(lastMCC)) { MCC = mcc; - datachanged = true; + dataChanged = true; } } @@ -309,7 +308,7 @@ public class ICLocation { if (!mnc.equals(lastMNC)) { ICLogger.d("MNC==> " + mnc); MNC = mnc; - datachanged = true; + dataChanged = true; } } @@ -317,23 +316,23 @@ public class ICLocation { if (lac != lastLAC) { ICLogger.d("LAC==> " + lac); LAC = lac; - datachanged = true; + dataChanged = true; } } public void setCID(int cid) { if (cid != lastCID) { CID = cid; - datachanged = true; + dataChanged = true; } } - public void setRxlevel(int level) { - rxlevel = level; + public void setRxLevel(int level) { + rxLevel = level; } public boolean isDataChanged() { - return datachanged; + return dataChanged; } public String getMCC() { @@ -344,8 +343,8 @@ public class ICLocation { return MNC; } - public int getRxlevel() { - return rxlevel; + public int getRxLevel() { + return rxLevel; } public long getLAC() { @@ -367,8 +366,8 @@ public class ICLocation { ", MNC='" + MNC + '\'' + ", LAC=" + LAC + ", CID=" + CID + - ", rxlevel=" + rxlevel + - ", datachanged=" + datachanged + + ", rxlevel=" + rxLevel + + ", datachanged=" + dataChanged + ", lastMCC='" + lastMCC + '\'' + ", lastMNC='" + lastMNC + '\'' + ", lastLAC=" + lastLAC + diff --git a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java index 05584b76..fb49a911 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java +++ b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java @@ -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(); } diff --git a/app/src/main/java/com/enqualcomm/support/utils/CellInfoUtil.java b/app/src/main/java/com/enqualcomm/support/utils/CellInfoUtil.java index 6c5cb8df..a71c83ed 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/CellInfoUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/CellInfoUtil.java @@ -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()); diff --git a/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java b/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java index a8265a73..030e3f90 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java +++ b/app/src/main/java/com/enqualcomm/support/utils/NettyConnection.java @@ -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; diff --git a/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java b/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java index 6860e765..9418e66a 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java +++ b/app/src/main/java/com/enqualcomm/support/utils/mqttConnection.java @@ -100,7 +100,6 @@ public class mqttConnection implements Connection { @Override public void send(StringMessage paramStringMessage) { - if (paramStringMessage == null) { ICLogger.i("mqtt send StringMessage Null skip!"); return; diff --git a/app/version_code.properties b/app/version_code.properties index eff2e3f8..0728b323 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Mon Nov 01 10:34:52 CST 2021 -VERSION_CODE=1003 +#Tue Nov 02 14:48:11 CST 2021 +VERSION_CODE=1006