Loading src/com/android/settings/notification/app/ConversationNotificationSettings.java +4 −3 Original line number Diff line number Diff line Loading @@ -41,13 +41,14 @@ public class ConversationNotificationSettings extends NotificationSettings { @Override public void onResume() { super.onResume(); if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null || mChannel == null || mConversationInfo == null) { if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null || mChannel == null) { Log.w(TAG, "Missing package or uid or packageinfo or channel"); finish(); return; } getActivity().setTitle(mConversationInfo.getLabel()); getActivity().setTitle(mConversationInfo == null ? mChannel.getName() : mConversationInfo.getLabel()); for (NotificationPreferenceController controller : mControllers) { controller.onResume(mAppRow, mChannel, mChannelGroup, mConversationDrawable, Loading src/com/android/settings/notification/app/NotificationSettings.java +3 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,9 @@ abstract public class NotificationSettings extends DashboardFragment { String conversationId = intent != null ? intent.getStringExtra(Settings.EXTRA_CONVERSATION_ID) : null; mChannel = mBackend.getChannel(mPkg, mUid, channelId, conversationId); if (mChannel == null) { mBackend.getChannel(mPkg, mUid, channelId, null); } } private void loadConversation() { Loading tests/robotests/src/com/android/settings/notification/app/HeaderPreferenceControllerTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ public class HeaderPreferenceControllerTest { NotificationChannel defaultChannel = new NotificationChannel( NotificationChannel.DEFAULT_CHANNEL_ID, "", IMPORTANCE_NONE); mController.onResume(appRow, defaultChannel, null, null, null, null, null); assertEquals("", mController.getSummary()); assertEquals(appRow.label, mController.getSummary()); } @Test Loading @@ -159,13 +159,13 @@ public class HeaderPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.label = "bananas"; mController.onResume(appRow, null, null, null, null, null, null); assertEquals("", mController.getSecondSummary()); assertEquals(null, mController.getSecondSummary()); NotificationChannelGroup group = new NotificationChannelGroup("id", "name"); NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE); mController.onResume(appRow, channel, group, null, null, null, null); assertEquals("", mController.getSecondSummary()); assertEquals(null, mController.getSecondSummary()); channel.setDescription("description"); mController.onResume(appRow, channel, group, null, null, null, null); Loading Loading
src/com/android/settings/notification/app/ConversationNotificationSettings.java +4 −3 Original line number Diff line number Diff line Loading @@ -41,13 +41,14 @@ public class ConversationNotificationSettings extends NotificationSettings { @Override public void onResume() { super.onResume(); if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null || mChannel == null || mConversationInfo == null) { if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null || mChannel == null) { Log.w(TAG, "Missing package or uid or packageinfo or channel"); finish(); return; } getActivity().setTitle(mConversationInfo.getLabel()); getActivity().setTitle(mConversationInfo == null ? mChannel.getName() : mConversationInfo.getLabel()); for (NotificationPreferenceController controller : mControllers) { controller.onResume(mAppRow, mChannel, mChannelGroup, mConversationDrawable, Loading
src/com/android/settings/notification/app/NotificationSettings.java +3 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,9 @@ abstract public class NotificationSettings extends DashboardFragment { String conversationId = intent != null ? intent.getStringExtra(Settings.EXTRA_CONVERSATION_ID) : null; mChannel = mBackend.getChannel(mPkg, mUid, channelId, conversationId); if (mChannel == null) { mBackend.getChannel(mPkg, mUid, channelId, null); } } private void loadConversation() { Loading
tests/robotests/src/com/android/settings/notification/app/HeaderPreferenceControllerTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ public class HeaderPreferenceControllerTest { NotificationChannel defaultChannel = new NotificationChannel( NotificationChannel.DEFAULT_CHANNEL_ID, "", IMPORTANCE_NONE); mController.onResume(appRow, defaultChannel, null, null, null, null, null); assertEquals("", mController.getSummary()); assertEquals(appRow.label, mController.getSummary()); } @Test Loading @@ -159,13 +159,13 @@ public class HeaderPreferenceControllerTest { NotificationBackend.AppRow appRow = new NotificationBackend.AppRow(); appRow.label = "bananas"; mController.onResume(appRow, null, null, null, null, null, null); assertEquals("", mController.getSecondSummary()); assertEquals(null, mController.getSecondSummary()); NotificationChannelGroup group = new NotificationChannelGroup("id", "name"); NotificationChannel channel = new NotificationChannel("cid", "cname", IMPORTANCE_NONE); mController.onResume(appRow, channel, group, null, null, null, null); assertEquals("", mController.getSecondSummary()); assertEquals(null, mController.getSecondSummary()); channel.setDescription("description"); mController.onResume(appRow, channel, group, null, null, null, null); Loading