I tried this and I can grab the whatsapp button's call button and click the close button. Below is the simple AccessibilityService I used, and it is no different from the example available on the Android Developers website.
public class MyAccessibilityService extends AccessibilityService { @Override protected void onServiceConnected() { AccessibilityServiceInfo info = new AccessibilityServiceInfo();
}
In the above code, I showed a message with a toast and a trick for drawable, we will provide a contentDescription that can be used by the system in the "Talkback" accessibility mode. Hope this helps !!!
source share