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 shutdown() or reboot()");
}
Runnable runnable = new Runnable() {
@Override
public void run() {
synchronized (this) {
if (shutdown) {
(mContext, confirm);
} else {
(mContext, reason, confirm);
}
}
}
};
Message msg = (mHandler, runnable);
(true);
(msg);
if (wait) {
synchronized (runnable) {
while (true) {
try {
();
} catch (InterruptedException e) {
}
}
}
}