Since the airplane mode setting api lvl 17 has been moved from Settings.System to Settings.Global
The problem is that now I can no longer switch settings. The description of the API is that these settings are read-only. Has anyone managed to find a way to change it?
Pre API lvl 17 that worked:
Settings.System.putInt(context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 1);
The lvl 17 API, which I tried and does not work:
Settings.Global.putInt(context.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, setMode);
It throws an exception (the documentation says that it should cause a quiet log error):
11-14 13:39:51.649: E/AndroidRuntime(3509): java.lang.SecurityException: Permission denial: writing to secure settings requires android.permission.WRITE_SECURE_SETTINGS
but I have this permission in the manifest:
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
If someone knows a way to solve this problem, it will be awesome!
Bojan source share