trusktr
trusktr

Reputation: 45504

What are the least invasive permissions required to toggle Airplane Mode?

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

Answers (1)

Theus
Theus

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

Related Questions