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

Commit 59f80fd4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix getConversations NPE" into main

parents 23aaf018 6fae6335
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1925,8 +1925,10 @@ public class PreferencesHelper implements RankingConfig {
                    conversation.setPkg(r.pkg);
                    conversation.setUid(r.uid);
                    conversation.setNotificationChannel(nc);
                    conversation.setParentChannelLabel(
                            r.channels.get(nc.getParentChannelId()).getName());
                    NotificationChannel parent = r.channels.get(nc.getParentChannelId());
                    conversation.setParentChannelLabel(parent == null
                            ? null
                            : parent.getName());
                    boolean blockedByGroup = false;
                    if (nc.getGroup() != null) {
                        NotificationChannelGroup group = r.groups.get(nc.getGroup());
+5 −0
Original line number Diff line number Diff line
@@ -5495,6 +5495,11 @@ public class PreferencesHelperTest extends UiServiceTestCase {

        assertEquals(1, convos.size());
        assertTrue(conversationWrapperContainsChannel(convos, channel));

        // Also test the getConversations(pkg, uid) API
        List<ConversationChannelWrapper> convosByPkgUid = mHelper.getConversations(PKG_O, UID_O);
        assertEquals(1, convos.size());
        assertTrue(conversationWrapperContainsChannel(convos, channel));
    }

    private boolean conversationWrapperContainsChannel(List<ConversationChannelWrapper> list,