Remove duplicate routing logic from Settings app
Also, remove unused MediaRouter2Manager references. This is a non-functional change. Bug: 192657812 Test: Presubmit Change-Id: I72f5f40e157cea922ad40a2602fba881572fb708
This commit is contained in:
@@ -218,16 +218,13 @@ public class MediaDeviceUpdateWorkerTest {
|
||||
mMediaDeviceUpdateWorker.mLocalMediaManager = mock(LocalMediaManager.class);
|
||||
final List<RoutingSessionInfo> routingSessionInfos = new ArrayList<>();
|
||||
final RoutingSessionInfo remoteSessionInfo = mock(RoutingSessionInfo.class);
|
||||
final RoutingSessionInfo localSessionInfo = mock(RoutingSessionInfo.class);
|
||||
when(remoteSessionInfo.isSystemSession()).thenReturn(false);
|
||||
when(localSessionInfo.isSystemSession()).thenReturn(true);
|
||||
routingSessionInfos.add(remoteSessionInfo);
|
||||
routingSessionInfos.add(localSessionInfo);
|
||||
when(mMediaDeviceUpdateWorker.mLocalMediaManager.getActiveMediaSession()).thenReturn(
|
||||
routingSessionInfos);
|
||||
when(mMediaDeviceUpdateWorker.mLocalMediaManager.getRemoteRoutingSessions())
|
||||
.thenReturn(routingSessionInfos);
|
||||
|
||||
assertThat(mMediaDeviceUpdateWorker.getActiveRemoteMediaDevice()).containsExactly(
|
||||
remoteSessionInfo);
|
||||
assertThat(mMediaDeviceUpdateWorker.getActiveRemoteMediaDevices())
|
||||
.containsExactly(remoteSessionInfo);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -246,6 +243,7 @@ public class MediaDeviceUpdateWorkerTest {
|
||||
TEST_DEVICE_PACKAGE_NAME1);
|
||||
|
||||
mMediaDeviceUpdateWorker = new MediaDeviceUpdateWorker(mContext, URI2);
|
||||
mMediaDeviceUpdateWorker.mManager = mock(MediaRouter2Manager.class);
|
||||
mMediaDeviceUpdateWorker.mLocalMediaManager = mock(LocalMediaManager.class);
|
||||
when(mMediaDeviceUpdateWorker.mLocalMediaManager.getPackageName())
|
||||
.thenReturn(TEST_DEVICE_PACKAGE_NAME2);
|
||||
|
@@ -100,8 +100,8 @@ public class RemoteMediaSliceTest {
|
||||
when(remoteSessionInfo.getVolume()).thenReturn(10);
|
||||
when(remoteSessionInfo.isSystemSession()).thenReturn(false);
|
||||
mRoutingSessionInfos.add(remoteSessionInfo);
|
||||
when(sMediaDeviceUpdateWorker.getActiveRemoteMediaDevice()).thenReturn(
|
||||
mRoutingSessionInfos);
|
||||
when(sMediaDeviceUpdateWorker.getActiveRemoteMediaDevices())
|
||||
.thenReturn(mRoutingSessionInfos);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -118,7 +118,7 @@ public class RemoteVolumeGroupControllerTest {
|
||||
when(remoteSessionInfo.getClientPackageName()).thenReturn(TEST_PACKAGE_NAME);
|
||||
when(remoteSessionInfo.isSystemSession()).thenReturn(false);
|
||||
mRoutingSessionInfos.add(remoteSessionInfo);
|
||||
when(mLocalMediaManager.getActiveMediaSession()).thenReturn(mRoutingSessionInfos);
|
||||
when(mLocalMediaManager.getRemoteRoutingSessions()).thenReturn(mRoutingSessionInfos);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user