Fix history links for conversations

Include the conversation id who the right settings screen
is launched

Test: manual
Bug: 149505730
Change-Id: Idef9d88c9333a83c5c9ce035f7b25bc50c6cfa35
This commit is contained in:
Julia Reynolds
2020-02-14 10:22:40 -05:00
parent 133dc99b42
commit 184e2f34ab
2 changed files with 6 additions and 3 deletions

View File

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

View File

@@ -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));
});