From 67c166d8596fee6e954ac6a8cc33c295ae265bea Mon Sep 17 00:00:00 2001 From: yoshiki iguchi Date: Mon, 26 Nov 2018 13:11:36 +0900 Subject: [PATCH] Restore "view" argument for notification remote view click handler The "view" argument of NotificationRemoteInputManager.Callaback# handleRemoteViewClick had been removed by ag/4863109, because this was unused on Android. But we ARC wants to restore and use it to distinguish the view issuing a click event. Bug: 111391270 Test: build passes Change-Id: I4eb8b80dd68e94ed9dbd457f79f8981fee2e4cd1 --- .../systemui/statusbar/NotificationRemoteInputManager.java | 6 ++++-- .../statusbar/phone/StatusBarRemoteInputCallback.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java index 8c53cc2a06a4d..e2ee998815c55 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java @@ -141,7 +141,7 @@ public class NotificationRemoteInputManager implements Dumpable { ActivityManager.getService().resumeAppSwitches(); } catch (RemoteException e) { } - return mCallback.handleRemoteViewClick(pendingIntent, () -> { + return mCallback.handleRemoteViewClick(view, pendingIntent, () -> { Pair options = response.getLaunchOptions(view); options.second.setLaunchWindowingMode( WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY); @@ -658,11 +658,13 @@ public class NotificationRemoteInputManager implements Dumpable { * Performs any special handling for a remote view click. The default behaviour can be * called through the defaultHandler parameter. * + * @param view * @param pendingIntent * @param defaultHandler * @return true iff the click was handled */ - boolean handleRemoteViewClick(PendingIntent pendingIntent, ClickHandler defaultHandler); + boolean handleRemoteViewClick(View view, PendingIntent pendingIntent, + ClickHandler defaultHandler); } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java index a743d41e8d3a6..42c0dccd86b09 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java @@ -206,7 +206,7 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks { } @Override - public boolean handleRemoteViewClick(PendingIntent pendingIntent, + public boolean handleRemoteViewClick(View view, PendingIntent pendingIntent, NotificationRemoteInputManager.ClickHandler defaultHandler) { final boolean isActivity = pendingIntent.isActivity(); if (isActivity) {