Reputation: 45504
In Android, what are the permissions for toggling Airplane Mode? Can I do it without the "Modify global system settings" (WRITE_SETTINGS) permission?
As a developer, I want to make my app use the least invasive permissions so that permission-aware security-conscious people can be satisfied with my app and know I'm not doing something fishy with their data behind the scenes or messing their phone settings up.
Upvotes: 0
Views: 335
Reputation: 954
The only way around the WRITE_SETTINGS permission is to ask the user to change the setting manually by launching the settings activity:
startActivityForResult(
new Intent(android.provider.Settings.ACTION_AIRPLANE_MODE_SETTINGS), 0);
Upvotes: 2