Merge commit 'a7ad3f6c71ad6701fcaa6ecf75452563addb0dd0' * commit 'a7ad3f6c71ad6701fcaa6ecf75452563addb0dd0': add reboot() method to PowerManager
This commit is contained in:
@@ -32,6 +32,7 @@ interface IPowerManager
|
||||
void preventScreenOn(boolean prevent);
|
||||
void setScreenBrightnessOverride(int brightness);
|
||||
boolean isScreenOn();
|
||||
void reboot(String reason);
|
||||
|
||||
// sets the brightness of the backlights (screen, keyboard, button) 0-255
|
||||
void setBacklightBrightness(int brightness);
|
||||
|
||||
@@ -465,6 +465,22 @@ public class PowerManager
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reboot the device. Will not return if the reboot is
|
||||
* successful. Requires the {@link android.Manifest#REBOOT}
|
||||
* permission.
|
||||
*
|
||||
* @param reason code to pass to the kernel (e.g., "recovery") to
|
||||
* request special boot modes, or null.
|
||||
*/
|
||||
public void reboot(String reason)
|
||||
{
|
||||
try {
|
||||
mService.reboot(reason);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
||||
private PowerManager()
|
||||
{
|
||||
}
|
||||
@@ -488,4 +504,3 @@ public class PowerManager
|
||||
IPowerManager mService;
|
||||
Handler mHandler;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user