I own a Samsung Galaxy S Relay 4G running Android 4.1.2. Also, I have adb installed on a PC.
When I long-press the Power button then tap "Restart", my phone takes about ten seconds to shut down. Then it reboots itself.
When I enter adb reboot instead, the phone shuts down much faster: the shutdown takes only a second or so. Then it reboots.
My questions:
Why is
adb rebootso much faster?Is it simply skipping the mobile network operator's shutdown animation, or is it skipping some more important procedures as well?
Can I use
adb rebootevery single time I want to reboot the phone, or is there some disadvantage to doing so?(Optional) How do you know?
More information (you can skip this)
I did some research before posting this question. But I am still unenlightened. Let me show you what I did discover.
Tetsuyuki Kobayashi of Kyoto Microcomputer Co. explains in slide 8 of this PDF slideshow that adb consists of three parts: a client, a server, and a daemon. The client and the server run on a PC. The daemon runs on a phone. In slide 11, he explains that all three parts are built from one source directory. (It's this directory.)
I tried searching in that source directory for the word reboot and reading parts of services.cpp, but I still haven't been able to figure out what adb reboot actually does, or what bytes it sends over the wire, or what code the phone runs when it receives those bytes. I also haven't figured out the answer to any of my questions.
Related: "What's the best way to restart Android via command line (remotely)?"
setprop sys.powerctl rebootwould do. An unclean shutdown followed by the instruction to reboot back. – Firelord Mar 08 '16 at 20:25