The accessibility service is a global-level service; even if your app can change settings on the service itself, you should avoid doing so because you'll need to reverse those changes when your app is no longer active (and that gets you into some nasty corner cases... What if your app crashes and leaves the user's accessibility service in a bad state?).
Alternatively, you can use the Accessibility Manager to check the status of accessibility on the system (via addAccessibilityStateChangeListener
and isEnabled
) and when you detect accessibility is enabled, change your app's UI to be more accomodating to the accessibility system (for example, by significantly lightening the app's gradient background so the green highlight box becomes visible). Your users who don't need accessibility get the app's interface as you've intended it, and your users who need assistance with vision can still use accessibility.