I have a AccessibilityService that shall read out any incoming notification. It does work fine with ICS and below, but stopped working with JB.
Below are the Manifest and the code:
<service
android:name=".Services.InstantMessengerJb"
android:enabled="@bool/is_post_jb"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
tools:ignore="ExportedService" >
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/accessibility_service_config" />
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
</service>
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
SettingsClass.logMe(tag, "New event!");
new AccessibilityProcessing(this, event);
}
@Override
protected void onServiceConnected() {
if (isInit) {
return;
}
SettingsClass.logMe(tag, "We are connected!");
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
info.feedbackType = AccessibilityServiceInfo.FEEDBACK_SPOKEN;
setServiceInfo(info);
isInit = true;
}
As said before it does work on all preJB-Devices like a charm, however on JB the service starts (I get the "We are connected"), but not a single event is fired.
Is there anything wrong with the code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…