diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-10-15 16:00:40 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-10-15 16:01:37 -0700 |
commit | ab887a09ad1a0e82d848a91c49449538377f075d (patch) | |
tree | 05509babf03c92df596cfbb99323eb0bbe7775f0 | |
parent | ee4f029ff4905abbdbc1ce47db2cf2c3510949e9 (diff) | |
download | frameworks_base-ab887a09ad1a0e82d848a91c49449538377f075d.zip frameworks_base-ab887a09ad1a0e82d848a91c49449538377f075d.tar.gz frameworks_base-ab887a09ad1a0e82d848a91c49449538377f075d.tar.bz2 |
Cleanup some internal documentation.
Bug: 7312455
Change-Id: Idefd71f2e9d1abe1b2671dac9702edf7f5fbc118
-rw-r--r-- | services/java/com/android/server/power/PowerManagerService.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java index b76ad45..5e3e77d 100644 --- a/services/java/com/android/server/power/PowerManagerService.java +++ b/services/java/com/android/server/power/PowerManagerService.java @@ -1704,8 +1704,11 @@ public final class PowerManagerService extends IPowerManager.Stub } /** - * Reboot the device, passing 'reason' (may be null) - * to the underlying __reboot system call. Should not return. + * Reboots the device. + * + * @param confirm If true, shows a reboot confirmation dialog. + * @param reason The reason for the reboot, or null if none. + * @param wait If true, this call waits for the reboot to complete and does not return. */ @Override // Binder call public void reboot(boolean confirm, String reason, boolean wait) { @@ -1713,15 +1716,17 @@ public final class PowerManagerService extends IPowerManager.Stub final long ident = Binder.clearCallingIdentity(); try { - rebootInternal(false, confirm, reason, wait); + shutdownOrRebootInternal(false, confirm, reason, wait); } finally { Binder.restoreCallingIdentity(ident); } } /** - * Shutdown the devic, passing 'reason' (may be null) - * to the underlying __reboot system call. Should not return. + * Shuts down the device. + * + * @param confirm If true, shows a shutdown confirmation dialog. + * @param wait If true, this call waits for the shutdown to complete and does not return. */ @Override // Binder call public void shutdown(boolean confirm, boolean wait) { @@ -1729,19 +1734,20 @@ public final class PowerManagerService extends IPowerManager.Stub final long ident = Binder.clearCallingIdentity(); try { - rebootInternal(true, confirm, null, wait); + shutdownOrRebootInternal(true, confirm, null, wait); } finally { Binder.restoreCallingIdentity(ident); } } - private void rebootInternal(final boolean shutdown, final boolean confirm, + private void shutdownOrRebootInternal(final boolean shutdown, final boolean confirm, final String reason, boolean wait) { if (mHandler == null || !mSystemReady) { - throw new IllegalStateException("Too early to call reboot()"); + throw new IllegalStateException("Too early to call shutdown() or reboot()"); } Runnable runnable = new Runnable() { + @Override public void run() { synchronized (this) { if (shutdown) { @@ -1789,6 +1795,7 @@ public final class PowerManagerService extends IPowerManager.Stub private void crashInternal(final String message) { Thread t = new Thread("PowerManagerService.crash()") { + @Override public void run() { throw new RuntimeException(message); } |