1

I have an AOSP 5.1 - build on my Allwinner A33 device.

When long-pressing the "Power-Button" the device starts the "shutdown"-procedure. It shows a dialog "Power off" along with a spinner (see screenshot). This is visible for ~ 3.5s - 4.5s, then the device is off.

However when I connect to adb and enter adb shell reboot -p the device goes off immediately (-p stands for "poweroff")

So what is the difference between those two possibilities to shutdown an android device?

  • Is the adb-command somehow "dangerous" because it works much faster?
  • Can I tweak the "normal"-shutdown to be faster?
  • If so, which files in the AOSP do I need to modify?

enter image description here

Community
  • 1
  • 1
Michael B
  • 1,660
  • 3
  • 28
  • 59

2 Answers2

2

Android should not have a problem with an immediate shutdown request.

The device should not do this when the KeyEvent KEYCODE_POWER occurs. According to the Android docs, this should broadcast the Intent with ACTION_SHUTDOWN to inform apps, etc. that the device is powering off. https://developer.android.com/reference/android/content/Intent.html#ACTION_SHUTDOWN

So you could tweak the AOSP but then it wouldn't conform to the docs.

For a more in-depth look, this blog post mentions the dialog confirmation process, ringer silencing, etc. that most users also expect to have happen when the power button is long-pressed:

http://kpbird.blogspot.com/2013/08/in-depth-android-shutdown-sequence.html

Jim
  • 10,172
  • 1
  • 27
  • 36
-2

Not all phones have the shutdown sound. The Power Off Shutting Down (POSD) of Death causes when the battery runs out.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 17 '22 at 08:50