a9加了处理多次下发聆听的指令,但是好像不在这个分支上。得改到另外一个分支上
authorTrillGates <williamtrillgates@gmail.com>
Tue, 14 Dec 2021 12:44:51 +0000 (20:44 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 14 Dec 2021 12:44:51 +0000 (20:44 +0800)
app/release/ICSer_V1018_2112142040_release.apk [moved from app/release/ICSer_V1017_2112071047_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/ICApplication.java
app/src/main/java/com/enqualcomm/support/service/Deliver.java
app/src/main/java/com/ic/protocols/protocol_ic.java
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V1017_2112071047_release.apk
rename to app/release/ICSer_V1018_2112142040_release.apk
index b1373d3..b4ad565 100644 (file)
Binary files a/app/release/ICSer_V1017_2112071047_release.apk and b/app/release/ICSer_V1018_2112142040_release.apk differ
index a14d97d..49ba423 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1017,"versionName":"2112071047","enabled":true,"outputFile":"ICSer_V1017_2112071047_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1017_2112071047_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1018,"versionName":"2112142040","enabled":true,"outputFile":"ICSer_V1018_2112142040_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1018_2112142040_release.apk","properties":{}}]
\ No newline at end of file
index 44d2bcc..31464c9 100644 (file)
@@ -122,6 +122,11 @@ public class Config {
     //add by TrillGates=================end
 
 
+    //add by TrillGates===========
+    public static boolean sIsRecording = false;
+    //防止重复录音指令
+    //add by TrillGates end===============
+
     //定位是否使用wifi的配置。
     public static boolean disableWiFiScan = false;
 
index 2963fe5..befac7e 100644 (file)
@@ -85,4 +85,5 @@ public class ICApplication extends Application {
         mConfigurationChangedHandlerHashMap.put(key, sparseArray);\r
         ICLogger.i("setConfigurationChangedHandler: " + key);\r
     }\r
+\r
 }\r
index 5369152..94ec15f 100644 (file)
@@ -626,7 +626,6 @@ public class Deliver extends AbstractConnectionService {
             return true;
 
         } else if ("StartMonitor".equals(paramStringMessage.cmd())) {
-
             String recordfilepath = Util.getRecordfilePath(mRuntime, TimeUtil.getSystemTime3());
             int recordtime = Integer.parseInt(paramStringMessage.isFromCache().trim());
             try { //尝试拦截录音错误,不让程序挂掉
@@ -643,8 +642,10 @@ public class Deliver extends AbstractConnectionService {
                     // 把voiceContent拆解成1024的分包
                     Util.parseToVoicePacketSent(voiceContent, 1024);
                     //trigger 分包发送
-                    if (CoreService.getInstance().getConnection() != null)
+                    if (CoreService.getInstance().getConnection() != null) {
                         CoreService.getInstance().getConnection().DeliverCMDMessageToSystem("SentVoicePacket", "");
+                    }
+                    Config.sIsRecording = false;
                 }, recordtime * 1000);
             } catch (Exception e) {
                 ICLogger.e(e.getMessage(), e);
index c3bd6cd..f769e67 100644 (file)
@@ -2463,9 +2463,17 @@ public class protocol_ic {
             tmp = tmp.replace(CMDEND, "").trim();
 
             if (tmp.isEmpty()) tmp = "15";
-            connection.send(APDH(id, cdd));
+            if (Config.sIsRecording) {
+                ICLogger.d("正在录音中,请不要重复发指令.");
+                connection.send(APDH(id, "0"));
+                return;
+            } else {
+                connection.send(APDH(id, "1"));
+                ICLogger.d("指令下发成功,准备去录音");
+            }
 
             if (cdd.equals("1")) {
+                Config.sIsRecording = true;
                 //delay 启动
 //                Context context = mRuntime.getContextProxy().context.getApplicationContext();
                 CoreService.getInstance().DevliverStringMessage("StartMonitor", tmp);
@@ -3302,9 +3310,9 @@ public class protocol_ic {
     private StringMessage APMC(String index, boolean responseValue) {
         return genStringMessage(cmdMap.get(CMD_TYPE.APMC),
                 new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APMC))
-                .append(CMDSPLIT).append(index)
-                .append(CMDSPLIT).append(responseValue)
-                .append(CMDEND).toString());
+                        .append(CMDSPLIT).append(index)
+                        .append(CMDSPLIT).append(responseValue)
+                        .append(CMDEND).toString());
     }
 
     /**
index 65be329..9e98190 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Dec 07 10:47:17 CST 2021\r
-VERSION_CODE=1017\r
+#Tue Dec 14 20:40:52 CST 2021\r
+VERSION_CODE=1018\r