fixed fzd_c5 wear state default state.
authorTrillGates <williamtrillgates@gmail.com>
Sat, 6 Feb 2021 08:05:23 +0000 (16:05 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Sat, 6 Feb 2021 08:05:23 +0000 (16:05 +0800)
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/bean/Runtime.java
app/src/main/java/com/enqualcomm/support/service/InputEventReader.java

index 4a6fab8..da09776 100644 (file)
@@ -742,7 +742,7 @@ public class CoreService extends Service {
                     runtime.getDbHelper().saveContacts(contactArray, false, false, false, false, false, true);
                 }
             }
-        } else if (Config.custom_name.equals("SGL")) { //C5项目
+        } else if (Config.custom_name.equals("SGL") || Config.custom_name.equals("SGLF")) { //C5项目
             Config.ConfigAlarm(Runtime.AlarmType.ALARM_ESCAPE, true);
             Config.ConfigAlarm(Runtime.AlarmType.ALARM_CUTOFF, true);
             Config.ConfigAlarm(Runtime.AlarmType.ALARM_ILLEGAL_CUTOFF, true);
index 787df89..1fd63ff 100644 (file)
@@ -130,22 +130,29 @@ public class Runtime {
 
 
     public boolean check_stat_do_ppg_test() {
-        if (debugflag || (Config.noPPGSensor == false  //有心率
-                && ((isNeedAntioff == true && isAntioff == false) || (isNeedAntioff == false)) //不支持脱腕,或者支持脱腕且佩戴中
+        if (debugflag || (!Config.noPPGSensor  //有心率
+                && (!isNeedAntioff || !isAntioff) //不支持脱腕,或者支持脱腕且佩戴中
         )) {
             return true;
         }
-        ICLogger.i("不符合条件,跳过 心率检测!" + (Config.noPPGSensor == true ? "无心率" : "有心率") + " 有佩戴检测?" + isNeedAntioff + " 脱落?" + isAntioff);
+        ICLogger.i("不符合条件,跳过 心率检测!" + (Config.noPPGSensor  ? "无心率" : "有心率") + " 有佩戴检测?"
+                + isNeedAntioff + " 脱落?"
+                + isAntioff);
         return false;
     }
 
     public boolean check_stat_do_temp_test() {
-        if (debugflag || (Config.noTempSensor == false //有体温
-                && ((isNeedAntioff == true && isAntioff == false) || (isNeedAntioff == false)) //不支持脱腕,或者支持脱腕且佩戴中
+        if (debugflag || (!Config.noTempSensor //有体温
+                && (!isNeedAntioff || !isAntioff) //不支持脱腕,或者支持脱腕且佩戴中
         )) {
             return true;
         }
-        ICLogger.i("不符合条件,跳过 体温检测!" + (Config.noTempSensor == true ? "无体温" : "有体温") + " 充电?" + isPowerConnected() + " 移除充电器时间?" + getMsAfterLastPowerPlugout() + "ms, 需要佩戴检测?" + isNeedAntioff + ", 脱腕?" + isAntioff);
+        ICLogger.i("不符合条件,跳过 体温检测!" +
+                (Config.noTempSensor ? "无体温" : "有体温") +
+                " 充电?" + isPowerConnected() +
+                " 移除充电器时间?" + getMsAfterLastPowerPlugout() +
+                "ms, 需要佩戴检测?" +
+                isNeedAntioff + ", 脱腕?" + isAntioff);
         return false;
     }
 
index bcb643b..30bf2f3 100644 (file)
@@ -4,13 +4,7 @@ import com.enqualcomm.support.utils.ICLogger;
 import com.enqualcomm.support.utils.ThreadPool;
 import com.enqualcomm.support.utils.Util;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.InputStream;
 
 public class InputEventReader {
     public static final int EVENT_TYPE_ANTI=0;
@@ -250,6 +244,6 @@ public class InputEventReader {
     }
 
     public interface InputEventReceiver{
-        public void onInputEventRecevied(int type,int event);
+         void onInputEventRecevied(int type,int event);
     }
 }