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

Commit 40645398 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make onVirtualDisplayRemoved callback idempotent." into udc-qpr-dev am: 88c87429

parents 114c0361 88c87429
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -983,8 +983,9 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
        }

        if (virtualDisplayWrapper == null) {
            throw new IllegalStateException(
                    "Virtual device doesn't have a virtual display with ID " + displayId);
            Slog.w(TAG, "Virtual device " + mDeviceId + " doesn't have a virtual display with ID "
                    + displayId);
            return;
        }

        final long ident = Binder.clearCallingIdentity();
+0 −7
Original line number Diff line number Diff line
@@ -788,13 +788,6 @@ public class VirtualDeviceManagerServiceTest {
                nullable(String.class), eq(DISPLAY_ID_1), eq(null));
    }

    @Test
    public void onVirtualDisplayRemovedLocked_unknownDisplayId_throwsException() {
        final int unknownDisplayId = 999;
        assertThrows(IllegalStateException.class,
                () -> mDeviceImpl.onVirtualDisplayRemoved(unknownDisplayId));
    }

    @Test
    public void onVirtualDisplayRemovedLocked_wakeLockIsReleased() throws RemoteException {
        addVirtualDisplay(mDeviceImpl, DISPLAY_ID_1);