Can’t get WRITE_SETTINGS permission

To use WRITE_SETTINGS, based on the docs:

  1. Have the <uses-permission> element in the manifest as normal.

  2. Call Settings.System.canWrite() to see if you are eligible to write out settings.

  3. If canWrite() returns false, start up the ACTION_MANAGE_WRITE_SETTINGS activity so the user can agree there to allow your app to actually write to settings.

In other words, writing to settings is now a double-opt-in (agree to install, agree separately in Settings to allow), akin to device admin APIs, accessibility services, etc.

Also note that I have not tried using these yet — this is based on research that I did yesterday on Android 6.0 changes.

Leave a Comment