简体   繁体   English

单击通知时会触发什么可访问性事件?

[英]What accessibility event is triggered when a notification is clicked?

So I have created a chat locking application for Whatsapp such that when user clicks on the locked contact, he/she cannot access the chat without the password or fingerprint. 因此,我为Whatsapp创建了一个聊天锁定应用程序,这样,当用户单击锁定的联系人时,如果没有密码或指纹,他/她将无法访问聊天。 But on clicking the notification of that particular contact's chat, they can access the chat. 但是,只要单击该特定联系人的聊天通知,他们就可以访问该聊天。 So to block it, I need to know the accessibility events that get triggered on clicking the notification. 因此,要阻止它,我需要知道单击通知时触发的可访问性事件。 I tried getting the events using AccessibilityEvent.TYPES_ALL_MASK , but none of those events have a source and and I cannot get the nodes. 我尝试使用AccessibilityEvent.TYPES_ALL_MASK获取事件,但是这些事件都没有源,并且我无法获取节点。 Do anyone know any approach to solve this problem? 有谁知道解决这个问题的方法吗?

Thank you. 谢谢。

The behavior may differ on different Android versions. 在不同的Android版本上,行为可能会有所不同。

But when I tried clicking on a notification in the notification tray on a Galaxy S7 running Android 7.0 I got either AccessibilityEvent.TYPE_VIEW_CLICKED or AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED , with package name "com.android.systemui" . 但是,当我尝试单击运行Android 7.0的Galaxy S7的通知托盘中的通知时,得到了AccessibilityEvent.TYPE_VIEW_CLICKEDAccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED ,包名称为"com.android.systemui" And if I dumped the view hierarchy starting at the event source I got a FrameLayout containing 3 TextView s. 而且,如果我从事件源开始转储视图层次结构,则会得到一个包含3个TextViewFrameLayout

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM