“Keep Wi-Fi on during sleep” setting is gone in LineageOS 15.1

The “Keep Wi-Fi on during sleep” setting is gone (meaning you can’t turn it off anymore, it’s always on in Oreo).

The ADB workaround linked to in the article doesn’t work for me.
Other options?

I wanted to try this because Wi-Fi seems to be the main battery eater when my phone is idling around at home.

1 Like

Oh, WTF, Gobble… really? They just want their f***ing Gobble services to be active anytime… what a disrespectful regression.

They seem to have moved the settings command to a subcommand of cmd and I can no longer make it work. No help command or anything, irritating. I’ll try to find the options in the Android source code tomorrow if I find the time.

6 Likes

Yeah, not sure how feasible this Android thingy is on the long term with changes like these…

Well, I needed to use a computer. No longer works from the privileged Terminal app, not even with su, :man_shrugging:

$ adb shell settings list global lists wifi_sleep_policy=2 on my FP2’s LOS for microG 15.1 installation (upgraded from 14.1) and my Nexus 4’s official Lineage OS 15.1 (installed from scratch, so I’m sure it’s not a residual config).

I successfully changed it to 0 with $ adb shell settings put global wifi_sleep_policy 0 on my Nexus 4. I don’t know yet if that effectively changes the wifi behavior, though. It seems to be completely deprecated in Android 9, so I won’t bet a cent for it in Android 8…

(BTW, the command line code is here)

1 Like

… I could set the setting via ADB, but it doesn’t result in anything, WiFi stays on as far as I can see.
And it’s a bit funny you can enter any fantasy phrase as a setting that way :slight_smile: .

I thought you had some issue changing the setting. Ambiguity, :man_shrugging:.

As far as I can understand, it’s just a settings store. As long as nothing reads it, it doesn’t matter whenever there are exotic name-value pairs, I guess.

Sorry.

But … I got encouraging results with Easer (since the highly praised Tasker is a paid App in the Play Store) …

  • (Gave Easer every possible permission by starting the App several times until it didn’t complain anymore)
  • Outline - three-dot-menu - Stop
    (I don’t know whether it was in the “Running” state per default or whether I tapped on something by accident at first, but I didn’t want it running while fiddling around)
  • added a “Condition” - Screen Status - On
  • added a “Condition” - Screen Status - Off
  • added a “Profile” - WiFi - (setting enabled) - toggled On
  • added a “Profile” - WiFi - (setting enabled) - toggled Off
  • added a “Script” - Profile - (profile with WiFi on) - Use Condition - (condition with screen on)
  • added a “Script” - Profile - (profile with WiFi off) - Use Condition - (condition with screen off)
  • Outline - three-dot-menu - Start

Well, while to me Easer seems not very intuitive, this seems to do the job for me for now … I can see WiFi is off at the moment when I turn on the screen, and then WiFi is reconnecting immediately :tada:.

I’m open for more efficient Easer proceedings for this.
And I hope running Easer and using the mobile network for the background tasks I still want to run don’t eat more battery than WiFi :slight_smile: .

Edit: I tried to replace the Conditions with Inline Events in the respective Profiles (which would have rendered the steps to add Conditions unnecessary), but with no success … so this FAQ seems somewhat credible when it says you should use Conditions instead of Events.

2 Likes

Oh, forget that, don’t worry, :slight_smile:

Clever. I’ll try that too, thank you for the detailed config!

It’s not only you, I can relate.

I had it running now for a couple of hours … and for me it doesn’t make a difference for the battery.
WiFi is seamlessly replaced by mobile network in terms of battery usage … I have bad mobile network reception at home, so outcomes may differ for others.

Woah, I configured Easer with your setup. The only thing Easer has changed since I first tried it is the icon… what a clumsy user experience :see_no_evil:.

My usecase is using my Nexus 4 as a tablet in my home. I don’t use mobile data in it. So I expect some battery saving, at least.

Edit: it doesn’t seems to work at all in Airplane Mode. “Profile failed to load in full”. It works with a SIM inserted and active, so probably Android forbids changing radio states in Airplane Mode, :confused:

@AnotherElk I’ve catched this new app at F-Droid: SleepyWifi (Disables the Wi-Fi when the phone is in sleep mode) - https://f-droid.org/app/nl.devluuk.sleepywifi

2 Likes

Thanks, I might give it a try.

Although I think Android did some optimizing in the meantime for me. Battery usage went down from 2%/hour to 1%/hour when I’m not using the phone (apart from some automatic background stuff).
Not bad without me doing anything to achieve that.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.