I am trying to enable Accessibility setting for my application as soon as the application is launched. But I am not able to do it currently. I have used the following code:
Settings.Secure.putString(getContentResolver(),
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
"package_name");
Settings.Secure.putString(getContentResolver(),
Settings.Secure.ACCESSIBILITY_ENABLED,
"1");
To use this code snippet we have to declare the following permission:
WRITE_SECURE_SETTINGS, but this permission is applicable only for system applications. How can I achieve the same functionality for my application. All suggestions are welcome.