Skip to content
Snippets Groups Projects
Commit f1dc720f authored by Biswarup Pal's avatar Biswarup Pal
Browse files

Fix VirtualDeviceManagerServiceTest failure

Test: m VirtualDeviceManagerServiceTest
Bug: 308771440
Change-Id: I537f489de6b3e4ec15380984b1a4381fe08fea78
parent b7a1e303
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......@@ -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);
......
......@@ -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;
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment