Reputation: 22173
I'm wondering if it's possible to automate some actions via accessibility action. According to the Android documentation the app can call performAction
using an AccessibilityNodeInfo
but there is a note: An action can be performed only if the request is made from an AccessibilityService. Does it mean that this action can be done in the context of the call onAccessibilityEvent()
only? If I bind from activity to the service to execute an action, does it work? If not, the only solution I see is to push commands toward the service and execute it at first call of onAccessibilityEvent()
, am I missing anything?
Upvotes: 1
Views: 1325
Reputation: 15836
Lets clear some points :
An accessibility service can be configured to receive specific types of accessibility events, listen only to specific packages, get events from each type only once in a given time frame, retrieve window content, specify a settings activity, etc.
and basically onAccessibilityEvent()
is the Callback for AccessibilityEvents.
So Lets say this service is just listener with specific permissions to do specific action like for example AccessibilityEvent.getSource()
which will return AccessibilityNodeInfo
.
Can I excute actions (invoke) based on this listener ?
Answer : yes , ofcourse you can.
Upvotes: 1