添加了log去查看定位周期的时间
authorTrillGates <williamtrillgates@gmail.com>
Tue, 26 Oct 2021 02:40:45 +0000 (10:40 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 26 Oct 2021 02:40:45 +0000 (10:40 +0800)
app/release/ICSer_V994_2110260944_release.apk [moved from app/release/ICSer_V992_2110251718_release.apk with 78% similarity]
app/release/output.json
app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/bean/ICLocation.java
app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V992_2110251718_release.apk
rename to app/release/ICSer_V994_2110260944_release.apk
index 123572a..e2886cd 100644 (file)
Binary files a/app/release/ICSer_V992_2110251718_release.apk and b/app/release/ICSer_V994_2110260944_release.apk differ
index 4c1b09d..9266415 100644 (file)
@@ -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
index 32476d6..3d2643b 100644 (file)
@@ -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
index 84ccd57..5662304 100644 (file)
@@ -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);
     }
 }
 
index 78127c1..61738e8 100644 (file)
@@ -108,6 +108,7 @@ public class ICLocation {
     }\r
 \r
     public void setLocation_cycle(int _locatCycle) {\r
+        ICLogger.d("_locatCycle ==> " + _locatCycle);\r
         location_cycle = _locatCycle;\r
     }\r
 \r
@@ -284,18 +285,19 @@ public class ICLocation {
     private int rxlevel = 0;\r
     private boolean datachanged = false;\r
 \r
-    private String lastMCC="0";\r
+    private String lastMCC = "0";\r
     private String lastMNC = "0";\r
     private int lastLAC = 0;\r
     private int lastCID = 0;\r
 \r
-    public void save_last_MCC_MNC_LAC_CID(){\r
-        lastMCC=MCC;\r
-        lastMNC=MNC;\r
-        lastLAC=LAC;\r
-        lastCID=CID;\r
+    public void save_last_MCC_MNC_LAC_CID() {\r
+        lastMCC = MCC;\r
+        lastMNC = MNC;\r
+        lastLAC = LAC;\r
+        lastCID = CID;\r
         datachanged = false;\r
     }\r
+\r
     public void setMCC(String mcc) {\r
         if (!mcc.equals(lastMCC)) {\r
             MCC = mcc;\r
@@ -304,15 +306,15 @@ public class ICLocation {
     }\r
 \r
     public void setMNC(String mnc) {\r
-       if(!mnc.equals(lastMNC)) {\r
-           ICLogger.d("MNC==> " + mnc);\r
-           MNC = mnc;\r
-           datachanged = true;\r
-       }\r
+        if (!mnc.equals(lastMNC)) {\r
+            ICLogger.d("MNC==> " + mnc);\r
+            MNC = mnc;\r
+            datachanged = true;\r
+        }\r
     }\r
 \r
     public void setLAC(int lac) {\r
-        if(lac!=lastLAC) {\r
+        if (lac != lastLAC) {\r
             ICLogger.d("LAC==> " + lac);\r
             LAC = lac;\r
             datachanged = true;\r
@@ -320,7 +322,7 @@ public class ICLocation {
     }\r
 \r
     public void setCID(int cid) {\r
-        if(cid!=lastCID) {\r
+        if (cid != lastCID) {\r
             CID = cid;\r
             datachanged = true;\r
         }\r
index 4e10cd9..81448d9 100644 (file)
@@ -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;
index 547eed1..7863a0a 100644 (file)
@@ -1,2 +1,2 @@
-#Mon Oct 25 17:18:10 CST 2021\r
-VERSION_CODE=992\r
+#Tue Oct 26 09:44:17 CST 2021\r
+VERSION_CODE=994\r