From: TrillGates Date: Tue, 26 Oct 2021 02:40:45 +0000 (+0800) Subject: 添加了log去查看定位周期的时间 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=937624fae14bc4af93b4f6ebe44602b67bc6de38;p=icsupport.git 添加了log去查看定位周期的时间 --- diff --git a/app/release/ICSer_V992_2110251718_release.apk b/app/release/ICSer_V994_2110260944_release.apk similarity index 78% rename from app/release/ICSer_V992_2110251718_release.apk rename to app/release/ICSer_V994_2110260944_release.apk index 123572a4..e2886cd1 100644 Binary files a/app/release/ICSer_V992_2110251718_release.apk and b/app/release/ICSer_V994_2110260944_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 4c1b09d6..9266415e 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":992,"versionName":"2110251718","enabled":true,"outputFile":"ICSer_V992_2110251718_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V992_2110251718_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":994,"versionName":"2110260944","enabled":true,"outputFile":"ICSer_V994_2110260944_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V994_2110260944_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl b/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl index 32476d65..3d2643b0 100644 --- a/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl +++ b/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl @@ -7,8 +7,8 @@ import com.ic.work.IHeartRateSensorCallback; interface IHeartRateSensorService { void registerCallback(in IHeartRateSensorCallback callback,in String callbackTag); void unRegisterCallback(in IHeartRateSensorCallback callback); - oneway void getHeartRateInfo(int from,in String callbackTag); - oneway void getJustOxygenInfo(in int from,in String callbackTag); - oneway void getJustHeartRateInfo(in int from,in String callbackTag); - oneway void stopCurrentWork(in int from,in String callbackTag); + void getHeartRateInfo(int from,in String callbackTag); + void getJustOxygenInfo(in int from,in String callbackTag); + void getJustHeartRateInfo(in int from,in String callbackTag); + void stopCurrentWork(in int from,in String callbackTag); } \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index 84ccd574..56623045 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -232,6 +232,7 @@ public class Config { public static boolean getSkipMoveCheckFlagGlobal(Context context) { return SharePreferenceUtil.getPrefBoolean(context, KEYGlobalSkipMoveCheckFlag, false); } + public static void setDurationOfVibration(Context context, int cycle) { SharePreferenceUtil.setPrefInt(context, KEYDurationOfVibration, cycle); } @@ -362,7 +363,7 @@ public class Config { runtime.setPpgTestCycleInMinutes(Config.getPPGTestCycleInMinutes(context)); runtime.getLocationInstance().setLocation_cycle(Config.getLocationCycle(context)); runtime.getLocationInstance().setWorkingMod(Config.getLocationMode(context)); - ICLogger.i("current Cycles PPG " + runtime.getPpgTestCycleInMinutes() + " , LocationCycle " + runtime.getLocationInstance().getLocation_cycle() + " LocationMode " + runtime.getLocationInstance().getWorkingMod() + " SkipMoveCheck " +LocationClient.getSkipMoveCheck()); + ICLogger.i("current Cycles PPG " + runtime.getPpgTestCycleInMinutes() + " , LocationCycle " + runtime.getLocationInstance().getLocation_cycle() + " LocationMode " + runtime.getLocationInstance().getWorkingMod() + " SkipMoveCheck " + LocationClient.getSkipMoveCheck()); int mastervolume = getMasterVolume(context); ICAudioManager.setMasterVolume(context, mastervolume); @@ -439,6 +440,7 @@ public class Config { } public static void setLocationCycle(Context context, int cycle_second) { + ICLogger.d("setLocationCycle ==> " + cycle_second); SharePreferenceUtil.setPrefInt(context, KeyLocationCycle, cycle_second); } @@ -1075,7 +1077,7 @@ public class Config { DefaultLocationCycle = 15 * 60; DefaultPPGTestCycleInMinutes = 15; DefaultTemperatureTestCycle = 15 * 60; - } else if (Config.custom_name.equals("Gator") ) { + } else if (Config.custom_name.equals("Gator")) { Config.ConfigAlarm(Runtime.AlarmType.ALARM_SOS, true); Config.ConfigAlarm(Runtime.AlarmType.ALARM_LOWBATTERY, true); Config.ConfigAlarm(Runtime.AlarmType.ALARM_WEARED, true); @@ -1092,6 +1094,11 @@ public class Config { DefaultTemperatureTestCycle = 0; noBroadCastPushTxtNotify = true; } + ICLogger.d("last DefaultLocationCycle ==> " + DefaultLocationCycle); + ICLogger.d("last DefaultLocationMode ==> " + DefaultLocationMode); + ICLogger.d("last DefaultPPGTestCycleInMinutes ==> " + DefaultPPGTestCycleInMinutes); + ICLogger.d("last DefaultTemperatureTestCycle ==> " + DefaultTemperatureTestCycle); + ICLogger.d("last noBroadCastPushTxtNotify ==> " + noBroadCastPushTxtNotify); } } 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 78127c13..61738e8b 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/ICLocation.java +++ b/app/src/main/java/com/enqualcomm/support/bean/ICLocation.java @@ -108,6 +108,7 @@ public class ICLocation { } public void setLocation_cycle(int _locatCycle) { + ICLogger.d("_locatCycle ==> " + _locatCycle); location_cycle = _locatCycle; } @@ -284,18 +285,19 @@ public class ICLocation { private int rxlevel = 0; private boolean datachanged = false; - private String lastMCC="0"; + 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; + public void save_last_MCC_MNC_LAC_CID() { + lastMCC = MCC; + lastMNC = MNC; + lastLAC = LAC; + lastCID = CID; datachanged = false; } + public void setMCC(String mcc) { if (!mcc.equals(lastMCC)) { MCC = mcc; @@ -304,15 +306,15 @@ public class ICLocation { } public void setMNC(String mnc) { - if(!mnc.equals(lastMNC)) { - 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) { - if(lac!=lastLAC) { + if (lac != lastLAC) { ICLogger.d("LAC==> " + lac); LAC = lac; datachanged = true; @@ -320,7 +322,7 @@ public class ICLocation { } public void setCID(int cid) { - if(cid!=lastCID) { + if (cid != lastCID) { CID = cid; datachanged = true; } diff --git a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java index 4e10cd9a..81448d92 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java @@ -22,7 +22,6 @@ import com.enqualcomm.support.provider.ICGlobalSettingsProvider; import com.enqualcomm.support.provider.ICNotificationProvider; import com.enqualcomm.support.provider.WarningItemProvider; import com.enqualcomm.support.service.Deliver; -import com.ic.jni.ICJniUtils; import com.ic.protocols.protocolAPIHelper; import com.ic.work.ITempSensorCallback; import com.ic.work.ITempSensorService; @@ -75,16 +74,20 @@ public class TemperatureUtil { } }; - private static Temperature CurrentTemperature=null; - public void trigger_timer_send(Context context){ - ICLogger.d("trigger_timer_send "+Config.TemperatureTestResultSendTimeOut+" "+Constants.ACTION_TEMP_RESULT_SEND_TIMEOUT); - AlarmHelper.setRealTimeAlarmInSeconds(context,Config.TemperatureTestResultSendTimeOut,Constants.ACTION_TEMP_RESULT_SEND_TIMEOUT); + private static Temperature CurrentTemperature = null; + + public void trigger_timer_send(Context context) { + ICLogger.d("trigger_timer_send " + Config.TemperatureTestResultSendTimeOut + " " + Constants.ACTION_TEMP_RESULT_SEND_TIMEOUT); + AlarmHelper.setRealTimeAlarmInSeconds(context, Config.TemperatureTestResultSendTimeOut, Constants.ACTION_TEMP_RESULT_SEND_TIMEOUT); } - public void sendTempResult(){ + + public void sendTempResult() { //处理结果 handleTemperature(CurrentTemperature); } + private long lastSendTime = 0; + private final ITempSensorCallback.Stub mRemoteCallback = new ITempSensorCallback.Stub() { @Override public void onTemperatureTestError(String message, int code) { @@ -93,10 +96,20 @@ public class TemperatureUtil { @Override public void onTemperatureGet(Temperature temperature) { + ICLogger.d("onTemperatureGet ==> " + temperature); + long currentTime = System.currentTimeMillis(); + //30秒内有多次发送,则不在发送了 + if (lastSendTime != 0 && currentTime - lastSendTime < 30 * 1000) { + ICLogger.d("onTemperatureGet too frequent..."); + return; + } + lastSendTime = currentTime; + //此处加防御代码? + //TODO:从log上看到有多次被调用的迹象 ICLogger.d("on temperature test end..." + temperature); - CurrentTemperature=temperature; - if (CoreService.getInstance()!=null){ - trigger_timer_send( CoreService.getInstance().getApplicationContext()); + CurrentTemperature = temperature; + if (CoreService.getInstance() != null) { + trigger_timer_send(CoreService.getInstance().getApplicationContext()); } } @@ -118,7 +131,7 @@ public class TemperatureUtil { } }; - private void handleTemperature(Temperature temperature) { + private void handleTemperature(Temperature temperature) { ICLogger.i("Temperature done!" + temperature); if (temperature == null) { return; diff --git a/app/version_code.properties b/app/version_code.properties index 547eed14..7863a0a0 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Mon Oct 25 17:18:10 CST 2021 -VERSION_CODE=992 +#Tue Oct 26 09:44:17 CST 2021 +VERSION_CODE=994