From 22fbc854ea23168778a06cd985a37763af500298 Mon Sep 17 00:00:00 2001 From: Shuming Hao Date: Fri, 10 Dec 2021 16:33:49 -0800 Subject: [PATCH] Toggle notification panel when new buttons are clicked 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: I8c7383d2efa6f15de10a50173cfff86ab20ebb4c --- .../taskbar/TaskbarNavButtonController.java | 15 ++++++++++++++- .../src/com/android/quickstep/SystemUiProxy.java | 11 +++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java index b0f6e446a6..7b52ef76b0 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java @@ -16,7 +16,6 @@ package com.android.launcher3.taskbar; - import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS; import static com.android.internal.app.AssistUtils.INVOCATION_TYPE_KEY; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; @@ -103,6 +102,12 @@ public class TaskbarNavButtonController { case BUTTON_A11Y: notifyA11yClick(false /* longClick */); break; + case BUTTON_QUICK_SETTINGS: + showQuickSettings(); + break; + case BUTTON_NOTIFICATIONS: + showNotifications(); + break; } } @@ -206,4 +211,12 @@ public class TaskbarNavButtonController { args.putInt(INVOCATION_TYPE_KEY, INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS); mSystemUiProxy.startAssistant(args); } + + private void showQuickSettings() { + mSystemUiProxy.toggleNotificationPanel(); + } + + private void showNotifications() { + mSystemUiProxy.toggleNotificationPanel(); + } } diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 67e7f88c33..b428b67aa0 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -478,6 +478,17 @@ public class SystemUiProxy implements ISystemUiProxy, } } + @Override + public void toggleNotificationPanel() { + if (mSystemUiProxy != null) { + try { + mSystemUiProxy.toggleNotificationPanel(); + } catch (RemoteException e) { + Log.w(TAG, "Failed call toggleNotificationPanel", e); + } + } + } + // // Pip //