From dd5137ddfaa2d6ec78d9b54521bd6e6567d6d48f Mon Sep 17 00:00:00 2001 From: Jay Aliomer Date: Tue, 20 Apr 2021 17:14:29 -0400 Subject: [PATCH] Notif history Long tap functions as short tap Test: manual Fixes: b/175465501 Change-Id: I21602e87ca3d9260ba2e99006ac13d1358e4db0a --- .../notification/history/NotificationHistoryAdapter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/notification/history/NotificationHistoryAdapter.java b/src/com/android/settings/notification/history/NotificationHistoryAdapter.java index df0d9e45e8d..0683ef7612d 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryAdapter.java +++ b/src/com/android/settings/notification/history/NotificationHistoryAdapter.java @@ -78,7 +78,7 @@ public class NotificationHistoryAdapter extends holder.setTitle(hn.getTitle()); holder.setSummary(hn.getText()); holder.setPostedTime(hn.getPostedTimeMs()); - holder.itemView.setOnClickListener(v -> { + final View.OnClickListener onClick = v -> { mUiEventLogger.logWithPosition(NotificationHistoryActivity.NotificationHistoryEvent .NOTIFICATION_HISTORY_OLDER_ITEM_CLICK, hn.getUid(), hn.getPackage(), position); Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) @@ -87,6 +87,11 @@ public class NotificationHistoryAdapter extends .putExtra(EXTRA_CONVERSATION_ID, hn.getConversationId()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); holder.itemView.getContext().startActivityAsUser(intent, UserHandle.of(hn.getUserId())); + }; + holder.itemView.setOnClickListener(onClick); + holder.itemView.setOnLongClickListener(l -> { + onClick.onClick(l); + return true; }); holder.itemView.setAccessibilityDelegate(new View.AccessibilityDelegate() { @Override