Skip to content
Snippets Groups Projects
Commit 9c6b8fee authored by Biswarup Pal's avatar Biswarup Pal Committed by Android (Google) Code Review
Browse files

Merge "Fix VirtualDeviceManagerServiceTest failure" into main

parents 899e27ea f1dc720f
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