I have been working on an app which displays all the notifications in the phone's status bar (like a new msg or a missed call). By researching I found out that the only way to do that in android is to create an accessibility service. So I did the same by getting AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED in my accessibility service.
Here is my onServiceConnected() method:
public void onServiceConnected(){
if (isInit) {
return;
}
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
info.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
info.feedbackType = AccessibilityServiceInfo.FEEDBACK_SPOKEN;
setServiceInfo(info);
isInit = true;
}
This is working but not exactly I wish. Its actually showing many notifications which are not there in status bar and are being probably generated by background apps which i don want. Also its not real time. It updates only when I re-open the app and not while the app is open. Furthermore, as soon as I start the service in settings, my phone(galaxy note) starts talking everything. Not sure if it's a bug or some problem in the code.
I can't figure out where exactly the problem is but I think it can be the feedback type. I tried a lot but couldn't find out the meaning of different feedback types for the service anywhere.
FEEDBACK_AUDIBLE
FEEDBACK_HAPTIC
FEEDBACK_AUDIBLE
FEEDBACK_VISUAL
FEEDBACK_GENERIC
Can someone please tell me what does these feedback types imply? And would I get different notifications if I change the feedback type? And if you believe I'm heading in the wrong direction then please guide me to what I can do to solve these problems. Lemme know if I forgot to provide some essential info.
Any kind of help would be really appreciated.