I hope this isn't as niche as it looks. In Android 6 apparently there's no way to disable mobile data using Tasker alone. So, I'm trying to disable mobile data via Secure Settings, using the "mobile data" setting. It gives out an error when the task runs. I have given both Tasker and Secure Settings pretty much all permissions I could find in settings. Still no go. Ideas?
Unfortunately, Secure Settings doesn't work well on Android Marshmallow due to lack of platform compatible updates. That been said, you can toggle mobile data using command-line approach in Tasker.
Action: Code → Run Shell:
svc data disable
enableto enable mobile data.
- tick Use Root.
Tasker community at Reddit has compiled a useful list of all the Secure Settings actions' command-line alternatives. You can find the list here.
An alternative to command-line based approach is to use an another automation app in parallel or with Tasker, such as MacroDroid and Automate. Both the apps can toggle mobile data, given root access is granted to them.