Loading src/com/android/settings/notification/app/ConversationHeaderPreferenceController.java +18 −15 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.notification.app; import static com.android.settings.widget.EntityHeaderController.PREF_KEY_APP_HEADER; import android.app.Activity; import android.app.NotificationChannel; import android.content.Context; import android.text.BidiFormatter; import android.text.SpannableStringBuilder; Loading Loading @@ -101,8 +102,10 @@ public class ConversationHeaderPreferenceController extends NotificationPreferen @Override public CharSequence getSummary() { if (mChannel != null && !isDefaultChannel()) { CharSequence parentChannelLabel = mBackend.getChannel(mAppRow.pkg, mAppRow.uid, mChannel.getParentChannelId()).getName(); NotificationChannel parent = mBackend.getChannel(mAppRow.pkg, mAppRow.uid, mChannel.getParentChannelId()); if (parent != null) { CharSequence parentChannelLabel = parent.getName(); if (mChannelGroup != null && !TextUtils.isEmpty(mChannelGroup.getName())) { final SpannableStringBuilder summary = new SpannableStringBuilder(); Loading @@ -115,10 +118,10 @@ public class ConversationHeaderPreferenceController extends NotificationPreferen } else { return parentChannelLabel; } } else { return ""; } } return ""; } @OnLifecycleEvent(Lifecycle.Event.ON_START) public void onStart() { Loading tests/robotests/src/com/android/settings/notification/app/ConversationHeaderPreferenceControllerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -163,5 +163,9 @@ public class ConversationHeaderPreferenceControllerTest { NotificationChannel.DEFAULT_CHANNEL_ID, "", IMPORTANCE_NONE); mController.onResume(appRow, defaultChannel, null, null, null, null, null); assertEquals("", mController.getSummary()); when(mBackend.getChannel(appRow.pkg, appRow.uid, "parent")).thenReturn(null); mController.onResume(appRow, channel, group, null, null, null, null); assertEquals("", mController.getSummary()); } } Loading
src/com/android/settings/notification/app/ConversationHeaderPreferenceController.java +18 −15 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.notification.app; import static com.android.settings.widget.EntityHeaderController.PREF_KEY_APP_HEADER; import android.app.Activity; import android.app.NotificationChannel; import android.content.Context; import android.text.BidiFormatter; import android.text.SpannableStringBuilder; Loading Loading @@ -101,8 +102,10 @@ public class ConversationHeaderPreferenceController extends NotificationPreferen @Override public CharSequence getSummary() { if (mChannel != null && !isDefaultChannel()) { CharSequence parentChannelLabel = mBackend.getChannel(mAppRow.pkg, mAppRow.uid, mChannel.getParentChannelId()).getName(); NotificationChannel parent = mBackend.getChannel(mAppRow.pkg, mAppRow.uid, mChannel.getParentChannelId()); if (parent != null) { CharSequence parentChannelLabel = parent.getName(); if (mChannelGroup != null && !TextUtils.isEmpty(mChannelGroup.getName())) { final SpannableStringBuilder summary = new SpannableStringBuilder(); Loading @@ -115,10 +118,10 @@ public class ConversationHeaderPreferenceController extends NotificationPreferen } else { return parentChannelLabel; } } else { return ""; } } return ""; } @OnLifecycleEvent(Lifecycle.Event.ON_START) public void onStart() { Loading
tests/robotests/src/com/android/settings/notification/app/ConversationHeaderPreferenceControllerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -163,5 +163,9 @@ public class ConversationHeaderPreferenceControllerTest { NotificationChannel.DEFAULT_CHANNEL_ID, "", IMPORTANCE_NONE); mController.onResume(appRow, defaultChannel, null, null, null, null, null); assertEquals("", mController.getSummary()); when(mBackend.getChannel(appRow.pkg, appRow.uid, "parent")).thenReturn(null); mController.onResume(appRow, channel, group, null, null, null, null); assertEquals("", mController.getSummary()); } }