diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl index be15c700818ca..b3983d276dcb9 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl @@ -155,5 +155,10 @@ interface ISystemUiProxy { */ void onImeSwitcherPressed() = 49; - // Next id = 50 + /** + * Notifies to toggle notification panel. + */ + void toggleNotificationPanel() = 50; + + // Next id = 51 } diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index e7cd1e2dab3ca..60060aaf72da3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -404,6 +404,13 @@ public class OverviewProxyService extends CurrentUserTracker implements () -> mCommandQueue.handleSystemKey(KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN)); } + @Override + public void toggleNotificationPanel() { + verifyCallerAndClearCallingIdentityPostMain("toggleNotificationPanel", () -> + mStatusBarOptionalLazy.get().ifPresent(StatusBar::togglePanel)); + } + + private boolean verifyCaller(String reason) { final int callerId = Binder.getCallingUserHandle().getIdentifier(); if (callerId != mCurrentBoundedUserId) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 1ca297abb414e..07914cf1d9c4b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -434,6 +434,10 @@ public class StatusBar extends CoreStartable implements mCommandQueueCallbacks.animateCollapsePanels(flags, force); } + /** */ + public void togglePanel() { + mCommandQueueCallbacks.togglePanel(); + } /** * The {@link StatusBarState} of the status bar. */