2

Looking at the reference to svc on my phone there are options for svc power stayon [true|false|usb|ac|wireless]. I'm curious what usb, ac, and wireless do when you use them?

I tried svc power stayon wireless and it seemed the command succeeded, but I don't know what it did, or how to revert it.

I'm on an LG Tribute if that helps.

5

Executing svc power on the shell will bring the usage:

usage: svc power stayon [true|false|usb|ac|wireless]
         Set the 'keep awake while plugged in' setting.

The command will set whether to keep your device awake (prevent sleeping) or not while it's being charged on specific platform: USB charging, AC power, wireless charging, or all of them:

  • true will set all flags (usb, ac, wireless)
  • false will clear all flags
  • usb/ac/wireless will set that specific flag while clear the other

The same setting usually can be accessed on "Developer options" named "Stay awake", though it's simpler with only toggle to turn on/off.

Reference: source code of com.android.commands.svc.PowerCommand

  • Is this setting permanent or will get reset when I reboot the device. – krishna_oza Feb 15 '17 at 5:14
  • @darth_coder I haven't tested the reboot, but I believe it persists. Let me know if it's otherwise... – Andrew T. Feb 15 '17 at 8:48
  • also will this disable screen lock until the device is flashed. – krishna_oza Mar 13 '18 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.