Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 184e2f34 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Fix history links for conversations

Include the conversation id who the right settings screen
is launched

Test: manual
Bug: 149505730
Change-Id: Idef9d88c9333a83c5c9ce035f7b25bc50c6cfa35
parent 133dc99b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
+4 −2
Original line number Diff line number Diff line
@@ -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));
        });