Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89911255 authored by shaoweishen's avatar shaoweishen Committed by Shaowei Shen
Browse files

[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
parent 08ca0916
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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);