[Output Switcher] Update isHost check for device
use updated method to check if device is isHost. Test: atest MediaOutputAdapterTest MediaOutputControllerTest MediaOutputBaseDialogTest MediaOutputDialogTest Bug: 262013662 Change-Id: I89c0b5eba29051de7d59d8407d453981f5910ce6
This commit is contained in:
committed by
Shaowei Shen
parent
08ca091614
commit
8991125562
@@ -204,7 +204,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
|
||||
&& mController.isAdvancedLayoutSupported() && device.hasSubtext()) {
|
||||
boolean isActiveWithOngoingSession =
|
||||
(device.hasOngoingSession() && currentlyConnected);
|
||||
boolean isHost = mController.isVolumeControlEnabled(device)
|
||||
boolean isHost = device.isHostForOngoingSession()
|
||||
&& isActiveWithOngoingSession;
|
||||
if (isHost) {
|
||||
mCurrentActivePosition = position;
|
||||
|
||||
@@ -440,6 +440,7 @@ public class MediaOutputAdapterTest extends SysuiTestCase {
|
||||
when(mMediaOutputController.isSubStatusSupported()).thenReturn(true);
|
||||
when(mMediaOutputController.isAdvancedLayoutSupported()).thenReturn(true);
|
||||
when(mMediaOutputController.isVolumeControlEnabled(mMediaDevice1)).thenReturn(true);
|
||||
when(mMediaDevice1.isHostForOngoingSession()).thenReturn(true);
|
||||
when(mMediaDevice1.hasSubtext()).thenReturn(true);
|
||||
when(mMediaDevice1.getSubtext()).thenReturn(SUBTEXT_CUSTOM);
|
||||
when(mMediaDevice1.getSubtextString()).thenReturn(TEST_CUSTOM_SUBTEXT);
|
||||
|
||||
Reference in New Issue
Block a user