completed camera enable state cmd parse.
authorTrillGates <williamtrillgates@gmail.com>
Wed, 23 Jun 2021 04:02:38 +0000 (12:02 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Wed, 23 Jun 2021 04:02:38 +0000 (12:02 +0800)
app/release/ICSer_V837_2106222350_release.apk [new file with mode: 0644]
app/release/output.json
app/src/main/java/com/ic/protocols/protocol_ic.java
app/version_code.properties

diff --git a/app/release/ICSer_V837_2106222350_release.apk b/app/release/ICSer_V837_2106222350_release.apk
new file mode 100644 (file)
index 0000000..5dad8ab
Binary files /dev/null and b/app/release/ICSer_V837_2106222350_release.apk differ
index b68b281..f6743eb 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":835,"versionName":"2106222251","enabled":true,"outputFile":"ICSer_V835_2106222251_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V835_2106222251_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":837,"versionName":"2106222350","enabled":true,"outputFile":"ICSer_V837_2106222350_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V837_2106222350_release.apk","properties":{}}]
\ No newline at end of file
index ab45880..a2ba866 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.Context;
 import android.content.Intent;
 import android.net.Uri;
@@ -21,6 +23,8 @@ import com.enqualcomm.support.bean.Runtime;
 import com.enqualcomm.support.bean.StringMessage;
 import com.enqualcomm.support.bean.VoiceContent;
 import com.enqualcomm.support.bean.voicePacket;
+import com.enqualcomm.support.provider.FZDDatabaseHelper;
+import com.enqualcomm.support.provider.FZDSettingsProvider;
 import com.enqualcomm.support.service.HeartRateManager;
 import com.enqualcomm.support.utils.CameraUtil;
 import com.enqualcomm.support.utils.Connection;
@@ -3207,9 +3211,9 @@ public class protocol_ic {
                 mConnection.DeliverCMDMessageToSystem("APSL", cmd);//通知下面线程状态变化
                 break;
             case BPCM:
-                ICLogger.d("收到禁用相机开关");
+                ICLogger.d("收到禁用相机开关BPCM");
                 mConnection.DeliverCMDMessageToSystem("APCM", cmd);//通知下面线程状态变化
-                handleBPCM(mConnection, mRuntime, cmd);
+                handleBPCM(mRuntime, cmd);
                 break;
             case BPDH:
                 ICLogger.i("聆听");
@@ -3221,7 +3225,6 @@ public class protocol_ic {
             case BPAT://剪断开关设定
                 handleBPAT(mConnection, mRuntime, cmd);
                 break;
-
             case BPBT://蓝牙扫描设置
                 handleBPBT(mConnection, mRuntime, cmd);
                 break;
@@ -3246,8 +3249,26 @@ public class protocol_ic {
     /**
      * 处理
      */
-    private void handleBPCM(Connection mConnection, Runtime mRuntime, String cmd) {
-
+    private void handleBPCM(Runtime mRuntime, String cmd) {
+        //修改数据库即可,
+        //1 : 表示设备可以拍照   0:表示设备不可拍照 ,用户想做拍照会有提示禁用。
+        ICLogger.d(cmd + " trigger setting --> " + cmd);
+        try {
+            //IWBPCM,353456789012345,080835,1#
+            String[] split = cmd.split(CMDSPLIT);
+            if (split.length == 4) {
+                ContentResolver resolver = mRuntime.getContextProxy().getResolver();
+                ContentValues values = new ContentValues();
+                values.put(FZDDatabaseHelper.sKey, "is_camera_enable");
+                //把值保存到数据库中,相机会就监听数据库值的变化,做出响应
+                values.put(FZDDatabaseHelper.sValue, split[3].replace(CMDEND, ""));
+                resolver.insert(Uri.parse(FZDSettingsProvider.SETTINGS), values);
+            } else {
+                ICLogger.d("parse cmd error...");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
 
index a8e3db0..710ffd2 100644 (file)
@@ -1,5 +1,5 @@
-#Tue Jun 22 23:46:37 CST 2021
+#Tue Jun 22 23:50:33 CST 2021
 >>>>>>>=b405d1184f3616d4e894d199cee0eb91613a68db
-VERSION_CODE=836
-<<<<<<<=HEAD
+VERSION_CODE=837
 =\=\=\=\=\=\=
+<<<<<<<=HEAD