adjust heart test way.
authorTrillGates <williamtrillgates@gmail.com>
Mon, 21 Jun 2021 13:15:13 +0000 (21:15 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 21 Jun 2021 13:15:13 +0000 (21:15 +0800)
app/release/ICSer_V810_2106191854_release.apk [new file with mode: 0644]
app/release/ICSer_V812_2106212109_release.apk [new file with mode: 0644]
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/CoreService.java
app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java
app/src/main/java/com/enqualcomm/support/utils/HeartRateOxygenTestType.java [new file with mode: 0644]
app/src/main/java/com/enqualcomm/support/utils/SimSignalUtil.java
app/src/main/java/com/ic/protocols/protocol_fzd.java
app/version_code.properties

diff --git a/app/release/ICSer_V810_2106191854_release.apk b/app/release/ICSer_V810_2106191854_release.apk
new file mode 100644 (file)
index 0000000..3ac2d63
Binary files /dev/null and b/app/release/ICSer_V810_2106191854_release.apk differ
diff --git a/app/release/ICSer_V812_2106212109_release.apk b/app/release/ICSer_V812_2106212109_release.apk
new file mode 100644 (file)
index 0000000..e1e99f4
Binary files /dev/null and b/app/release/ICSer_V812_2106212109_release.apk differ
index fd3f176..39785b9 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":794,"versionName":"2106171839","enabled":true,"outputFile":"ICSer_V794_2106171839_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V794_2106171839_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":812,"versionName":"2106212109","enabled":true,"outputFile":"ICSer_V812_2106212109_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V812_2106212109_release.apk","properties":{}}]
\ No newline at end of file
index e4b5e7e..ed7c10a 100644 (file)
@@ -10,5 +10,8 @@ interface IHeartRateSensorService {
     //取消接口注册
     void unRegisterCallback(in IHeartRateSensorCallback callback);
     //获取心率相关数据0表示Alarm,1表示客户端用户发出的,3表示服务端发出的单次获取指令
-    void getHeartRateInfo(int from,in String callbackTag);
+    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);
 }
\ No newline at end of file
index d0de085..c485d2e 100644 (file)
@@ -6,6 +6,7 @@ import android.util.JsonReader;
 
 import com.enqualcomm.support.bean.ICLocation;
 import com.enqualcomm.support.bean.Runtime;
+import com.enqualcomm.support.utils.HeartRateOxygenTestType;
 import com.enqualcomm.support.utils.ICAudioManager;
 import com.enqualcomm.support.utils.ICLogger;
 import com.enqualcomm.support.utils.SharePreferenceUtil;
@@ -37,6 +38,8 @@ public class Config {
     public static int defaultHeartbeatCycle = 5;
     public static int sw_release_no = -1;
 
+    public static HeartRateOxygenTestType testType = HeartRateOxygenTestType.ALL;
+
 
     //如果重试都失败,则丢弃命令不进行盲点续传
     public static boolean discard_cmd_after_retryfailed = true;
@@ -799,7 +802,6 @@ public class Config {
     }
 
 
-
     static {
         AlarmConfiglist = new HashMap<>();
         AlarmConfiglist.put(Runtime.AlarmType.ALARM_SOS.ordinal(), true);
index da012f8..b06d3c8 100644 (file)
@@ -1502,15 +1502,14 @@ public class CoreService extends Service {
                 //连接成功,去获取一次天气
                 //如果防走丢的协议的话
                 if (Config.protocol_no == Config.PROTOCOL_FZD) {
+                    ICLogger.d("getFZDWeatherInfo ... ");
                     getFZDWeatherInfo();
                 }
             } else {
                 if (retry_connect_count >= retry_connect_max_times) {
-
                     no_network_Heartbeats_Count++;
                     ICLogger.i("retry " + retry_connect_count + " 次 >= " + retry_connect_max_times + " ,停止重试!等待下一次心跳再重试! 已经第" + no_network_Heartbeats_Count + "次心跳都没有连接服务器成功!");
                     stopConnectionRetryTimer();
-
                 } else {
                     retry_connect_count++;
                     String ip = runtime.getDnsUtil().getServerIP_ByDNSCache(runtime.getHost());
index 8ba7ea5..43905b5 100644 (file)
@@ -19,8 +19,10 @@ import com.enqualcomm.support.bean.StringMessage;
 import com.enqualcomm.support.bean.heartRateStatus;
 import com.enqualcomm.support.service.base.AbstractInvokeHandlerService;
 import com.enqualcomm.support.utils.Connection;
+import com.enqualcomm.support.utils.HeartRateOxygenTestType;
 import com.enqualcomm.support.utils.ICLogger;
 import com.enqualcomm.support.utils.TimeUtil;
+import com.enqualcomm.support.utils.Util;
 import com.ic.protocols.protocolAPIHelper;
 import com.ic.work.IHeartRateSensorCallback;
 import com.ic.work.IHeartRateSensorService;
@@ -200,14 +202,11 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
                 if (Runtime.healthInfo.getInfoCount() >= (30 - 1)) {
                     //超过30次发送数据给服务器
                     ICLogger.i("自由锻炼中,发送数据给服务器 " + Runtime.healthInfo.getBufferData().length);
-                    mHandler.post(new Runnable() {
-                        @Override
-                        public void run() {
-//                      ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
-                            Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
-                            //发送过后重置
-                            Runtime.healthInfo.resetBuffer();
-                        }
+                    mHandler.post(() -> {
+                        //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
+                        Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
+                        //发送过后重置
+                        Runtime.healthInfo.resetBuffer();
                     });
                 }
             } else {
@@ -308,7 +307,22 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
         new Thread(() -> {
             try {
                 if (heartRateSensorService != null) {
-                    heartRateSensorService.getHeartRateInfo(from, HeartRateManager.class.getName());
+                    //判断类型,如果不是GH301的硬件,直接走全部测试
+                    String isGh301 = Util.getSystemProperties("persist.sys.is_gh301", "false");
+                    if (!Boolean.parseBoolean(isGh301)) {
+                        heartRateSensorService.getHeartRateInfo(from, HeartRateManager.class.getName());
+                    } else {
+                        //如果是的话,就要判断类型了
+                        //这个类型在Config里,在parseCMD里进行设置
+                        //在这里进行使用
+                        if (Config.testType == HeartRateOxygenTestType.JUST_HEART_RATE) {
+                            //测量心率
+                            heartRateSensorService.getJustHeartRateInfo(from, HeartRateManager.class.getName());
+                        } else if (Config.testType == HeartRateOxygenTestType.JUST_OXYGEN) {
+                            //测量血氧
+                            heartRateSensorService.getJustOxygenInfo(from, HeartRateManager.class.getName());
+                        }
+                    }
                 }
             } catch (Exception e) {
                 e.printStackTrace();
diff --git a/app/src/main/java/com/enqualcomm/support/utils/HeartRateOxygenTestType.java b/app/src/main/java/com/enqualcomm/support/utils/HeartRateOxygenTestType.java
new file mode 100644 (file)
index 0000000..302ea87
--- /dev/null
@@ -0,0 +1,5 @@
+package com.enqualcomm.support.utils;
+
+public enum HeartRateOxygenTestType {
+    ALL, JUST_OXYGEN, JUST_HEART_RATE
+}
index 03b0e2e..6cd75e9 100644 (file)
@@ -1,18 +1,14 @@
 package com.enqualcomm.support.utils;
 
-import android.app.Notification;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
-import android.hardware.display.DisplayManager;
-import android.media.AudioManager;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
-import android.os.Build;
 import android.os.PowerManager;
 import android.provider.Settings;
 import android.telephony.TelephonyManager;
-import android.view.Display;
+
 import com.enqualcomm.support.bean.Runtime;
 
 import static android.content.Context.POWER_SERVICE;
@@ -26,157 +22,161 @@ import static android.telephony.TelephonyManager.NETWORK_TYPE_LTE;
 import static android.telephony.TelephonyManager.NETWORK_TYPE_UMTS;
 
 public class SimSignalUtil {
-  public static final int IS_2G = 0;
-  
-  public static final int IS_3G = 1;
-  
-  public static final int IS_4G = 2;
-  
-  public static final int IS_UNKNOWN = -1;
-  
-  protected static SimSignalUtil simSignalUtil=null;
-  
-  Context context;
-  
-  int last_WorkType = -1;
-  
-  private int mNetworkType;
-  
-  int[] netWorkTypeArr = { 2, 2, 2, 2, 2 };
-  
-  private SimSignalUtil(Context paramContext) {
-    this.context = paramContext;
-    init();
-  }
-  
-  public synchronized static  SimSignalUtil getInstance(Context paramContext) {
-    if (simSignalUtil ==null)
-      simSignalUtil = new SimSignalUtil(paramContext);
-    return simSignalUtil;
-  }
-  public boolean IsAirModeOn() { return (Settings.System.getInt(this.context.getContentResolver(), "airplane_mode_on", 0) == 1); }
-  
-  public void changeNetWorkType(int paramInt1, int paramInt2) {
-    StringBuilder stringBuilder = new StringBuilder();
-    stringBuilder.append("BuildConfig.upLoadData=falsenetworkType=");
-    stringBuilder.append(paramInt1);
-    stringBuilder.append("flag=");
-    stringBuilder.append(paramInt2);
-    ICLogger.i(stringBuilder.toString());
-  }
-
-   public static boolean hasSimCard(Context context) {
-
-    TelephonyManager telMgr = (TelephonyManager)
-            context.getSystemService(Context.TELEPHONY_SERVICE);
-    int simState = telMgr.getSimState();
-    boolean result = true;
-    switch (simState) {
-      case TelephonyManager.SIM_STATE_ABSENT:
-        result = false; // 没有SIM卡
-        break;
-      case TelephonyManager.SIM_STATE_UNKNOWN:
-        result = false;
-        break;
-    }
-//    ICLogger.i( result ? "有SIM卡" : "无SIM卡");
-    return result;
-  }
-
-  public void changeNetWorkType(String paramString) {
-    Intent intent = new Intent("android.intent.action.NETWORK_MODE_CTRL");
-    intent.putExtra("mode", paramString);
-    this.context.sendBroadcast(intent);
-    StringBuilder stringBuilder = new StringBuilder();
-    stringBuilder.append("changeNetWorkType=");
-    stringBuilder.append(paramString);
-    ICLogger.i(stringBuilder.toString());
-  }
-
-  /**
-   * 检查用户的网络:是否有网络,所需权限:<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
-   */
-  public static boolean checkNet(Context context) {
-    // 判断:WIFI链接
-    boolean isWIFI = isWIFIConnection(context);
-    // 判断:Mobile链接
-    boolean isMOBILE = isMOBILEConnection(context);
-    if (!isWIFI && !isMOBILE) {
-      return false;//既不是手机连接,也不是wifi连接
-    }
-    return true;
-  }/**
-   * 判断:是否是手机链接
-   * @param context
-   * @return
-   */
-  private static boolean isMOBILEConnection(Context context) {
-    ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
-    //获取连接的信息
-    NetworkInfo networkInfo = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
-    if (networkInfo != null) {
-      return networkInfo.isConnected();
-    }
-    return false;
-  }
-
-  /**
-   * 判断:WIFI链接
-   *
-   * @param context
-   * @return
-   */
-  private static boolean isWIFIConnection(Context context) {
-    ConnectivityManager manager = (ConnectivityManager) context
-            .getSystemService(Context.CONNECTIVITY_SERVICE);
-
-    NetworkInfo networkInfo = manager
-            .getNetworkInfo(ConnectivityManager.TYPE_WIFI);
-    if (networkInfo != null) {
-      return networkInfo.isConnected();
-    }
-    return false;
-  }
-  public int getNetworkType() {
-    init();
-    int networktype=IS_UNKNOWN;
-    switch (this.mNetworkType){
-
-      case NETWORK_TYPE_GPRS: //1
-      case NETWORK_TYPE_EDGE: //2
-     case NETWORK_TYPE_CDMA://4
-        networktype=IS_2G;
-        break;
-      case  NETWORK_TYPE_UMTS://3
-      case NETWORK_TYPE_HSDPA://8
-      case NETWORK_TYPE_EVDO_0: //5
-      case NETWORK_TYPE_EVDO_A: //6
-        networktype=IS_3G;
-        break;
-
-      case NETWORK_TYPE_LTE:
-        networktype=IS_4G;
-        break;
-
-      default:
-        networktype=IS_UNKNOWN;
-        break;
-    }
-
-    return networktype;
-  }
-  
-  public void init() {
-    this.mNetworkType = ((TelephonyManager)this.context.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkType();
-  }
-
-
-  public static boolean isScreenON(Context context) {
-      // If you use less than API20:
-      PowerManager powerManager = (PowerManager) context.getSystemService(POWER_SERVICE);
-      // If the screen is off then the device has been locked
-
-      boolean lisScreenOn;
+    public static final int IS_2G = 0;
+
+    public static final int IS_3G = 1;
+
+    public static final int IS_4G = 2;
+
+    public static final int IS_UNKNOWN = -1;
+
+    protected static SimSignalUtil simSignalUtil = null;
+
+    Context context;
+
+    int last_WorkType = -1;
+
+    private int mNetworkType;
+
+    int[] netWorkTypeArr = {2, 2, 2, 2, 2};
+
+    private SimSignalUtil(Context paramContext) {
+        this.context = paramContext;
+        init();
+    }
+
+    public synchronized static SimSignalUtil getInstance(Context paramContext) {
+        if (simSignalUtil == null)
+            simSignalUtil = new SimSignalUtil(paramContext);
+        return simSignalUtil;
+    }
+
+    public boolean IsAirModeOn() {
+        return (Settings.System.getInt(this.context.getContentResolver(), "airplane_mode_on", 0) == 1);
+    }
+
+    public void changeNetWorkType(int paramInt1, int paramInt2) {
+        StringBuilder stringBuilder = new StringBuilder();
+        stringBuilder.append("BuildConfig.upLoadData=falsenetworkType=");
+        stringBuilder.append(paramInt1);
+        stringBuilder.append("flag=");
+        stringBuilder.append(paramInt2);
+        ICLogger.i(stringBuilder.toString());
+    }
+
+    public static boolean hasSimCard(Context context) {
+
+        TelephonyManager telMgr = (TelephonyManager)
+                context.getSystemService(Context.TELEPHONY_SERVICE);
+        int simState = telMgr.getSimState();
+        boolean result = true;
+        switch (simState) {
+            case TelephonyManager.SIM_STATE_ABSENT:
+            case TelephonyManager.SIM_STATE_UNKNOWN:
+                result = false; // 没有SIM卡
+                break;
+        }
+        return result;
+    }
+
+    public void changeNetWorkType(String paramString) {
+        Intent intent = new Intent("android.intent.action.NETWORK_MODE_CTRL");
+        intent.putExtra("mode", paramString);
+        this.context.sendBroadcast(intent);
+        StringBuilder stringBuilder = new StringBuilder();
+        stringBuilder.append("changeNetWorkType=");
+        stringBuilder.append(paramString);
+        ICLogger.i(stringBuilder.toString());
+    }
+
+    /**
+     * 检查用户的网络:是否有网络,所需权限:<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+     */
+    public static boolean checkNet(Context context) {
+        // 判断:WIFI链接
+        boolean isWIFI = isWIFIConnection(context);
+        // 判断:Mobile链接
+        boolean isMOBILE = isMOBILEConnection(context);
+        if (!isWIFI && !isMOBILE) {
+            return false;//既不是手机连接,也不是wifi连接
+        }
+        return true;
+    }
+
+    /**
+     * 判断:是否是手机链接
+     *
+     * @param context
+     * @return
+     */
+    private static boolean isMOBILEConnection(Context context) {
+        ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+        //获取连接的信息
+        NetworkInfo networkInfo = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
+        if (networkInfo != null) {
+            return networkInfo.isConnected();
+        }
+        return false;
+    }
+
+    /**
+     * 判断:WIFI链接
+     *
+     * @param context
+     * @return
+     */
+    private static boolean isWIFIConnection(Context context) {
+        ConnectivityManager manager = (ConnectivityManager) context
+                .getSystemService(Context.CONNECTIVITY_SERVICE);
+
+        NetworkInfo networkInfo = manager
+                .getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+        if (networkInfo != null) {
+            return networkInfo.isConnected();
+        }
+        return false;
+    }
+
+    public int getNetworkType() {
+        init();
+        int networktype = IS_UNKNOWN;
+        switch (this.mNetworkType) {
+
+            case NETWORK_TYPE_GPRS: //1
+            case NETWORK_TYPE_EDGE: //2
+            case NETWORK_TYPE_CDMA://4
+                networktype = IS_2G;
+                break;
+            case NETWORK_TYPE_UMTS://3
+            case NETWORK_TYPE_HSDPA://8
+            case NETWORK_TYPE_EVDO_0: //5
+            case NETWORK_TYPE_EVDO_A: //6
+                networktype = IS_3G;
+                break;
+
+            case NETWORK_TYPE_LTE:
+                networktype = IS_4G;
+                break;
+
+            default:
+                networktype = IS_UNKNOWN;
+                break;
+        }
+
+        return networktype;
+    }
+
+    public void init() {
+        this.mNetworkType = ((TelephonyManager) this.context.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkType();
+    }
+
+
+    public static boolean isScreenON(Context context) {
+        // If you use less than API20:
+        PowerManager powerManager = (PowerManager) context.getSystemService(POWER_SERVICE);
+        // If the screen is off then the device has been locked
+
+        boolean lisScreenOn;
 
 //      if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
 //
@@ -188,68 +188,70 @@ public class SimSignalUtil {
 
 //      }
 
-    return lisScreenOn;
-  }
-  public static void send_at_to_reset_simcard(Runtime runtime){
-
-    Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
-    intent.putExtra("command", "AT+SFUN=2"); //重新初始化sim卡
-    intent.putExtra("arg2", "");
-    ( runtime.getContextProxy()).context.sendBroadcast(intent);
-    ICLogger.i("send_at_to_reset_simcard ");
-  }
-
-  public static void send_at_to_update_lbs(Runtime runtime) {
-    Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
-    intent.putExtra("command", "AT+CREG=2");
-    intent.putExtra("arg2", "");
-    (runtime.getContextProxy()).context.sendBroadcast(intent);
-    ICLogger.i("send_at_to_update_lbs ");
-  }
-
-  public static void send_at_cmd(Runtime runtime, String cmd){
-    Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
-    intent.putExtra("command", cmd);
-    intent.putExtra("arg2", "");
-    ( runtime.getContextProxy()).context.sendBroadcast(intent);
-    ICLogger.i("send_at_cmd "+cmd);
-  }
-  public static void send_at_setImei0(Runtime runtime, String imei){
-    send_at_cmd(runtime,"AT+SPIMEI=0,"+imei);
-  }
-  public static void send_at_setImei1(Runtime runtime, String imei){
-    send_at_cmd(runtime,"AT+SPIMEI=1,"+imei);
-  }
-
-  public static void setAirMode(Context context,String paramString) {
-
-    final ContentResolver cr = context.getContentResolver();
-
-    ICLogger.i("setAirMode "+paramString);
-    if ("OpenAirplane".equals(paramString))
-    {
-
-        //获取当前飞行模式状态,返回的是String值0,或1.0为关闭飞行,1为开启飞行
-        //如果关闭飞行,则打开飞行
-//      am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
-   //   Settings.System.putString(cr, Settings.System.AIRPLANE_MODE_ON, "1");
-      Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
-        intent.putExtra("state",true);
-        context.sendBroadcast(intent);
+        return lisScreenOn;
+    }
+
+    public static void send_at_to_reset_simcard(Runtime runtime) {
+
+        Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
+        intent.putExtra("command", "AT+SFUN=2"); //重新初始化sim卡
+        intent.putExtra("arg2", "");
+        (runtime.getContextProxy()).context.sendBroadcast(intent);
+        ICLogger.i("send_at_to_reset_simcard ");
+    }
 
-    }else if ("CloseAirplane".equals(paramString)) {
+    public static void send_at_to_update_lbs(Runtime runtime) {
+        Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
+        intent.putExtra("command", "AT+CREG=2");
+        intent.putExtra("arg2", "");
+        (runtime.getContextProxy()).context.sendBroadcast(intent);
+        ICLogger.i("send_at_to_update_lbs ");
+    }
+
+    public static void send_at_cmd(Runtime runtime, String cmd) {
+        Intent intent = new Intent("com.eqc.intent.action.getTelephony.lbs");
+        intent.putExtra("command", cmd);
+        intent.putExtra("arg2", "");
+        (runtime.getContextProxy()).context.sendBroadcast(intent);
+        ICLogger.i("send_at_cmd " + cmd);
+    }
 
-        //获取当前飞行模式状态,返回的是String值0,或1.0为关闭飞行,1为开启飞行
-        //如果关闭飞行,则打开飞行
-   //     Settings.System.putString(cr, Settings.System.AIRPLANE_MODE_ON, "0");
-        Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
-        intent.putExtra("state",false);
-        context.sendBroadcast(intent);
+    public static void send_at_setImei0(Runtime runtime, String imei) {
+        send_at_cmd(runtime, "AT+SPIMEI=0," + imei);
+    }
 
+    public static void send_at_setImei1(Runtime runtime, String imei) {
+        send_at_cmd(runtime, "AT+SPIMEI=1," + imei);
     }
 
+    public static void setAirMode(Context context, String paramString) {
 
-  }
+        final ContentResolver cr = context.getContentResolver();
+
+        ICLogger.i("setAirMode " + paramString);
+        if ("OpenAirplane".equals(paramString)) {
+
+            //获取当前飞行模式状态,返回的是String值0,或1.0为关闭飞行,1为开启飞行
+            //如果关闭飞行,则打开飞行
+//      am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
+            //   Settings.System.putString(cr, Settings.System.AIRPLANE_MODE_ON, "1");
+            Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+            intent.putExtra("state", true);
+            context.sendBroadcast(intent);
+
+        } else if ("CloseAirplane".equals(paramString)) {
+
+            //获取当前飞行模式状态,返回的是String值0,或1.0为关闭飞行,1为开启飞行
+            //如果关闭飞行,则打开飞行
+            //     Settings.System.putString(cr, Settings.System.AIRPLANE_MODE_ON, "0");
+            Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+            intent.putExtra("state", false);
+            context.sendBroadcast(intent);
+
+        }
+
+
+    }
 
 }
 
index af0f1f9..21bb41e 100644 (file)
@@ -43,6 +43,7 @@ import com.enqualcomm.support.service.HeartRateManager;
 import com.enqualcomm.support.utils.AlarmHelper;
 import com.enqualcomm.support.utils.CameraUtil;
 import com.enqualcomm.support.utils.Connection;
+import com.enqualcomm.support.utils.HeartRateOxygenTestType;
 import com.enqualcomm.support.utils.ICLogger;
 import com.enqualcomm.support.utils.MD5;
 import com.enqualcomm.support.utils.ProfileManager;
@@ -1560,11 +1561,13 @@ public class protocol_fzd {
             case hrtstart:
                 handleHrtstart(mConnection);
                 ICLogger.i("收到服务器心率检测命令");
+                Config.testType = HeartRateOxygenTestType.JUST_HEART_RATE;
                 if (mRuntime.check_stat_do_ppg_test())
                     HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
                 break;
             case bldstart:
                 handleBldstart(mConnection);
+                Config.testType = HeartRateOxygenTestType.JUST_OXYGEN;
                 ICLogger.i("收到服务器血压检测命令");
                 if (mRuntime.check_stat_do_ppg_test())
                     HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
index d5f39a4..6fe8197 100644 (file)
@@ -1,2 +1,2 @@
-#Sat Jun 19 18:02:24 CST 2021
-VERSION_CODE=808
+#Mon Jun 21 21:14:35 CST 2021
+VERSION_CODE=813