Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,730,865 Members 44,542 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Scheduled Shutdown

Tip us?
 
Renate NST
Old
#11  
Renate NST's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 779
Posts: 1,945
Join Date: Feb 2012
Location: Boston
Quote:
Originally Posted by cuff21 View Post
My guess is that it does exactly what Renate NST is telling you to do - send a shutdown intent - behind the scenes.
Hmm, I don't know. A regular root and su won't work.
You'd either have to have a system-signed app or hack the permission system.

There is no clear info on the difference between an Android shutdown and a Linux shutdown.
Given the choice, I'd go for the Android shutdown.

 
cuff21
Old
#12  
Junior Member
Thanks Meter 2
Posts: 3
Join Date: May 2014
Quote:
Originally Posted by Renate NST View Post
Hmm, I don't know. A regular root and su won't work.
You'd either have to have a system-signed app or hack the permission system.
Well I had a stack overflow link that shows a way to do it, but I can't post links yet. Either way, apparently there is a way with only root. The code from the link was:
Code:
try {
    Process proc = Runtime.getRuntime()
                    .exec(new String[]{ "su", "-c", "reboot -p" });
    proc.waitFor();
} catch (Exception ex) {
    ex.printStackTrace();
}
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Blast Those Flags with Knock the Flags

Lately, we have seen a rather drastic shift in the world of mobile device gaming. The infamous Angry … more

Hide Numbers on Your SMS and Call Logs with Reflection

How many times have you given your device to someone else in order to show them a … more

Implement Split View in Your LG G2 KitKat Rom with Automated Installer

Some of you may have remembered a story on the Portal a few weeks back … more

Cast Your Device Screen the Way it Was Meant to be with Second Screen

Not too long ago here on the XDA Portal, we covered how Google had made … more