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

Commit cafd1681 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.

Bug: 286185979
Test: presubmit
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ebaeb04cc8320ce15de9983d4c659571cd3b41dc)

Change-Id: I40447a461409fb523be3932d67b1fc6f0843e9e9
parent 97ae49c2
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -960,7 +960,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);
        }
    }

    private void checkVirtualInputDeviceDisplayIdAssociation(int displayId) {