Hide the icon if there is no media session or album art.
- Before this CL, the output switch panel will show a default
icon if there is no media session or album art.
This CL will hide the icon if there is no media session
or album art.
- Add test case
Bug: 161495909
Test: make -j42 RunSettingsRoboTests
Change-Id: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
Merged-In: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
(cherry picked from commit 30805af9de
)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user