0

I'm on a UleFone Armor X7 (cheap waterproof/rugged thing) running Android 10. I'm trying to use Tasker to conserve power for multi-day bike rides with no charging*, and one thing I'd like to do is turn off as much communication as possible for several minutes, then on briefly to pick up messages, then off again in a loop.

I know aeroplane mode requires root (edit: or ADB Wifi), and I don't want to lose Google Pay, but I should be able to toggle mobile data without it according to the following screenshot:

enter image description here

This says either root, or ADB WiFi, or Write Secure Settings should be enough. ADB WiFi isn't an option, because it needs a PC at every boot, which is incompatible with turning the phone off overnight - to save power. So I've installed ADB, granted the permission, and it still doesn't work. I can test that the permission is set: adb shell dumpsys package net.dinglisch.android.taskerm |grep SECURE_SETTINGS returns android.permission.WRITE_SECURE_SETTINGS: granted=true but when I try to test the task I get

Error: 1
Couldn't toggle mobile data on this device

I suspect a semantic error, meaning that ((ADB Wifi or root) and (Write secure settings)) is needed. Enabling ADB Wifi does indeed allow Tasker to toggle aeroplane mode - but while Tasker can keep ADB Wifi alive (even apparently with Wifi itself off), this doesn't persist over a reboot, such as shutting down overnight to save battery, and a PC is needed again on restart. Enabling battery save mode overnight may be an option.

I'm thinking of trying something with AutoInput, but I'm not keen, as it (i) requires the screen to be unlocked, and (ii) can on toggle, not set a state. I also don't want to pay even a little (on principle) to test something with these issues.

I've seen a few similar questions for very old Android versions, but nothing recent.


* I will have an external battery, and a dynamo, but just assume they're not enough to keep everything charged, especially as I navigate on my phone.

Chris H
  • 131
  • 8
  • 1
    Yes, thanks @beeshyams. I'm editing the Q now so we'll be able to tidy these comments soon – Chris H Jul 07 '20 at 13:45
  • I don't use Tasker, so can't be very specific. But on Android 10 svc data enable|disable doesn't work even with root (neither with UID 2000 alone). It works only on adb shell. So there have some changes occured at API level (it's not even SELinux, I checked). But I haven't looked into it deeply yet. – Irfan Latif Jul 07 '20 at 15:09
  • @IrfanLatif via ADB Wifi aeroplane mode is working rather nicely. I took it on a test ride earlier today. So it looks like the solution might be to avoid rebooting on the road (though I may have a backup phone and there may be ways to run ADB shell on that over OTG - I'm still reading) – Chris H Jul 07 '20 at 20:27

0 Answers0