Notes:
The answer is tested on a rooted Android 4.2.1 running Tasker v4.6u3m and Secure Settings v1.3.6.
Secure Settings may needs to be installed as a System app (it has the provision under SYSTEM+
in its GUI).
Since you're already aware of making profiles, tasks, and actions, I would come to point:
- Make a profile having time as the context, and create a new task in it.
- Under that Task, the action would be Plugin → Secure Settings → Configuration (pencil icon) → System+ Actions → Airplane Mode → On → Save (floppy icon), and save your action under the task.
Now whenever the time would come Tasker would execute Airplane mode, and everyone would be happy!
You can automatically disable the Airplane Mode as well, by choosing Off
or Toggle
over On
in the aforesaid step.
For Readers: If you don't happen to have Secure Settings or it's not working somehow, then you can use the following action as an alternative. (Credits to Andrew T. and DavisNT for their answer)
Action: Code → Run Shell, and enter these details:
- Command:
settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
- Check Use Root
That would execute the Airplane mode based on your profile.
To automatically disable the said mode, create an another action in a different profile and copy the aforesaid action with exception of 0
over 1
and false
over true
.
You're good to go now!