Loading services/core/java/com/android/server/power/ShutdownThread.java +13 −9 Original line number Diff line number Diff line Loading @@ -699,20 +699,24 @@ public final class ShutdownThread extends Thread { // vibrate before shutting down Vibrator vibrator = new SystemVibrator(context); try { if (vibrator.hasVibrator()) { vibrator.vibrate( VibrationEffect.createOneShot( SHUTDOWN_VIBRATE_MS, VibrationEffect.DEFAULT_AMPLITUDE), VibrationAttributes.createForUsage(VibrationAttributes.USAGE_TOUCH)); } catch (Exception e) { // Failure to vibrate shouldn't interrupt shutdown. Just log it. Log.w(TAG, "Failed to vibrate during shutdown.", e); } // vibrator is asynchronous so we need to wait to avoid shutting down too soon. // vibrator is asynchronous so we have to wait to avoid shutting down too soon. try { Thread.sleep(SHUTDOWN_VIBRATE_MS); } catch (InterruptedException unused) { // this is not critical and does not require logging. } } } catch (Exception e) { // Failure to vibrate shouldn't interrupt shutdown. Just log it. Log.w(TAG, "Failed to vibrate during shutdown.", e); } } // Shutdown power Log.i(TAG, "Performing low-level shutdown..."); Loading Loading
services/core/java/com/android/server/power/ShutdownThread.java +13 −9 Original line number Diff line number Diff line Loading @@ -699,20 +699,24 @@ public final class ShutdownThread extends Thread { // vibrate before shutting down Vibrator vibrator = new SystemVibrator(context); try { if (vibrator.hasVibrator()) { vibrator.vibrate( VibrationEffect.createOneShot( SHUTDOWN_VIBRATE_MS, VibrationEffect.DEFAULT_AMPLITUDE), VibrationAttributes.createForUsage(VibrationAttributes.USAGE_TOUCH)); } catch (Exception e) { // Failure to vibrate shouldn't interrupt shutdown. Just log it. Log.w(TAG, "Failed to vibrate during shutdown.", e); } // vibrator is asynchronous so we need to wait to avoid shutting down too soon. // vibrator is asynchronous so we have to wait to avoid shutting down too soon. try { Thread.sleep(SHUTDOWN_VIBRATE_MS); } catch (InterruptedException unused) { // this is not critical and does not require logging. } } } catch (Exception e) { // Failure to vibrate shouldn't interrupt shutdown. Just log it. Log.w(TAG, "Failed to vibrate during shutdown.", e); } } // Shutdown power Log.i(TAG, "Performing low-level shutdown..."); Loading