Merge "Hide the icon if there is no media session or album art." into rvc-qpr-dev am: e9d4e584d5

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

Change-Id: Id1ecd31b8ad1b6290ad7fda12a7752f55655ad2b
This commit is contained in:
TreeHugger Robot
2020-09-22 03:50:01 +00:00
committed by Automerger Merge Worker
4 changed files with 54 additions and 43 deletions

View File

@@ -317,4 +317,20 @@ public class MediaOutputPanelTest {
public void getViewType_checkType() {
assertThat(mPanel.getViewType()).isEqualTo(PanelContent.VIEW_TYPE_SLIDER_LARGE_ICON);
}
@Test
public void getIcon_mediaControllerIsNull_returnNull() {
mMediaControllers.clear();
mPanel.onStart();
assertThat(mPanel.getIcon()).isNull();
}
@Test
public void getIcon_mediaMetadataIsNull_returnNull() {
mPanel.onStart();
when(mMediaController.getMetadata()).thenReturn(null);
assertThat(mPanel.getIcon()).isNull();
}
}