Merge "Fix leakage of input window handle on removed display"

This commit is contained in:
TreeHugger Robot
2019-03-12 05:10:58 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 0 deletions

View File

@@ -1452,6 +1452,11 @@ public class InputManagerService extends IInputManager.Stub
nativeSetFocusedDisplay(mPtr, displayId);
}
/** Clean up input window handles of the given display. */
public void onDisplayRemoved(int displayId) {
nativeSetInputWindows(mPtr, null /* windowHandles */, displayId);
}
@Override
public void requestPointerCapture(IBinder windowToken, boolean enabled) {
if (mFocusedWindow == null || mFocusedWindow.asBinder() != windowToken) {

View File

@@ -168,6 +168,7 @@ final class InputMonitor {
void onDisplayRemoved() {
mHandler.removeCallbacks(mUpdateInputWindows);
mService.mInputManager.onDisplayRemoved(mDisplayId);
mDisplayRemoved = true;
}