Loading services/core/java/com/android/server/statusbar/StatusBarManagerService.java +10 −4 Original line number Diff line number Diff line Loading @@ -763,8 +763,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub { enforceStatusBarService(); long identity = Binder.clearCallingIdentity(); try { // ShutdownThread displays UI, so give it a UI context. mHandler.post(() -> ShutdownThread.shutdown(mContext, PowerManager.SHUTDOWN_USER_REQUESTED, false)); ShutdownThread.shutdown(getUiContext(), PowerManager.SHUTDOWN_USER_REQUESTED, false)); } finally { Binder.restoreCallingIdentity(identity); } Loading @@ -780,11 +782,11 @@ public class StatusBarManagerService extends IStatusBarService.Stub { try { mHandler.post(() -> { // ShutdownThread displays UI, so give it a UI context. Context uiContext = ActivityThread.currentActivityThread().getSystemUiContext(); if (safeMode) { ShutdownThread.rebootSafeMode(uiContext, false); ShutdownThread.rebootSafeMode(getUiContext(), false); } else { ShutdownThread.reboot(uiContext, PowerManager.SHUTDOWN_USER_REQUESTED, false); ShutdownThread.reboot(getUiContext(), PowerManager.SHUTDOWN_USER_REQUESTED, false); } }); } finally { Loading Loading @@ -1018,4 +1020,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub { } } } private static final Context getUiContext() { return ActivityThread.currentActivityThread().getSystemUiContext(); } } Loading
services/core/java/com/android/server/statusbar/StatusBarManagerService.java +10 −4 Original line number Diff line number Diff line Loading @@ -763,8 +763,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub { enforceStatusBarService(); long identity = Binder.clearCallingIdentity(); try { // ShutdownThread displays UI, so give it a UI context. mHandler.post(() -> ShutdownThread.shutdown(mContext, PowerManager.SHUTDOWN_USER_REQUESTED, false)); ShutdownThread.shutdown(getUiContext(), PowerManager.SHUTDOWN_USER_REQUESTED, false)); } finally { Binder.restoreCallingIdentity(identity); } Loading @@ -780,11 +782,11 @@ public class StatusBarManagerService extends IStatusBarService.Stub { try { mHandler.post(() -> { // ShutdownThread displays UI, so give it a UI context. Context uiContext = ActivityThread.currentActivityThread().getSystemUiContext(); if (safeMode) { ShutdownThread.rebootSafeMode(uiContext, false); ShutdownThread.rebootSafeMode(getUiContext(), false); } else { ShutdownThread.reboot(uiContext, PowerManager.SHUTDOWN_USER_REQUESTED, false); ShutdownThread.reboot(getUiContext(), PowerManager.SHUTDOWN_USER_REQUESTED, false); } }); } finally { Loading Loading @@ -1018,4 +1020,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub { } } } private static final Context getUiContext() { return ActivityThread.currentActivityThread().getSystemUiContext(); } }