From: TrillGates Date: Tue, 14 Dec 2021 12:44:51 +0000 (+0800) Subject: a9加了处理多次下发聆听的指令,但是好像不在这个分支上。得改到另外一个分支上 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=929961cc8815934bc9a96d92e057690a885576b8;p=icsupport.git a9加了处理多次下发聆听的指令,但是好像不在这个分支上。得改到另外一个分支上 --- diff --git a/app/release/ICSer_V1017_2112071047_release.apk b/app/release/ICSer_V1018_2112142040_release.apk similarity index 77% rename from app/release/ICSer_V1017_2112071047_release.apk rename to app/release/ICSer_V1018_2112142040_release.apk index b1373d31..b4ad5657 100644 Binary files a/app/release/ICSer_V1017_2112071047_release.apk and b/app/release/ICSer_V1018_2112142040_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index a14d97d2..49ba423c 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index 44d2bcc7..31464c94 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -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; diff --git a/app/src/main/java/com/enqualcomm/support/ICApplication.java b/app/src/main/java/com/enqualcomm/support/ICApplication.java index 2963fe5e..befac7e4 100644 --- a/app/src/main/java/com/enqualcomm/support/ICApplication.java +++ b/app/src/main/java/com/enqualcomm/support/ICApplication.java @@ -85,4 +85,5 @@ public class ICApplication extends Application { mConfigurationChangedHandlerHashMap.put(key, sparseArray); ICLogger.i("setConfigurationChangedHandler: " + key); } + } diff --git a/app/src/main/java/com/enqualcomm/support/service/Deliver.java b/app/src/main/java/com/enqualcomm/support/service/Deliver.java index 53691521..94ec15f0 100644 --- a/app/src/main/java/com/enqualcomm/support/service/Deliver.java +++ b/app/src/main/java/com/enqualcomm/support/service/Deliver.java @@ -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); diff --git a/app/src/main/java/com/ic/protocols/protocol_ic.java b/app/src/main/java/com/ic/protocols/protocol_ic.java index c3bd6cdf..f769e67d 100644 --- a/app/src/main/java/com/ic/protocols/protocol_ic.java +++ b/app/src/main/java/com/ic/protocols/protocol_ic.java @@ -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()); } /** diff --git a/app/version_code.properties b/app/version_code.properties index 65be329b..9e98190a 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Tue Dec 07 10:47:17 CST 2021 -VERSION_CODE=1017 +#Tue Dec 14 20:40:52 CST 2021 +VERSION_CODE=1018