How to change Android Notification using Accessibility API -
i able intercept notifications using accessablity service. block events seen :
@override public void onaccessibilityevent(accessibilityevent event) { log.d(tag, "inside onaccessibilityevent"); if (event.geteventtype() == accessibilityevent.type_notification_state_changed){ sqldb db = new sqldb(this); notificationobject no = new notificationobject(); no.setnoficationpackage(string.valueof(event.getpackagename())); no.setnotificationtext(string.valueof(event.gettext().tostring())); no.setnotificationdtm(new date()); db.addnotification(no); log.d(tag, "saved event"); } }
what want change notification not considered missed call event. possible on os 4.0+?
thanks.
another application's notification read-only. so, code "notification.a = b; "cause permission problem.
public void onaccessibilityevent(accessibilityevent event) { // todo auto-generated method stub if (event.geteventtype() == accessibilityevent.type_notification_state_changed) { //do something, eg getting packagename final string packagename = string.valueof(event.getpackagename()); final string text = string.valueof(event.gettext()); if(target_package.equals(packagename)){ notification n = (notification) event.getparcelabledata(); } }
Comments
Post a Comment