Merge "Clear calling identity when requesting syncInputTransaction"

This commit is contained in:
Chavi Weingarten
2020-05-21 22:20:51 +00:00
committed by Gerrit Code Review

View File

@@ -7717,14 +7717,19 @@ public class WindowManagerService extends IWindowManager.Stub
@Override @Override
public void syncInputTransactions() { public void syncInputTransactions() {
waitForAnimationsToComplete(); long token = Binder.clearCallingIdentity();
try {
waitForAnimationsToComplete();
synchronized (mGlobalLock) { synchronized (mGlobalLock) {
mWindowPlacerLocked.performSurfacePlacementIfScheduled(); mWindowPlacerLocked.performSurfacePlacementIfScheduled();
mRoot.forAllDisplays(displayContent -> mRoot.forAllDisplays(displayContent ->
displayContent.getInputMonitor().updateInputWindowsImmediately()); displayContent.getInputMonitor().updateInputWindowsImmediately());
}
new SurfaceControl.Transaction().syncInputWindows().apply(true);
} finally {
Binder.restoreCallingIdentity(token);
} }
new SurfaceControl.Transaction().syncInputWindows().apply(true);
} }
private void waitForAnimationsToComplete() { private void waitForAnimationsToComplete() {