Loading services/core/java/com/android/server/power/ShutdownThread.java +5 −4 Original line number Diff line number Diff line Loading @@ -384,7 +384,7 @@ public final class ShutdownThread extends Thread { } } rebootOrShutdown(mReboot, mRebootReason); rebootOrShutdown(mContext, mReboot, mRebootReason); } private void shutdownRadios(int timeout) { Loading Loading @@ -501,17 +501,18 @@ public final class ShutdownThread extends Thread { * Do not call this directly. Use {@link #reboot(Context, String, boolean)} * or {@link #shutdown(Context, boolean)} instead. * * @param context Context used to vibrate or null without vibration * @param reboot true to reboot or false to shutdown * @param reason reason for reboot */ public static void rebootOrShutdown(boolean reboot, String reason) { public static void rebootOrShutdown(final Context context, boolean reboot, String reason) { if (reboot) { Log.i(TAG, "Rebooting, reason: " + reason); PowerManagerService.lowLevelReboot(reason); Log.e(TAG, "Reboot failed, will attempt shutdown instead"); } else if (SHUTDOWN_VIBRATE_MS > 0) { } else if (SHUTDOWN_VIBRATE_MS > 0 && context != null) { // vibrate before shutting down Vibrator vibrator = new SystemVibrator(); Vibrator vibrator = new SystemVibrator(context); try { vibrator.vibrate(SHUTDOWN_VIBRATE_MS, VIBRATION_ATTRIBUTES); } catch (Exception e) { Loading services/java/com/android/server/SystemServer.java +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ public final class SystemServer { reason = null; } ShutdownThread.rebootOrShutdown(reboot, reason); ShutdownThread.rebootOrShutdown(null, reboot, reason); } } Loading Loading
services/core/java/com/android/server/power/ShutdownThread.java +5 −4 Original line number Diff line number Diff line Loading @@ -384,7 +384,7 @@ public final class ShutdownThread extends Thread { } } rebootOrShutdown(mReboot, mRebootReason); rebootOrShutdown(mContext, mReboot, mRebootReason); } private void shutdownRadios(int timeout) { Loading Loading @@ -501,17 +501,18 @@ public final class ShutdownThread extends Thread { * Do not call this directly. Use {@link #reboot(Context, String, boolean)} * or {@link #shutdown(Context, boolean)} instead. * * @param context Context used to vibrate or null without vibration * @param reboot true to reboot or false to shutdown * @param reason reason for reboot */ public static void rebootOrShutdown(boolean reboot, String reason) { public static void rebootOrShutdown(final Context context, boolean reboot, String reason) { if (reboot) { Log.i(TAG, "Rebooting, reason: " + reason); PowerManagerService.lowLevelReboot(reason); Log.e(TAG, "Reboot failed, will attempt shutdown instead"); } else if (SHUTDOWN_VIBRATE_MS > 0) { } else if (SHUTDOWN_VIBRATE_MS > 0 && context != null) { // vibrate before shutting down Vibrator vibrator = new SystemVibrator(); Vibrator vibrator = new SystemVibrator(context); try { vibrator.vibrate(SHUTDOWN_VIBRATE_MS, VIBRATION_ATTRIBUTES); } catch (Exception e) { Loading
services/java/com/android/server/SystemServer.java +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ public final class SystemServer { reason = null; } ShutdownThread.rebootOrShutdown(reboot, reason); ShutdownThread.rebootOrShutdown(null, reboot, reason); } } Loading