From a549d1d2aee7b42cad783f9106a9c7c8882da4df Mon Sep 17 00:00:00 2001 From: Shuming Hao Date: Fri, 10 Dec 2021 16:38:58 -0800 Subject: [PATCH] Implement toggle notification panel for new buttons in taskbar This CL adds toggle notification panel function for new buttons in Kingyo taskbar. Bug: 199333223 Test: m, verify that clicking the new buttons will expand/collapse quick settings and notification panel Recall: http://recall/clips/993bc14b-98a7-4d7d-98c4-17ba271d4da9 Change-Id: Iacec5b4aa1ea6d89e084c0a7c91ee62d2bbba8ae --- .../android/systemui/shared/recents/ISystemUiProxy.aidl | 7 ++++++- .../com/android/systemui/recents/OverviewProxyService.java | 7 +++++++ .../com/android/systemui/statusbar/phone/StatusBar.java | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) 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 3ed7e84af0201..4e9efa2d80234 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -400,6 +400,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 0f0a2f061959c..a70097c68d985 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. */