ICS 中可能存在的辅助功能事件传递错误。事件发送两次。在 HoneyComb 或更低版本中一切正常
我对 ICS 中发现的可能的辅助功能问题/错误有疑问。
我在 K-NFB、Kurzweil(全国盲人联合会)工作,我们的电子书阅读器允许通过 Android 的辅助服务进行连续 TTS 阅读。我们需要推出自己的辅助服务,以便能够在 TTS 语音停止说话时收到通知(例如自动翻页等)。
我们的无障碍服务是特定于套餐的,未注册为“默认”无障碍服务。在 Android 3.x 及更低版本上,它工作正常,因为如果特定于包的服务可以处理辅助功能事件,则默认服务将不会接收它。然而,在 ICS 上,我们的服务和默认服务(Talkback)都会收到辅助功能事件。这会导致话语被说两次。一次通过我们的服务,一次通过 Talkback。
Android 的辅助功能团队是否意识到这个问题?
http://code.google.com/p/android/issues/detail ?id=23933
如果这不是一个错误,那么问题可能是什么?
I have a question about a possible Accessibility issue/bug I found in ICS.
I'm working for K-NFB, Kurzweil - National Federation of the Blind our e-book reader allows for continuous TTS reading through Android's accessibility services. We needed to roll our own Accessibility Service to be able to get notified when a TTS utterance stops speaking (e.g. auto-turn pages and such).
Our accessibility service is package specific and is not registered as a 'default' accessibility service. On Android 3.x and lower, it works fine, because if a package specific service can handle an accessibility event, the default service won't receive it. However on ICS, both our service and the default service (Talkback) receives the Accessibility Event. This causes utterance to be spoken twice. Once by our service and once by Talkback.
Is the accessibility team for Android aware of this issue?
http://code.google.com/p/android/issues/detail?id=23933
If this is not an bug, what could be the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题可能是您的辅助功能服务尚未针对您想要处理的 AccessibilityEvent 类型 正确注册。作为实验,将以下属性添加到您的 AccessibiltyServiceInfo XML 配置中:
该属性向框架发出信号,表明您要处理您已注册的特定包的所有 AccessibilityEvent。如果这停止了双重处理,那么你就有了答案。然后,您可以尝试仅请求您感兴趣的 EventType。此处列出了 XML 配置 EventType:
http://developer.android.com/reference/android/R.styleable.html#AccessibilityService_accessibilityEventTypes
您还可以使用动态设置事件类型过滤AccessibilityServiceInfo.eventTypes() 方法:
http://developer.android.com/参考/android/accessibilityservice/AccessibilityServiceInfo.html#eventTypes
The problem may be that your Accessibility Service has not been correctly registered for the AccessibilityEvent types that you want to handle. As an experiment, add the following attribute to your AccessibiltyServiceInfo XML configuration:
This attribute signals the framework that you want to handle all AccessibilityEvents for the specific packages you have registered for. If that stops the double processing then you have your answer. You can then experiment with requesting only the EventTypes that you are interested in. The XML configuration EventTypes are listed here:
http://developer.android.com/reference/android/R.styleable.html#AccessibilityService_accessibilityEventTypes
You can also dynamically set the event type filtering using the AccessibilityServiceInfo.eventTypes() method:
http://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo.html#eventTypes