Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessibility: TYPE_NOTIFICATION_STATE_CHANGED state

Tags:

android

I've written an app using an accessibilityService.

I've found that I can detect when notifications appear in the notification bar, but cannot work out how to trigger when they get cleared.

According to the android api docs:

TYPE_NOTIFICATION_STATE_CHANGED "Represents the event showing/hiding a Notification. "

..so I'm confused to why the onAccessibilityEvent only ever seems to get fired when showing an event, but not hiding one.

I'm registering the service with the following:

    AccessibilityServiceInfo localAccessibilityServiceInfo = new AccessibilityServiceInfo();
    localAccessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;   //monitor all, then we can           
    localAccessibilityServiceInfo.notificationTimeout = 80L;
    localAccessibilityServiceInfo.feedbackType = AccessibilityServiceInfo.DEFAULT;
    setServiceInfo(localAccessibilityServiceInfo);

Does anyone know why this would not pick up on the hiding of a notification?

like image 661
Andrew Avatar asked Apr 27 '26 15:04

Andrew


1 Answers

Running into the same problem over here.

I assume you're the same Andrew that filed the bug report here: http://code.google.com/p/android/issues/detail?id=18763 - I'm eager to know if anyone has discovered any workarounds.

like image 187
David Titarenco Avatar answered Apr 30 '26 05:04

David Titarenco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!