diff --git a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/softcontrol/SoftControlViewModel.kt b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/softcontrol/SoftControlViewModel.kt index 37c887b1dd..695239f216 100644 --- a/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/softcontrol/SoftControlViewModel.kt +++ b/OCH/charter/passenger/src/main/java/com/mogo/och/charter/passenger/ui/softcontrol/SoftControlViewModel.kt @@ -138,7 +138,7 @@ class SoftControlViewModel : ViewModel(), LightAirconditionDoorCallback { */ fun openAndSetAircondition(modeCmd: Int, windSpeedCmd: Int, temperatureCmd: Int) { CallerLogger.d( - M_BUS_P + TAG, "" + "打开空调,模式$modeCmd--档位${windSpeedCmd}--温度:$temperatureCmd" + M_BUS_P + TAG, "打开空调,模式$modeCmd--档位${windSpeedCmd}--温度:$temperatureCmd" ) CallerAutoPilotControlManager.sendRoboBusJinlvM1AirConditionerCmd( 1, modeCmd, windSpeedCmd, temperatureCmd diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/utils/blur/DiskLruCache.java b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/utils/blur/DiskLruCache.java index d20bd4e65e..ce78bbf2d5 100644 --- a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/utils/blur/DiskLruCache.java +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/utils/blur/DiskLruCache.java @@ -694,7 +694,7 @@ final class DiskLruCache implements Closeable { private void validateKey(String key) { Matcher matcher = LEGAL_KEY_PATTERN.matcher(key); if (!matcher.matches()) { - throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,64}: \"" + key + "\""); + throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,64}: " + key); } } @@ -964,11 +964,11 @@ final class DiskLruCache implements Closeable { } public File getCleanFile(int i) { - return new File(directory, key + "" + i); + return new File(directory, key + i); } public File getDirtyFile(int i) { - return new File(directory, key + "" + i + ".tmp"); + return new File(directory, key + i + ".tmp"); } } } diff --git a/app/src/main/java/com/mogo/launcher/crash/CrashSystem.java b/app/src/main/java/com/mogo/launcher/crash/CrashSystem.java index 846e5d3f05..eecd970d72 100644 --- a/app/src/main/java/com/mogo/launcher/crash/CrashSystem.java +++ b/app/src/main/java/com/mogo/launcher/crash/CrashSystem.java @@ -35,7 +35,7 @@ public class CrashSystem implements UncaughtExceptionHandler { private String mOsVersion = null; private String mDeviceId = null; private UncaughtExceptionHandler mDefaultHandler; - private final Map info = new HashMap(); + private final Map info = new HashMap<>(); private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); private boolean mDebug = false; private final List callbackList = new ArrayList<>(); @@ -109,15 +109,13 @@ public class CrashSystem implements UncaughtExceptionHandler { } private boolean handleException(Throwable ex) { - if(ex == null) { - return true; - } else { + if (ex != null) { String msg = ex.getLocalizedMessage(); Log.e("CrashSystem", msg); String filePath = saveCrashInfo2File(ex); Log.i(TAG, "handleException: filePath = " + filePath); - return true; } + return true; } private String saveCrashInfo2File(Throwable ex) { @@ -148,7 +146,7 @@ public class CrashSystem implements UncaughtExceptionHandler { result = entry.getValue(); sb.append(key).append("=").append(result).append("\n"); } - sb.append("TIME=").append(String.valueOf(System.currentTimeMillis())).append("\n"); + sb.append("TIME=").append(System.currentTimeMillis()).append("\n"); sb.append("fileName=").append(fileName).append("\n"); Writer writer = new StringWriter(); PrintWriter pw = new PrintWriter(writer); @@ -187,7 +185,7 @@ public class CrashSystem implements UncaughtExceptionHandler { PackageManager pm = context.getPackageManager(); try { PackageInfo packageInfo = pm.getPackageInfo(this.mAppPackage, 0); - this.mAppVersionCode = "" + packageInfo.versionCode; + this.mAppVersionCode = String.valueOf(packageInfo.versionCode); this.mAppVersionName = packageInfo.versionName; this.mAppPackage = packageInfo.packageName; this.mAppName = packageInfo.applicationInfo.loadLabel(context.getPackageManager()).toString(); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt index 09bd3ea772..bd68920d33 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt @@ -60,11 +60,11 @@ class IdentifyOriginDataDrawer : Identify { //清除缓存 for (data in resultList) { - if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) { + if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains(data.uuid.toString())) { if (TrackerSourceFilterHelper.filterData(data)) { continue } - trafficDataUuidList.remove("" + data.uuid) + trafficDataUuidList.remove(data.uuid.toString()) } } @@ -100,7 +100,7 @@ class IdentifyOriginDataDrawer : Identify { continue } var temp: TrackedObject = data - val uuid = "" + data.uuid + val uuid = data.uuid.toString() val cacheData = mMarkersCaches[uuid] if (cacheData != null) { val color = TrackerSourceFilterHelper.getDefaultColor(data) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java index c6f4b20bb3..3c61109b02 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java @@ -1,11 +1,13 @@ package com.mogo.eagle.core.function.business.identify; import android.annotation.SuppressLint; +import android.os.Build; import android.util.ArraySet; +import androidx.annotation.RequiresApi; + import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.data.traffic.TrafficData; import com.mogo.eagle.core.utilcode.geometry.S2CellId; import com.mogo.eagle.core.utilcode.geometry.S2LatLng; @@ -71,13 +73,13 @@ public class TrackManager { public HashMap filterTrafficData(List trafficData) { //清空上次返回数据,做到缓存复用 mFilterTrafficData.clear(); - long cost = System.currentTimeMillis(); +// long cost = System.currentTimeMillis(); //进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid for (MessagePad.TrackedObject data : trafficData) { if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) { continue; } - String uuid = "" + data.getUuid(); + String uuid = Integer.toString(data.getUuid()); TrackObj trackObj = mMarkersCaches.get(uuid); String color = TrackerSourceFilterHelper.INSTANCE.getDefaultColor(data); @@ -93,24 +95,26 @@ public class TrackManager { if (cellIdCaches.containsValue(pos)) { String findSameValue = cellIdCaches.inverse().get(pos); //uuid处理 - data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build(); - TrackObj cacheTrack = mMarkersCaches.get(findSameValue); - if (cacheTrack != null) { - trackObj = cacheTrack; - MessagePad.TrackedObject cache = cacheTrack.getCache(); - if (cache != null) { - //相对静止物体 感知融合同位置物体,使用缓存数据做覆盖 - if (cacheTrack.relativeStatic()) { - if (data.getColor() != null && !data.getColor().isEmpty()) { - cache = cache.toBuilder().setColor(data.getColor()).build(); + if(findSameValue != null && !findSameValue.isEmpty()){ + data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build(); + TrackObj cacheTrack = mMarkersCaches.get(findSameValue); + if (cacheTrack != null) { + trackObj = cacheTrack; + MessagePad.TrackedObject cache = cacheTrack.getCache(); + if (cache != null) { + //相对静止物体 感知融合同位置物体,使用缓存数据做覆盖 + if (cacheTrack.relativeStatic()) { + if (data.getColor() != null && !data.getColor().isEmpty()) { + cache = cache.toBuilder().setColor(data.getColor()).build(); + } + data = cache; } - data = cache; } + uuid = findSameValue; + trackObj.updateObj(data); + } else { + trackObj = new TrackObj(data,s2CellId,s2LatLng); } - uuid = findSameValue; - trackObj.updateObj(data); - } else { - trackObj = new TrackObj(data,s2CellId,s2LatLng); } } else { trackObj = new TrackObj(data,s2CellId,s2LatLng); @@ -128,7 +132,7 @@ public class TrackManager { public void clearCache(List resultList) { //过滤现有元素 for (MessagePad.TrackedObject data : resultList) { - String uuid = "" + data.getUuid(); + String uuid = Integer.toString(data.getUuid()); if (trafficDataUuid.size() > 0 && trafficDataUuid.contains(uuid)) { if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) { continue; @@ -154,6 +158,7 @@ public class TrackManager { .removeMarker(key); } + @RequiresApi(api = Build.VERSION_CODES.N) public void clearAll() { cellIdCaches.clear(); trafficDataUuid.clear(); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt index 81f546cb3d..e6a7e8a738 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt @@ -41,7 +41,7 @@ object WarningHelper { return } planningObjects.forEach(Consumer { planningObj: PlanningObject -> - val trackId = "" + planningObj.uuid + val trackId = planningObj.uuid.toString() if (mMarkersCaches.containsKey(trackId)) { mMarkersCaches[trackId] ?: return@Consumer if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示 @@ -72,7 +72,7 @@ object WarningHelper { return } planningObjects.forEach(Consumer { planningObj: PlanningObject -> - val trackId = "" + planningObj.uuid + val trackId = planningObj.uuid.toString() if (mMarkersCaches.containsKey(trackId)) { mMarkersCaches[trackId] ?: return@Consumer if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示 diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java index 89431ce387..0d7b30611a 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/glide/utils/DiskLruCache.java @@ -964,11 +964,11 @@ final class DiskLruCache implements Closeable { } public File getCleanFile(int i) { - return new File(directory, key + "" + i); + return new File(directory, key + i); } public File getDirtyFile(int i) { - return new File(directory, key + "" + i + ".tmp"); + return new File(directory, key + i + ".tmp"); } } } diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/storage/lrucache/DiskLruCache.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/storage/lrucache/DiskLruCache.java index aec89acf1a..316c6355e6 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/storage/lrucache/DiskLruCache.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/storage/lrucache/DiskLruCache.java @@ -665,7 +665,7 @@ public final class DiskLruCache implements Closeable { Matcher matcher = LEGAL_KEY_PATTERN.matcher(key); if (!matcher.matches()) { throw new IllegalArgumentException("keys must match regex " - + STRING_KEY_PATTERN + ": \"" + key + "\""); + + STRING_KEY_PATTERN + ": " + key); } } diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/UriUtils.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/UriUtils.java index 35e93d33b6..4a48c8ddc9 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/UriUtils.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/UriUtils.java @@ -310,7 +310,7 @@ public final class UriUtils { InputStream is = null; try { is = Utils.getApp().getContentResolver().openInputStream(uri); - File file = new File(Utils.getApp().getCacheDir(), "" + System.currentTimeMillis()); + File file = new File(Utils.getApp().getCacheDir(), String.valueOf(System.currentTimeMillis())); UtilsBridge.writeFileFromIS(file.getAbsolutePath(), is); return file; } catch (FileNotFoundException e) {