diff --git a/TestHmiWarning.sh b/TestHmiWarning.sh new file mode 100755 index 0000000000..1ab54760cc --- /dev/null +++ b/TestHmiWarning.sh @@ -0,0 +1,16 @@ +#!/bin/bash +for index in `seq 300`; +do + b=$(( $index % 2 )) + if [ $b = 0 ] + then + echo "200011" + adb shell am broadcast -a com.hmi.v2x.notification --ez v2xIsShow true --es tag "200011" --ei v2xType 20011 --es alertContent "测试外部传入数据1" --es ttsContent "测试TTS1" + else + echo "200012" + adb shell am broadcast -a com.hmi.v2x.notification --ez v2xIsShow true --es tag "200012" --ei v2xType 20012 --es alertContent "测试外部传入数据2" --es ttsContent "测试TTS2" + fi + sleep 0.5 +done + +echo -e "\033[32m 恭喜你完成了所有 测试脚本 \033[0m" \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt index 564e7b4aac..8df1a947ee 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/notification/WarningFloatWindowHelper.kt @@ -90,7 +90,7 @@ internal class WarningFloatWindowHelper( val floatingView = config.layoutView?.also { try { val parent = (it.parent as ViewGroup) - parent.removeView(it) + parent.removeAllViews() } catch (e: Exception) { e.printStackTrace() } @@ -220,12 +220,12 @@ internal class WarningFloatWindowHelper( * 退出动画执行结束/没有退出动画,进行回调、移除等操作 */ fun remove(force: Boolean = false) = try { + frameLayout?.removeAllViews() frameLayout?.removeCallbacks(closeWarningTask) config.isAnim = false WarningFloatWindowManager.remove(config.floatTag) // removeView是异步删除,在Activity销毁的时候会导致窗口泄漏,所以使用removeViewImmediate直接删除view windowManager.run { - frameLayout?.removeAllViews() if (force) { removeViewImmediate(frameLayout) } else {