release ICSer_V904_2110142133_release
authorTrillGates <williamtrillgates@gmail.com>
Thu, 14 Oct 2021 13:47:04 +0000 (21:47 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Thu, 14 Oct 2021 13:47:04 +0000 (21:47 +0800)
app/release/ICSer_V904_2110142133_release.apk [new file with mode: 0644]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/ic/protocols/protocol_beehome.java
app/version_code.properties

diff --git a/app/release/ICSer_V904_2110142133_release.apk b/app/release/ICSer_V904_2110142133_release.apk
new file mode 100644 (file)
index 0000000..ffd0438
Binary files /dev/null and b/app/release/ICSer_V904_2110142133_release.apk differ
index df79440..bea4a2f 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":903,"versionName":"2109252333","enabled":true,"outputFile":"ICSer_V903_2109252333_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V903_2109252333_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":904,"versionName":"2110142133","enabled":true,"outputFile":"ICSer_V904_2110142133_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V904_2110142133_release.apk","properties":{}}]
\ No newline at end of file
index 4469e51..e56d98f 100644 (file)
@@ -73,8 +73,6 @@ import com.ic.protocols.protocolAPIHelper;
 import com.ic.s123.IS123WeatherCallback;
 import com.ic.s123.IS123WeatherService;
 
-import org.apache.harmony.misc.SystemUtils;
-
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
@@ -299,14 +297,11 @@ public class CoreService extends Service {
         }
     }
 
-    private Runnable mupdatePracticeData = new Runnable() {
-        @Override
-        public void run() {
-            //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
-            Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
-            //发送过后重置
-            Runtime.healthInfo.resetBuffer();
-        }
+    private Runnable mUpdatePracticeData = () -> {
+        //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
+        Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
+        //发送过后重置
+        Runtime.healthInfo.resetBuffer();
     };
 
     private final BroadcastReceiver broadcastPracticeCMDReceiver = new BroadcastReceiver() {
@@ -334,7 +329,7 @@ public class CoreService extends Service {
                     if (Runtime.healthInfo.getInfoCount() >= 0) {
                         //超过30次发送数据给服务器
                         ICLogger.i("自由锻炼结束,发送数据给服务器 " + Runtime.healthInfo.getBufferData().length);
-                        mHandler.post(mupdatePracticeData);
+                        mHandler.post(mUpdatePracticeData);
                     }
 
                 }
index e53b368..8801423 100644 (file)
@@ -1,6 +1,8 @@
 package com.ic.protocols;
 
 import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.ContentValues;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Environment;
@@ -130,6 +132,8 @@ public class protocol_beehome {
         APSQ,
         BPMC,//专门控制skipmovecheck
         APMC,//
+        BPPH,//拨号功能开关
+        APPH,
     }
 
     private static HashMap<CMD_TYPE, String> cmdMap = null;
@@ -218,6 +222,8 @@ public class protocol_beehome {
         cmdMap.put(CMD_TYPE.APSQ, "APSQ");
         cmdMap.put(CMD_TYPE.BPMC, "BPMC");
         cmdMap.put(CMD_TYPE.APMC, "APMC");
+        cmdMap.put(CMD_TYPE.BPPH, "BPPH");
+        cmdMap.put(CMD_TYPE.APPH, "APPH");
     }
 
 
@@ -2025,6 +2031,44 @@ public class protocol_beehome {
                 .append(CMDEND).toString());
     }
 
+    /**
+     * 处理拨号开关,数据入库,进入拨号前要获取一下,是否可以拨号,
+     *
+     * @param cmd IWBPPH,353456789012345,080835,1#
+     *            IWAPPH,080835,1#
+     */
+    private void handleBPPH(String cmd) {
+        //解析数据
+        String[] split = cmd.split(CMDSPLIT);
+        if (split.length == 4) {
+            try {
+                String id = split[2];
+                String value = split[3];
+                //1 : 表示设备可以拨号   0:表示设备不可拨号, 用于同步平台设置。
+                Util.setSystemProperties("persist.sys.phone.enable", value);
+                //返回结果
+                responseWithId(cmdMap.get(CMD_TYPE.APPH), id, value);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            ICLogger.d("handleBPPH error...");
+        }
+    }
+
+    private void responseWithId(String cmd, String id, String... args) {
+        StringBuilder append = new StringBuilder(CMDHEADER).append(cmd)
+                .append(CMDSPLIT).append(id);
+        for (String arg : args) {
+            append.append(CMDSPLIT).append(arg);
+        }
+        append.append(CMDEND);
+        ICLogger.d("response content ==> " + append.toString());
+        StringMessage stringMessage = genStringMessage(cmd, append.toString());
+        mConnection.send(stringMessage);
+    }
+
+
     public static StringMessage APHP(int ppg, int bph, int bpl, int spo2) {
         //IWAPHP,60,130,85,95,90, , , , , , , , #
         //IW:标识符
@@ -2053,9 +2097,7 @@ public class protocol_beehome {
     }
 
     public void handleBPHP() {
-
         ICLogger.i("服务器收到APHP 心率血压血氧 !");
-
     }
 
     public boolean handleCmd(CMD_TYPE type, String cmd) {
@@ -2093,7 +2135,6 @@ public class protocol_beehome {
                 //报警包
                 mConnection.DeliverCMDMessageToSystem("AP10", cmd);//通知下面线程状态变化
                 break;
-
             case BPTM:
                 //校时命令
                 handleBPTM(cmd);
@@ -2246,6 +2287,11 @@ public class protocol_beehome {
                 ICLogger.d("收到服务器下发的修改skipmovecheck");
                 handleBPMC(cmd);
                 break;
+            case BPPH:
+                //收到服务器拨号功能开关
+                ICLogger.d("收到服务器拨号功能开关.");
+                handleBPPH(cmd);
+                break;
         }
 
         return ret;
index 4843355..4bdedac 100644 (file)
@@ -1,2 +1,2 @@
-#Sat Sep 25 23:33:45 CST 2021\r
-VERSION_CODE=903\r
+#Thu Oct 14 21:33:40 CST 2021\r
+VERSION_CODE=904\r