I was able to reinstall the service when it was turned on (and continue to receive events after that), after configuring the service settings.
I changed android: packageNames = "com.example.android.apis" (got this from tutorials) in android: packageNames = "@null"
Today, I have part of the xml configuration (for JB):
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android" android:description="@string/accessibility_description" android:packageNames="@null" android:accessibilityEventTypes="typeNotificationStateChanged" android:accessibilityFlags="flagDefault" android:accessibilityFeedbackType="feedbackGeneric" android:notificationTimeout="100" android:canRetrieveWindowContent="false" />
and in the Java part (for pre-JB, in the onServiceConnected () service):
AccessibilityServiceInfo info = new AccessibilityServiceInfo(); info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC; info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED; info.notificationTimeout = 100; info.packageNames = null; info.feedbackType = AccessibilityServiceInfo.DEFAULT; this.setServiceInfo(info);
I would like this to help in your own case ...
source share