Search code examples
androidaccessibilityservice

TYPE_NOTIFICATION_STATE_CHANGED event is not getting received by accessibility service if specific packages are added in its configuration xml


I am having issue receiving notification change event using accessibility service in specifically Android 9 devices. It is properly working in below Android 9 devices.


Solution

  • I have met the same question, and I solved it by delete the android:packageNames="your packageName" in accessibility service config xml. There are some changes in the Android 9.0 that cause the notification event can't be received by onAccessibilityEvent directly. The other way to solve it by using NotificationListenerService instead of AccessibilityService in Android 9.0.