From 184e2f34ab3b20f2a7cf862ceeb9b0cccb72080d Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 14 Feb 2020 10:22:40 -0500 Subject: [PATCH] Fix history links for conversations Include the conversation id who the right settings screen is launched Test: manual Bug: 149505730 Change-Id: Idef9d88c9333a83c5c9ce035f7b25bc50c6cfa35 --- .../notification/history/NotificationHistoryAdapter.java | 3 ++- .../notification/history/NotificationHistoryViewHolder.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/notification/history/NotificationHistoryAdapter.java b/src/com/android/settings/notification/history/NotificationHistoryAdapter.java index 87804d5cca8..4448dee3f6c 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryAdapter.java +++ b/src/com/android/settings/notification/history/NotificationHistoryAdapter.java @@ -63,7 +63,8 @@ public class NotificationHistoryAdapter extends holder.setTitle(hn.getTitle()); holder.setSummary(hn.getText()); holder.setPostedTime(hn.getPostedTimeMs()); - holder.addOnClick(hn.getPackage(), hn.getUserId(), hn.getChannelId()); + holder.addOnClick(hn.getPackage(), hn.getUserId(), hn.getChannelId(), + hn.getConversationId()); } @Override diff --git a/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java b/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java index e7caa6af292..d1f47afad85 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java +++ b/src/com/android/settings/notification/history/NotificationHistoryViewHolder.java @@ -18,6 +18,7 @@ package com.android.settings.notification.history; import static android.provider.Settings.EXTRA_APP_PACKAGE; import static android.provider.Settings.EXTRA_CHANNEL_ID; +import static android.provider.Settings.EXTRA_CONVERSATION_ID; import android.content.Intent; import android.os.UserHandle; @@ -61,11 +62,12 @@ public class NotificationHistoryViewHolder extends RecyclerView.ViewHolder { mTime.setTime(postedTime); } - void addOnClick(String pkg, int userId, String channelId) { + void addOnClick(String pkg, int userId, String channelId, String conversationId) { itemView.setOnClickListener(v -> { Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) .putExtra(EXTRA_APP_PACKAGE, pkg) - .putExtra(EXTRA_CHANNEL_ID, channelId); + .putExtra(EXTRA_CHANNEL_ID, channelId) + .putExtra(EXTRA_CONVERSATION_ID, conversationId); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); itemView.getContext().startActivityAsUser(intent, UserHandle.of(userId)); });