Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android root poweroff

On my android app for root user, I perform a shutdown with

su reboot -p

It works ok, but I noticed that the phone is shutdown almost instantly (as opposed from showing the shutdown animation, and probably doing other stuff).

Is this the correct way to shutdown an android phone programmatically? Are there some critical code that requires to be executed before shutdown?

like image 293
michelemarcon Avatar asked Mar 07 '12 09:03

michelemarcon


1 Answers

If your app is rooted, then run the following as root:

am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN

like image 140
tristan2468 Avatar answered Oct 20 '22 19:10

tristan2468