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

Commit 9a74366d authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Notify VDM for display removal before listeners.

This allows the displays of a virtual device to be in a
consistent state when clients receive onDisplayRemoved callback.

Test: presubmit
Test: atest VirtualDeviceManagerBasicTest#getVirtualDevice_getDisplayIds --iterations=100
Fix: 301578754
Change-Id: Ida80070c525b2aa047a848ddaa8de6e817d7f51e
parent 9408b29f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2027,9 +2027,6 @@ public final class DisplayManagerService extends SystemService {
        mDisplayBrightnesses.delete(displayId);
        DisplayManagerGlobal.invalidateLocalDisplayInfoCaches();

        sendDisplayEventLocked(display, event);
        scheduleTraversalLocked(false);

        if (mDisplayWindowPolicyControllers.contains(displayId)) {
            final IVirtualDevice virtualDevice =
                    mDisplayWindowPolicyControllers.removeReturnOld(displayId).first;
@@ -2040,6 +2037,9 @@ public final class DisplayManagerService extends SystemService {
                });
            }
        }

        sendDisplayEventLocked(display, event);
        scheduleTraversalLocked(false);
    }

    private void handleLogicalDisplaySwappedLocked(@NonNull LogicalDisplay display) {