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

Commit e83500d7 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Clear identity when releasing display resources.

We already do this in `close()` but not in `onVirtualDisplayRemoved()`.
This causes a security exception due to missing `WAKE_LOCK` permission
on builds that use HSUM.

Fix: 286185979
Test: presubmit
Change-Id: Iebbb04f6223d465beb1fbfe0f28d3a96e4304db3
Merged-In: I40447a461409fb523be3932d67b1fc6f0843e9e9
parent 4b4b8d7b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -987,8 +987,12 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
                    "Virtual device doesn't have a virtual display with ID " + displayId);
        }

        final long ident = Binder.clearCallingIdentity();
        try {
            releaseOwnedVirtualDisplayResources(virtualDisplayWrapper);

        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

    /**