Hi all I am just curious to find out some code that can pro-grammatically REBOOT , SHUTDOWN and enter in to DOWNL
If your app is signed with the system key, you can use reboot().
On the other hand, if you have root you can still do it (this doesn't work on a few ROMs, mainly a few stock HTC ones.
Shutdown:
try {
Process proc = Runtime.getRuntime()
.exec(new String[]{ "su", "-c", "reboot -p" });
proc.waitFor();
} catch (Exception ex) {
ex.printStackTrace();
}
Restart:
Same code, just use reboot
instead of reboot -p
.
AFAIK, it is not possible to boot into "Download Mode" using any API, but on a rooted device you may be able to do it using the adb
binary