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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -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);