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
This commit is contained in:
Shuming Hao
2021-12-10 16:38:58 -08:00
parent 1544cd3cd2
commit a549d1d2ae
3 changed files with 17 additions and 1 deletions

View File

@@ -155,5 +155,10 @@ interface ISystemUiProxy {
*/
void onImeSwitcherPressed() = 49;
// Next id = 50
/**
* Notifies to toggle notification panel.
*/
void toggleNotificationPanel() = 50;
// Next id = 51
}

View File

@@ -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) {

View File

@@ -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.
*/