Loading src/com/android/settings/notification/app/RecentConversationsPreferenceController.java +12 −12 Original line number Diff line number Diff line Loading @@ -141,9 +141,9 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC int order = 100; boolean hasClearable = false; for (ConversationChannel conversation : conversations) { if (conversation.getParentNotificationChannel().getImportance() == IMPORTANCE_NONE || (conversation.getParentNotificationChannelGroup() != null && conversation.getParentNotificationChannelGroup().isBlocked())) { if (conversation.getNotificationChannel().getImportance() == IMPORTANCE_NONE || (conversation.getNotificationChannelGroup() != null && conversation.getNotificationChannelGroup().isBlocked())) { continue; } RecentConversationPreference pref = Loading Loading @@ -179,12 +179,12 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC pref.setSummary(getSummary(conversation)); pref.setIcon(mBackend.getConversationDrawable(mContext, conversation.getShortcutInfo(), pkg, uid, false)); pref.setKey(conversation.getParentNotificationChannel().getId() pref.setKey(conversation.getNotificationChannel().getId() + ":" + conversationId); pref.setOnPreferenceClickListener(preference -> { mBackend.createConversationNotificationChannel( pkg, uid, conversation.getParentNotificationChannel(), conversation.getNotificationChannel(), conversationId); getSubSettingLauncher(conversation, pref.getTitle()).launch(); return true; Loading @@ -194,11 +194,11 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC } CharSequence getSummary(ConversationChannel conversation) { return conversation.getParentNotificationChannelGroup() == null ? conversation.getParentNotificationChannel().getName() return conversation.getNotificationChannelGroup() == null ? conversation.getNotificationChannel().getName() : mContext.getString(R.string.notification_conversation_summary, conversation.getParentNotificationChannel().getName(), conversation.getParentNotificationChannelGroup().getName()); conversation.getNotificationChannel().getName(), conversation.getNotificationChannelGroup().getName()); } CharSequence getTitle(ConversationChannel conversation) { Loading @@ -213,7 +213,7 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, conversation.getShortcutInfo().getPackage()); channelArgs.putString(Settings.EXTRA_CHANNEL_ID, conversation.getParentNotificationChannel().getId()); conversation.getNotificationChannel().getId()); channelArgs.putString(Settings.EXTRA_CONVERSATION_ID, conversation.getShortcutInfo().getId()); Loading @@ -235,8 +235,8 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC o2.getShortcutInfo().getLabel()); if (labelComparison == 0) { return o1.getParentNotificationChannel().getId().compareTo( o2.getParentNotificationChannel().getId()); return o1.getNotificationChannel().getId().compareTo( o2.getNotificationChannel().getId()); } return labelComparison; Loading tests/robotests/src/com/android/settings/notification/app/RecentConversationsPreferenceControllerTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -160,9 +160,9 @@ public class RecentConversationsPreferenceControllerTest { true); assertThat(mController.getSummary(ccw).toString()).contains( ccw.getParentNotificationChannelGroup().getName()); ccw.getNotificationChannelGroup().getName()); assertThat(mController.getSummary(ccw).toString()).contains( ccw.getParentNotificationChannel().getName()); ccw.getNotificationChannel().getName()); } @Test Loading @@ -175,7 +175,7 @@ public class RecentConversationsPreferenceControllerTest { true); assertThat(mController.getSummary(ccw).toString()).isEqualTo( ccw.getParentNotificationChannel().getName()); ccw.getNotificationChannel().getName()); } @Test Loading Loading @@ -207,7 +207,7 @@ public class RecentConversationsPreferenceControllerTest { ccw.getShortcutInfo().getPackage()); assertThat(extras.getInt(AppInfoBase.ARG_PACKAGE_UID)).isEqualTo(ccw.getUid()); assertThat(extras.getString(Settings.EXTRA_CHANNEL_ID)).isEqualTo( ccw.getParentNotificationChannel().getId()); ccw.getNotificationChannel().getId()); assertThat(extras.getString(Settings.EXTRA_CONVERSATION_ID)).isEqualTo( ccw.getShortcutInfo().getId()); } Loading @@ -230,7 +230,7 @@ public class RecentConversationsPreferenceControllerTest { // expected since it tries to launch an activity } verify(mBackend).createConversationNotificationChannel( si.getPackage(), ccw.getUid(), ccw.getParentNotificationChannel(), si.getId()); si.getPackage(), ccw.getUid(), ccw.getNotificationChannel(), si.getId()); } @Test Loading Loading
src/com/android/settings/notification/app/RecentConversationsPreferenceController.java +12 −12 Original line number Diff line number Diff line Loading @@ -141,9 +141,9 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC int order = 100; boolean hasClearable = false; for (ConversationChannel conversation : conversations) { if (conversation.getParentNotificationChannel().getImportance() == IMPORTANCE_NONE || (conversation.getParentNotificationChannelGroup() != null && conversation.getParentNotificationChannelGroup().isBlocked())) { if (conversation.getNotificationChannel().getImportance() == IMPORTANCE_NONE || (conversation.getNotificationChannelGroup() != null && conversation.getNotificationChannelGroup().isBlocked())) { continue; } RecentConversationPreference pref = Loading Loading @@ -179,12 +179,12 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC pref.setSummary(getSummary(conversation)); pref.setIcon(mBackend.getConversationDrawable(mContext, conversation.getShortcutInfo(), pkg, uid, false)); pref.setKey(conversation.getParentNotificationChannel().getId() pref.setKey(conversation.getNotificationChannel().getId() + ":" + conversationId); pref.setOnPreferenceClickListener(preference -> { mBackend.createConversationNotificationChannel( pkg, uid, conversation.getParentNotificationChannel(), conversation.getNotificationChannel(), conversationId); getSubSettingLauncher(conversation, pref.getTitle()).launch(); return true; Loading @@ -194,11 +194,11 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC } CharSequence getSummary(ConversationChannel conversation) { return conversation.getParentNotificationChannelGroup() == null ? conversation.getParentNotificationChannel().getName() return conversation.getNotificationChannelGroup() == null ? conversation.getNotificationChannel().getName() : mContext.getString(R.string.notification_conversation_summary, conversation.getParentNotificationChannel().getName(), conversation.getParentNotificationChannelGroup().getName()); conversation.getNotificationChannel().getName(), conversation.getNotificationChannelGroup().getName()); } CharSequence getTitle(ConversationChannel conversation) { Loading @@ -213,7 +213,7 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, conversation.getShortcutInfo().getPackage()); channelArgs.putString(Settings.EXTRA_CHANNEL_ID, conversation.getParentNotificationChannel().getId()); conversation.getNotificationChannel().getId()); channelArgs.putString(Settings.EXTRA_CONVERSATION_ID, conversation.getShortcutInfo().getId()); Loading @@ -235,8 +235,8 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC o2.getShortcutInfo().getLabel()); if (labelComparison == 0) { return o1.getParentNotificationChannel().getId().compareTo( o2.getParentNotificationChannel().getId()); return o1.getNotificationChannel().getId().compareTo( o2.getNotificationChannel().getId()); } return labelComparison; Loading
tests/robotests/src/com/android/settings/notification/app/RecentConversationsPreferenceControllerTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -160,9 +160,9 @@ public class RecentConversationsPreferenceControllerTest { true); assertThat(mController.getSummary(ccw).toString()).contains( ccw.getParentNotificationChannelGroup().getName()); ccw.getNotificationChannelGroup().getName()); assertThat(mController.getSummary(ccw).toString()).contains( ccw.getParentNotificationChannel().getName()); ccw.getNotificationChannel().getName()); } @Test Loading @@ -175,7 +175,7 @@ public class RecentConversationsPreferenceControllerTest { true); assertThat(mController.getSummary(ccw).toString()).isEqualTo( ccw.getParentNotificationChannel().getName()); ccw.getNotificationChannel().getName()); } @Test Loading Loading @@ -207,7 +207,7 @@ public class RecentConversationsPreferenceControllerTest { ccw.getShortcutInfo().getPackage()); assertThat(extras.getInt(AppInfoBase.ARG_PACKAGE_UID)).isEqualTo(ccw.getUid()); assertThat(extras.getString(Settings.EXTRA_CHANNEL_ID)).isEqualTo( ccw.getParentNotificationChannel().getId()); ccw.getNotificationChannel().getId()); assertThat(extras.getString(Settings.EXTRA_CONVERSATION_ID)).isEqualTo( ccw.getShortcutInfo().getId()); } Loading @@ -230,7 +230,7 @@ public class RecentConversationsPreferenceControllerTest { // expected since it tries to launch an activity } verify(mBackend).createConversationNotificationChannel( si.getPackage(), ccw.getUid(), ccw.getParentNotificationChannel(), si.getId()); si.getPackage(), ccw.getUid(), ccw.getNotificationChannel(), si.getId()); } @Test Loading