From 6c0303623d17f4fc9d02abe940a93dfe78b277b6 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Fri, 9 Jul 2021 18:36:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E8=88=AC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ohos/speechutilsdemo/ExampleOhosTest.java | 5 +++++ .../com/huawei/hm_speechutilsdemo/ExampleTest.java | 5 ++++- .../abilityslice/TtsBaseAbilitySlice.java | 14 ++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/entry/src/ohosTest/java/com/ohos/speechutilsdemo/ExampleOhosTest.java b/entry/src/ohosTest/java/com/ohos/speechutilsdemo/ExampleOhosTest.java index b32a17f..9d5bb98 100644 --- a/entry/src/ohosTest/java/com/ohos/speechutilsdemo/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/com/ohos/speechutilsdemo/ExampleOhosTest.java @@ -1,6 +1,7 @@ package com.ohos.speechutilsdemo; import ee.ioc.phon.ohos.speechutils.utils.Define; + import ohos.aafwk.ability.Ability; import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; import ohos.ai.tts.TtsClient; @@ -8,6 +9,7 @@ import ohos.ai.tts.TtsListener; import ohos.ai.tts.TtsParams; import ohos.ai.tts.constants.TtsEvent; import ohos.utils.PacMap; + import org.junit.Test; import java.util.UUID; @@ -20,6 +22,9 @@ import static org.junit.Assert.assertEquals; * @since 2021-05-10 */ public class ExampleOhosTest { + /** + * testBundleName方法体 + */ @Test public void testBundleName() { final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); diff --git a/entry/src/test/java/com/huawei/hm_speechutilsdemo/ExampleTest.java b/entry/src/test/java/com/huawei/hm_speechutilsdemo/ExampleTest.java index 2db1eaa..ffc09b7 100644 --- a/entry/src/test/java/com/huawei/hm_speechutilsdemo/ExampleTest.java +++ b/entry/src/test/java/com/huawei/hm_speechutilsdemo/ExampleTest.java @@ -3,11 +3,14 @@ package com.huawei.hm_speechutilsdemo; import org.junit.Test; /** - * Test + * TestJava测试 * * @since 2021-05-10 */ public class ExampleTest { + /** + * onStart + */ @Test public void onStart() { } diff --git a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/abilityslice/TtsBaseAbilitySlice.java b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/abilityslice/TtsBaseAbilitySlice.java index d63a7c6..e04687d 100644 --- a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/abilityslice/TtsBaseAbilitySlice.java +++ b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/abilityslice/TtsBaseAbilitySlice.java @@ -60,15 +60,10 @@ public abstract class TtsBaseAbilitySlice extends AbilitySlice implements TtsSho protected void processEvent(InnerEvent event) { super.processEvent(event); if (event.eventId == EVENT_MSG_TIME_COUNT) { - getUITaskDispatcher().delayDispatch(new Runnable() { - @Override - public void run() { - time = time + 1; - HiLog.info(LABEL_LOG, "playTime:" + Integer.toString(time) + " s"); - info = "playTime:" + Integer.toString(time) + " s"; - showInfo(info); - } - }, 0); + time = time + 1; + HiLog.info(LABEL_LOG, "playTime:" + Integer.toString(time) + " s"); + info = "playTime:" + Integer.toString(time) + " s"; + showInfo(info); } } }; @@ -108,7 +103,6 @@ public abstract class TtsBaseAbilitySlice extends AbilitySlice implements TtsSho @Override public void onSpeechStart(String utteranceId) { - // 开始计时 HiLog.info(LABEL_LOG, "onSpeechStart..."); if (timer == null && timerTask == null) { timer = new Timer(); -- Gitee