3

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.

1 Answer 1

7

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

4
  • 1
    Is this setting permanent or will get reset when I reboot the device.
    – krishna
    Commented Feb 15, 2017 at 5:14
  • 1
    @darth_coder I haven't tested the reboot, but I believe it persists. Let me know if it's otherwise...
    – Andrew T.
    Commented Feb 15, 2017 at 8:48
  • 1
    also will this disable screen lock until the device is flashed.
    – krishna
    Commented Mar 13, 2018 at 7:38
  • Does this persist after reboot?
    – W.M.
    Commented May 20, 2020 at 7:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .