Revert "Fix WM input limitations on secondary displays (2/N)"
This reverts commit b37e35e4a5576f89a39ff1f422b5c7f71ec3924d.
Reason for revert: null pointer dereference
Change-Id: I009aac84a5c3c4b40fab1c91519252a68272c103
diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java
index 823a0de..c4beb55 100644
--- a/services/core/java/com/android/server/wm/InputMonitor.java
+++ b/services/core/java/com/android/server/wm/InputMonitor.java
@@ -367,13 +367,6 @@
}
}
- void onRemoved() {
- // If DisplayContent removed, we need find a way to remove window handles of this display
- // from InputDispatcher, so pass an empty InputWindowHandles to remove them.
- mService.mInputManager.setInputWindows(mInputWindowHandles, mFocusedInputWindowHandle,
- mDisplayId);
- }
-
private final class UpdateInputForAllWindowsConsumer implements Consumer<WindowState> {
InputConsumerImpl navInputConsumer;
InputConsumerImpl pipInputConsumer;
@@ -406,7 +399,8 @@
this.inDrag = inDrag;
wallpaperController = mService.mRoot.mWallpaperController;
- mService.mRoot.getDisplayContent(mDisplayId).forAllWindows(this,
+ // TODO(b/112081256): Use independent InputMonitor for each display.
+ mService.mRoot/*.getDisplayContent(mDisplayId)*/.forAllWindows(this,
true /* traverseTopToBottom */);
if (mAddWallpaperInputConsumerHandle) {
// No visible wallpaper found, add the wallpaper input consumer at the end.
@@ -414,8 +408,8 @@
}
// Send windows to native code.
- mService.mInputManager.setInputWindows(mInputWindowHandles, mFocusedInputWindowHandle,
- mDisplayId);
+ // TODO: Update Input windows and focus by display?
+ mService.mInputManager.setInputWindows(mInputWindowHandles, mFocusedInputWindowHandle);
clearInputWindowHandlesLw();
@@ -435,8 +429,7 @@
final int flags = w.mAttrs.flags;
final int privateFlags = w.mAttrs.privateFlags;
final int type = w.mAttrs.type;
- // TODO(b/111361570): multi-display focus, one focus for all display in current.
- final boolean hasFocus = w == mService.mCurrentFocus;//mInputFocus;
+ final boolean hasFocus = w == mInputFocus;
final boolean isVisible = w.isVisibleLw();
if (mAddRecentsAnimationInputConsumerHandle) {