Prechádzať zdrojové kódy

<过滤重复呼叫>

weizhengliang 4 rokov pred
rodič
commit
d97bb74bf0

+ 7 - 1
app/src/main/java/com/wdkl/callingmainnurse/util/SpeechUtil.java

@@ -63,7 +63,13 @@ public class SpeechUtil {
     public void newSpeech(String text, boolean emergency) {
         synchronized (lockObject) {
             if (Constants.DEBUG) {
-                LogUtil.d(TAG, "add text speech: " + text);
+                LogUtil.d(TAG, "start add text speech: " + text);
+            }
+            if (speechTextList.contains(text)) {
+                return;
+            }
+            if (Constants.DEBUG) {
+                LogUtil.d(TAG, "truely add text speech: " + text);
             }
             if (emergency) {
                 speechTextList.add(0, text);