To use WRITE_SETTINGS
, based on the docs:
-
Have the
<uses-permission>
element in the manifest as normal. -
Call
Settings.System.canWrite()
to see if you are eligible to write out settings. -
If
canWrite()
returnsfalse
, start up theACTION_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.