Merge "Update method name" into sc-dev am: a2c2889c78

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14919903

Change-Id: I4cff8e8f8043befdbd3b914aa4e2a9ee87f957ca
This commit is contained in:
Julia Reynolds
2021-06-09 18:02:47 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 17 deletions

View File

@@ -141,9 +141,9 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
int order = 100; int order = 100;
boolean hasClearable = false; boolean hasClearable = false;
for (ConversationChannel conversation : conversations) { for (ConversationChannel conversation : conversations) {
if (conversation.getParentNotificationChannel().getImportance() == IMPORTANCE_NONE if (conversation.getNotificationChannel().getImportance() == IMPORTANCE_NONE
|| (conversation.getParentNotificationChannelGroup() != null || (conversation.getNotificationChannelGroup() != null
&& conversation.getParentNotificationChannelGroup().isBlocked())) { && conversation.getNotificationChannelGroup().isBlocked())) {
continue; continue;
} }
RecentConversationPreference pref = RecentConversationPreference pref =
@@ -179,12 +179,12 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
pref.setSummary(getSummary(conversation)); pref.setSummary(getSummary(conversation));
pref.setIcon(mBackend.getConversationDrawable(mContext, conversation.getShortcutInfo(), pref.setIcon(mBackend.getConversationDrawable(mContext, conversation.getShortcutInfo(),
pkg, uid, false)); pkg, uid, false));
pref.setKey(conversation.getParentNotificationChannel().getId() pref.setKey(conversation.getNotificationChannel().getId()
+ ":" + conversationId); + ":" + conversationId);
pref.setOnPreferenceClickListener(preference -> { pref.setOnPreferenceClickListener(preference -> {
mBackend.createConversationNotificationChannel( mBackend.createConversationNotificationChannel(
pkg, uid, pkg, uid,
conversation.getParentNotificationChannel(), conversation.getNotificationChannel(),
conversationId); conversationId);
getSubSettingLauncher(conversation, pref.getTitle()).launch(); getSubSettingLauncher(conversation, pref.getTitle()).launch();
return true; return true;
@@ -194,11 +194,11 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
} }
CharSequence getSummary(ConversationChannel conversation) { CharSequence getSummary(ConversationChannel conversation) {
return conversation.getParentNotificationChannelGroup() == null return conversation.getNotificationChannelGroup() == null
? conversation.getParentNotificationChannel().getName() ? conversation.getNotificationChannel().getName()
: mContext.getString(R.string.notification_conversation_summary, : mContext.getString(R.string.notification_conversation_summary,
conversation.getParentNotificationChannel().getName(), conversation.getNotificationChannel().getName(),
conversation.getParentNotificationChannelGroup().getName()); conversation.getNotificationChannelGroup().getName());
} }
CharSequence getTitle(ConversationChannel conversation) { CharSequence getTitle(ConversationChannel conversation) {
@@ -213,7 +213,7 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME,
conversation.getShortcutInfo().getPackage()); conversation.getShortcutInfo().getPackage());
channelArgs.putString(Settings.EXTRA_CHANNEL_ID, channelArgs.putString(Settings.EXTRA_CHANNEL_ID,
conversation.getParentNotificationChannel().getId()); conversation.getNotificationChannel().getId());
channelArgs.putString(Settings.EXTRA_CONVERSATION_ID, channelArgs.putString(Settings.EXTRA_CONVERSATION_ID,
conversation.getShortcutInfo().getId()); conversation.getShortcutInfo().getId());
@@ -235,8 +235,8 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
o2.getShortcutInfo().getLabel()); o2.getShortcutInfo().getLabel());
if (labelComparison == 0) { if (labelComparison == 0) {
return o1.getParentNotificationChannel().getId().compareTo( return o1.getNotificationChannel().getId().compareTo(
o2.getParentNotificationChannel().getId()); o2.getNotificationChannel().getId());
} }
return labelComparison; return labelComparison;

View File

@@ -160,9 +160,9 @@ public class RecentConversationsPreferenceControllerTest {
true); true);
assertThat(mController.getSummary(ccw).toString()).contains( assertThat(mController.getSummary(ccw).toString()).contains(
ccw.getParentNotificationChannelGroup().getName()); ccw.getNotificationChannelGroup().getName());
assertThat(mController.getSummary(ccw).toString()).contains( assertThat(mController.getSummary(ccw).toString()).contains(
ccw.getParentNotificationChannel().getName()); ccw.getNotificationChannel().getName());
} }
@Test @Test
@@ -175,7 +175,7 @@ public class RecentConversationsPreferenceControllerTest {
true); true);
assertThat(mController.getSummary(ccw).toString()).isEqualTo( assertThat(mController.getSummary(ccw).toString()).isEqualTo(
ccw.getParentNotificationChannel().getName()); ccw.getNotificationChannel().getName());
} }
@Test @Test
@@ -207,7 +207,7 @@ public class RecentConversationsPreferenceControllerTest {
ccw.getShortcutInfo().getPackage()); ccw.getShortcutInfo().getPackage());
assertThat(extras.getInt(AppInfoBase.ARG_PACKAGE_UID)).isEqualTo(ccw.getUid()); assertThat(extras.getInt(AppInfoBase.ARG_PACKAGE_UID)).isEqualTo(ccw.getUid());
assertThat(extras.getString(Settings.EXTRA_CHANNEL_ID)).isEqualTo( assertThat(extras.getString(Settings.EXTRA_CHANNEL_ID)).isEqualTo(
ccw.getParentNotificationChannel().getId()); ccw.getNotificationChannel().getId());
assertThat(extras.getString(Settings.EXTRA_CONVERSATION_ID)).isEqualTo( assertThat(extras.getString(Settings.EXTRA_CONVERSATION_ID)).isEqualTo(
ccw.getShortcutInfo().getId()); ccw.getShortcutInfo().getId());
} }
@@ -230,7 +230,7 @@ public class RecentConversationsPreferenceControllerTest {
// expected since it tries to launch an activity // expected since it tries to launch an activity
} }
verify(mBackend).createConversationNotificationChannel( verify(mBackend).createConversationNotificationChannel(
si.getPackage(), ccw.getUid(), ccw.getParentNotificationChannel(), si.getId()); si.getPackage(), ccw.getUid(), ccw.getNotificationChannel(), si.getId());
} }
@Test @Test