Loading services/core/java/com/android/server/wm/InputMonitor.java +16 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ final class InputMonitor { // When true, need to call updateInputWindowsLw(). private boolean mUpdateInputWindowsNeeded = true; private boolean mUpdateInputWindowsPending; private boolean mApplyImmediately; // Currently focused input window handle. private InputWindowHandle mFocusedInputWindowHandle; Loading Loading @@ -152,7 +153,7 @@ final class InputMonitor { mService = service; mDisplayContent = mService.mRoot.getDisplayContent(displayId); mDisplayId = displayId; mInputTransaction = mDisplayContent.getPendingTransaction(); mInputTransaction = mService.mTransactionFactory.make(); mHandler = AnimationThread.getHandler(); mUpdateInputForAllWindowsConsumer = new UpdateInputForAllWindowsConsumer(); } Loading Loading @@ -319,6 +320,14 @@ final class InputMonitor { } } void updateInputWindowsImmediately() { if (mUpdateInputWindowsPending) { mApplyImmediately = true; mUpdateInputWindows.run(); mApplyImmediately = false; } } /* Called when the current input focus changes. * Layer assignment is assumed to be complete by the time this is called. */ Loading Loading @@ -433,7 +442,12 @@ final class InputMonitor { wallpaperInputConsumer.show(mInputTransaction, 0); } if (mApplyImmediately) { mInputTransaction.apply(); } else { mDisplayContent.getPendingTransaction().merge(mInputTransaction); mDisplayContent.scheduleAnimation(); } Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); } Loading services/core/java/com/android/server/wm/WindowManagerService.java +6 −4 Original line number Diff line number Diff line Loading @@ -7531,22 +7531,24 @@ public class WindowManagerService extends IWindowManager.Stub @Override public boolean injectInputAfterTransactionsApplied(InputEvent ev, int mode) { boolean shouldWaitForAnimComplete = false; boolean shouldWaitForAnimToComplete = false; if (ev instanceof KeyEvent) { KeyEvent keyEvent = (KeyEvent) ev; shouldWaitForAnimComplete = keyEvent.getSource() == InputDevice.SOURCE_MOUSE shouldWaitForAnimToComplete = keyEvent.getSource() == InputDevice.SOURCE_MOUSE || keyEvent.getAction() == KeyEvent.ACTION_DOWN; } else if (ev instanceof MotionEvent) { MotionEvent motionEvent = (MotionEvent) ev; shouldWaitForAnimComplete = motionEvent.getSource() == InputDevice.SOURCE_MOUSE shouldWaitForAnimToComplete = motionEvent.getSource() == InputDevice.SOURCE_MOUSE || motionEvent.getAction() == MotionEvent.ACTION_DOWN; } if (shouldWaitForAnimComplete) { if (shouldWaitForAnimToComplete) { waitForAnimationsToComplete(); synchronized (mGlobalLock) { mWindowPlacerLocked.performSurfacePlacementIfScheduled(); mRoot.forAllDisplays(displayContent -> displayContent.getInputMonitor().updateInputWindowsImmediately()); } new SurfaceControl.Transaction().syncInputWindows().apply(true); Loading Loading
services/core/java/com/android/server/wm/InputMonitor.java +16 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ final class InputMonitor { // When true, need to call updateInputWindowsLw(). private boolean mUpdateInputWindowsNeeded = true; private boolean mUpdateInputWindowsPending; private boolean mApplyImmediately; // Currently focused input window handle. private InputWindowHandle mFocusedInputWindowHandle; Loading Loading @@ -152,7 +153,7 @@ final class InputMonitor { mService = service; mDisplayContent = mService.mRoot.getDisplayContent(displayId); mDisplayId = displayId; mInputTransaction = mDisplayContent.getPendingTransaction(); mInputTransaction = mService.mTransactionFactory.make(); mHandler = AnimationThread.getHandler(); mUpdateInputForAllWindowsConsumer = new UpdateInputForAllWindowsConsumer(); } Loading Loading @@ -319,6 +320,14 @@ final class InputMonitor { } } void updateInputWindowsImmediately() { if (mUpdateInputWindowsPending) { mApplyImmediately = true; mUpdateInputWindows.run(); mApplyImmediately = false; } } /* Called when the current input focus changes. * Layer assignment is assumed to be complete by the time this is called. */ Loading Loading @@ -433,7 +442,12 @@ final class InputMonitor { wallpaperInputConsumer.show(mInputTransaction, 0); } if (mApplyImmediately) { mInputTransaction.apply(); } else { mDisplayContent.getPendingTransaction().merge(mInputTransaction); mDisplayContent.scheduleAnimation(); } Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +6 −4 Original line number Diff line number Diff line Loading @@ -7531,22 +7531,24 @@ public class WindowManagerService extends IWindowManager.Stub @Override public boolean injectInputAfterTransactionsApplied(InputEvent ev, int mode) { boolean shouldWaitForAnimComplete = false; boolean shouldWaitForAnimToComplete = false; if (ev instanceof KeyEvent) { KeyEvent keyEvent = (KeyEvent) ev; shouldWaitForAnimComplete = keyEvent.getSource() == InputDevice.SOURCE_MOUSE shouldWaitForAnimToComplete = keyEvent.getSource() == InputDevice.SOURCE_MOUSE || keyEvent.getAction() == KeyEvent.ACTION_DOWN; } else if (ev instanceof MotionEvent) { MotionEvent motionEvent = (MotionEvent) ev; shouldWaitForAnimComplete = motionEvent.getSource() == InputDevice.SOURCE_MOUSE shouldWaitForAnimToComplete = motionEvent.getSource() == InputDevice.SOURCE_MOUSE || motionEvent.getAction() == MotionEvent.ACTION_DOWN; } if (shouldWaitForAnimComplete) { if (shouldWaitForAnimToComplete) { waitForAnimationsToComplete(); synchronized (mGlobalLock) { mWindowPlacerLocked.performSurfacePlacementIfScheduled(); mRoot.forAllDisplays(displayContent -> displayContent.getInputMonitor().updateInputWindowsImmediately()); } new SurfaceControl.Transaction().syncInputWindows().apply(true); Loading