Loading services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,8 @@ public class VirtualDeviceManagerServiceTest { final DisplayInfo displayInfo = new DisplayInfo(); displayInfo.uniqueId = UNIQUE_ID; doReturn(displayInfo).when(mDisplayManagerInternalMock).getDisplayInfo(anyInt()); doReturn(Display.INVALID_DISPLAY).when(mDisplayManagerInternalMock) .getDisplayIdToMirror(anyInt()); LocalServices.removeServiceForTest(DisplayManagerInternal.class); LocalServices.addService(DisplayManagerInternal.class, mDisplayManagerInternalMock); Loading Loading @@ -1627,6 +1629,7 @@ public class VirtualDeviceManagerServiceTest { @Test public void openNonBlockedAppOnMirrorDisplay_flagDisabled_launchesActivity() { mSetFlagsRule.disableFlags(Flags.FLAG_INTERACTIVE_SCREEN_MIRROR); when(mDisplayManagerInternalMock.getDisplayIdToMirror(anyInt())) .thenReturn(Display.DEFAULT_DISPLAY); addVirtualDisplay(mDeviceImpl, DISPLAY_ID_1); Loading services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceRule.java +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.net.MacAddress; import android.os.Binder; import android.testing.TestableContext; import android.util.ArraySet; import android.view.Display; import android.view.DisplayInfo; import android.view.WindowManager; Loading Loading @@ -137,6 +138,8 @@ public class VirtualDeviceRule implements TestRule { final DisplayInfo displayInfo = new DisplayInfo(); displayInfo.uniqueId = "uniqueId"; doReturn(displayInfo).when(mDisplayManagerInternalMock).getDisplayInfo(anyInt()); doReturn(Display.INVALID_DISPLAY).when(mDisplayManagerInternalMock) .getDisplayIdToMirror(anyInt()); LocalServices.removeServiceForTest(DisplayManagerInternal.class); LocalServices.addService(DisplayManagerInternal.class, mDisplayManagerInternalMock); Loading Loading
services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -347,6 +347,8 @@ public class VirtualDeviceManagerServiceTest { final DisplayInfo displayInfo = new DisplayInfo(); displayInfo.uniqueId = UNIQUE_ID; doReturn(displayInfo).when(mDisplayManagerInternalMock).getDisplayInfo(anyInt()); doReturn(Display.INVALID_DISPLAY).when(mDisplayManagerInternalMock) .getDisplayIdToMirror(anyInt()); LocalServices.removeServiceForTest(DisplayManagerInternal.class); LocalServices.addService(DisplayManagerInternal.class, mDisplayManagerInternalMock); Loading Loading @@ -1627,6 +1629,7 @@ public class VirtualDeviceManagerServiceTest { @Test public void openNonBlockedAppOnMirrorDisplay_flagDisabled_launchesActivity() { mSetFlagsRule.disableFlags(Flags.FLAG_INTERACTIVE_SCREEN_MIRROR); when(mDisplayManagerInternalMock.getDisplayIdToMirror(anyInt())) .thenReturn(Display.DEFAULT_DISPLAY); addVirtualDisplay(mDeviceImpl, DISPLAY_ID_1); Loading
services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceRule.java +3 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.net.MacAddress; import android.os.Binder; import android.testing.TestableContext; import android.util.ArraySet; import android.view.Display; import android.view.DisplayInfo; import android.view.WindowManager; Loading Loading @@ -137,6 +138,8 @@ public class VirtualDeviceRule implements TestRule { final DisplayInfo displayInfo = new DisplayInfo(); displayInfo.uniqueId = "uniqueId"; doReturn(displayInfo).when(mDisplayManagerInternalMock).getDisplayInfo(anyInt()); doReturn(Display.INVALID_DISPLAY).when(mDisplayManagerInternalMock) .getDisplayIdToMirror(anyInt()); LocalServices.removeServiceForTest(DisplayManagerInternal.class); LocalServices.addService(DisplayManagerInternal.class, mDisplayManagerInternalMock); Loading