Loading services/core/java/com/android/server/input/InputManagerService.java +3 −4 Original line number Diff line number Diff line Loading @@ -212,8 +212,7 @@ public class InputManagerService extends IInputManager.Stub int injectorPid, int injectorUid, int syncMode, int timeoutMillis, int policyFlags); private static native void nativeToggleCapsLock(long ptr, int deviceId); private static native void nativeSetInputWindows(long ptr, InputWindowHandle[] windowHandles, int displayId); private static native void nativeSetInputWindows(long ptr, InputWindowHandle[] windowHandles); private static native void nativeSetInputDispatchMode(long ptr, boolean enabled, boolean frozen); private static native void nativeSetSystemUiVisibility(long ptr, int visibility); private static native void nativeSetFocusedApplication(long ptr, Loading Loading @@ -1468,7 +1467,7 @@ public class InputManagerService extends IInputManager.Stub } public void setInputWindows(InputWindowHandle[] windowHandles, InputWindowHandle focusedWindowHandle, int displayId) { InputWindowHandle focusedWindowHandle) { final IWindow newFocusedWindow = focusedWindowHandle != null ? focusedWindowHandle.clientWindow : null; if (mFocusedWindow != newFocusedWindow) { Loading @@ -1477,7 +1476,7 @@ public class InputManagerService extends IInputManager.Stub setPointerCapture(false); } } nativeSetInputWindows(mPtr, windowHandles, displayId); nativeSetInputWindows(mPtr, windowHandles); } public void setFocusedApplication(InputApplicationHandle application) { Loading services/core/java/com/android/server/wm/DisplayContent.java +3 −2 Original line number Diff line number Diff line Loading @@ -814,7 +814,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // {@link DisplayContent} ready for use. mDisplayReady = true; mInputMonitor = new InputMonitor(service, mDisplayId); // TODO(b/112081256): Use independent InputMonitor. mInputMonitor = isDefaultDisplay ? new InputMonitor(service, mDisplayId) : mService.getDefaultDisplayContentLocked().mInputMonitor; } boolean isReady() { Loading Loading @@ -2134,7 +2136,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mRemovingDisplay = false; } mInputMonitor.onRemoved(); mService.onDisplayRemoved(mDisplayId); } Loading services/core/java/com/android/server/wm/InputConsumerImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.os.IBinder; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.view.Display; import android.view.InputChannel; import android.view.WindowManager; import com.android.server.input.InputApplicationHandle; Loading services/core/java/com/android/server/wm/InputMonitor.java +5 −12 Original line number Diff line number Diff line Loading @@ -367,13 +367,6 @@ final class InputMonitor { } } 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; Loading Loading @@ -406,7 +399,8 @@ final class InputMonitor { 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. Loading @@ -414,8 +408,8 @@ final class InputMonitor { } // 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(); Loading @@ -435,8 +429,7 @@ final class InputMonitor { 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) { Loading services/core/java/com/android/server/wm/WindowManagerService.java +14 −9 Original line number Diff line number Diff line Loading @@ -6071,21 +6071,26 @@ public class WindowManagerService extends IWindowManager.Stub @Override public void createInputConsumer(IBinder token, String name, InputChannel inputChannel) { synchronized (mWindowMap) { // TODO(b/112049699): multi-display inputConsumer, just support default in current. // Need consider about the behavior from controller. DisplayContent displayContent = getDefaultDisplayContentLocked(); displayContent.getInputMonitor().createInputConsumer(token, name, inputChannel, // TODO(b/112049699): Fix this for multiple displays. There is only one inputChannel // here to accept the return value. DisplayContent display = mRoot.getDisplayContent(Display.DEFAULT_DISPLAY); if (display != null) { display.getInputMonitor().createInputConsumer(token, name, inputChannel, Binder.getCallingPid(), Binder.getCallingUserHandle()); } } } @Override public boolean destroyInputConsumer(String name) { synchronized (mWindowMap) { // TODO(b/112049699): multi-display inputConsumer, just support default in current. // Need consider about the behavior from controller. DisplayContent displayContent = getDefaultDisplayContentLocked(); return displayContent.getInputMonitor().destroyInputConsumer(name); // TODO(b/112049699): Fix this for multiple displays. For consistency with // createInputConsumer above. DisplayContent display = mRoot.getDisplayContent(Display.DEFAULT_DISPLAY); if (display != null) { return display.getInputMonitor().destroyInputConsumer(name); } return false; } } Loading Loading
services/core/java/com/android/server/input/InputManagerService.java +3 −4 Original line number Diff line number Diff line Loading @@ -212,8 +212,7 @@ public class InputManagerService extends IInputManager.Stub int injectorPid, int injectorUid, int syncMode, int timeoutMillis, int policyFlags); private static native void nativeToggleCapsLock(long ptr, int deviceId); private static native void nativeSetInputWindows(long ptr, InputWindowHandle[] windowHandles, int displayId); private static native void nativeSetInputWindows(long ptr, InputWindowHandle[] windowHandles); private static native void nativeSetInputDispatchMode(long ptr, boolean enabled, boolean frozen); private static native void nativeSetSystemUiVisibility(long ptr, int visibility); private static native void nativeSetFocusedApplication(long ptr, Loading Loading @@ -1468,7 +1467,7 @@ public class InputManagerService extends IInputManager.Stub } public void setInputWindows(InputWindowHandle[] windowHandles, InputWindowHandle focusedWindowHandle, int displayId) { InputWindowHandle focusedWindowHandle) { final IWindow newFocusedWindow = focusedWindowHandle != null ? focusedWindowHandle.clientWindow : null; if (mFocusedWindow != newFocusedWindow) { Loading @@ -1477,7 +1476,7 @@ public class InputManagerService extends IInputManager.Stub setPointerCapture(false); } } nativeSetInputWindows(mPtr, windowHandles, displayId); nativeSetInputWindows(mPtr, windowHandles); } public void setFocusedApplication(InputApplicationHandle application) { Loading
services/core/java/com/android/server/wm/DisplayContent.java +3 −2 Original line number Diff line number Diff line Loading @@ -814,7 +814,9 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // {@link DisplayContent} ready for use. mDisplayReady = true; mInputMonitor = new InputMonitor(service, mDisplayId); // TODO(b/112081256): Use independent InputMonitor. mInputMonitor = isDefaultDisplay ? new InputMonitor(service, mDisplayId) : mService.getDefaultDisplayContentLocked().mInputMonitor; } boolean isReady() { Loading Loading @@ -2134,7 +2136,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mRemovingDisplay = false; } mInputMonitor.onRemoved(); mService.onDisplayRemoved(mDisplayId); } Loading
services/core/java/com/android/server/wm/InputConsumerImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.os.IBinder; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.view.Display; import android.view.InputChannel; import android.view.WindowManager; import com.android.server.input.InputApplicationHandle; Loading
services/core/java/com/android/server/wm/InputMonitor.java +5 −12 Original line number Diff line number Diff line Loading @@ -367,13 +367,6 @@ final class InputMonitor { } } 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; Loading Loading @@ -406,7 +399,8 @@ final class InputMonitor { 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. Loading @@ -414,8 +408,8 @@ final class InputMonitor { } // 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(); Loading @@ -435,8 +429,7 @@ final class InputMonitor { 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) { Loading
services/core/java/com/android/server/wm/WindowManagerService.java +14 −9 Original line number Diff line number Diff line Loading @@ -6071,21 +6071,26 @@ public class WindowManagerService extends IWindowManager.Stub @Override public void createInputConsumer(IBinder token, String name, InputChannel inputChannel) { synchronized (mWindowMap) { // TODO(b/112049699): multi-display inputConsumer, just support default in current. // Need consider about the behavior from controller. DisplayContent displayContent = getDefaultDisplayContentLocked(); displayContent.getInputMonitor().createInputConsumer(token, name, inputChannel, // TODO(b/112049699): Fix this for multiple displays. There is only one inputChannel // here to accept the return value. DisplayContent display = mRoot.getDisplayContent(Display.DEFAULT_DISPLAY); if (display != null) { display.getInputMonitor().createInputConsumer(token, name, inputChannel, Binder.getCallingPid(), Binder.getCallingUserHandle()); } } } @Override public boolean destroyInputConsumer(String name) { synchronized (mWindowMap) { // TODO(b/112049699): multi-display inputConsumer, just support default in current. // Need consider about the behavior from controller. DisplayContent displayContent = getDefaultDisplayContentLocked(); return displayContent.getInputMonitor().destroyInputConsumer(name); // TODO(b/112049699): Fix this for multiple displays. For consistency with // createInputConsumer above. DisplayContent display = mRoot.getDisplayContent(Display.DEFAULT_DISPLAY); if (display != null) { return display.getInputMonitor().destroyInputConsumer(name); } return false; } } Loading