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

Commit 0f3b9572 authored by chaviw's avatar chaviw
Browse files

Clear calling identity when requesting syncInputTransaction

The syncInputTransaction can trigger a performSurfacePlacement which
could result in a callback to the client. In that case, the calling PID
will be incorrect since we didn't clear the calling identity before
requesting the performSurfacePlacement.

Bug: 154665556
Test: Hard to reproduce. Existing tests pass
Change-Id: Id7c35d356cfc435e2de225e4e0d3979751c5c7d4
parent f13d436c
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -7922,6 +7922,8 @@ public class WindowManagerService extends IWindowManager.Stub

    @Override
    public void syncInputTransactions() {
        long token = Binder.clearCallingIdentity();
        try {
            waitForAnimationsToComplete();

            // Collect all input transactions from all displays to make sure we could sync all input
@@ -7934,6 +7936,9 @@ public class WindowManagerService extends IWindowManager.Stub
            }

            t.syncInputWindows().apply();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }

    /**