CVE-2026-58886 AI-generated analysis
platform/frameworks/base, WindowManager (services/core/java/com/android/server/wm/InputMonitor.java)
Moves PiP input consumer activation in InputMonitor out of the per-window accept() loop into updateInputWindows(), keying it on the existence of a root pinned task so the consumer is shown even when the PiP window has no input channel.
Root cause
In InputMonitor.UpdateInputForAllWindowsConsumer, the PiP input consumer (INPUT_CONSUMER_PIP) was only configured and shown inside accept(WindowState w) when a window with w.inPinnedWindowingMode() was encountered during mDisplayContent.forAllWindows. Per the commit message, for a PiP window created with INPUT_FEATURE_NO_INPUT_CHANNEL, updateInputWindowsLw returns early and skips the activation logic. The Android 16/17 diff context shows a 'return;' right before the removed block, but its condition is not shown. For such a PiP window the PiP input consumer was not shown. Because PiP tasks are trusted overlays, touches could then pass through to underlying windows, defeating tapjacking protections such as BLOCK_UNTRUSTED_TOUCHES.
How the fix works
- InputMonitor.java:UpdateInputForAllWindowsConsumer: removes the mAddPipInputConsumerHandle field and its initialisation in updateInputWindows(). The per-window flag is no longer needed.
- InputMonitor.java:UpdateInputForAllWindowsConsumer.updateInputWindows(): after the recents consumer handling and before mDisplayContent.forAllWindows(...), looks up mDisplayContent.getDefaultTaskDisplayArea().getRootPinnedTask(). It checks that mPipInputConsumer != null, the root pinned task exists, the task has a SurfaceControl and its getDisplayArea() is non-null. If all hold, it calls mPipInputConsumer.mWindowHandle.replaceTouchableRegionWithCrop(rootPinnedTask.getSurfaceControl()), mPipInputConsumer.layout(mInputTransaction, rootPinnedTask.getBounds()), mPipInputConsumer.reparent(mInputTransaction, targetDA) and mPipInputConsumer.show(mInputTransaction, MAX_VALUE - 1). This is the same configuration the old code applied, but it now runs regardless of any individual window and of any early return in the per-window path.
- InputMonitor.java:UpdateInputForAllWindowsConsumer.accept(WindowState w): deletes the if (w.inPinnedWindowingMode()) { if (mAddPipInputConsumerHandle) { ... } } block, so activation no longer depends on reaching a pinned-mode window in the iteration.
Completeness
- Covers the reported case: a PiP task whose window has no input channel now still gets the PiP input consumer shown and cropped to the root pinned task surface, because activation is driven by task state rather than by window iteration.
- Only the root pinned task of mDisplayContent.getDefaultTaskDisplayArea() is consulted. The old code reacted to any pinned-mode window on the display (via w.getTask().getRootTask()), so with the new code a pinned task in a non-default TaskDisplayArea would not activate the consumer. The material does not show whether such a configuration exists in practice.
- Activation still requires an INPUT_CONSUMER_PIP consumer to be registered (mPipInputConsumer != null). Nothing in the fix creates one.
- The fix is confined to InputMonitor. Any early return for windows without an input channel is left as is. The wallpaper and recents consumer handling is untouched: recents was already handled outside the loop, and wallpaper stays inside accept().
Behavior changes
- The PiP input consumer is now shown whenever a root pinned task with a surface exists on the default TaskDisplayArea, even if no pinned-mode window has been iterated. Before the fix, it was shown only after a pinned window was seen.
- Consumer bounds and crop now come from the root pinned task (rootPinnedTask.getBounds()/getSurfaceControl()) instead of the root task of the first pinned window found.
- Field mAddPipInputConsumerHandle removed from UpdateInputForAllWindowsConsumer.
- The commit notes manual testing only (PiP menu) and changes only InputMonitor.java, so no automated test was added.
Per major
- Android 14: same fix: platform/frameworks/base 708ab226ee66 in android-security-14.0.0_r31, identical change to InputMonitor.java at slightly different line offsets.
- Android 15: same fix: platform/frameworks/base 8846cbbf3731 in android-security-15.0.0_r19 (the commit analysed here).
- Android 16: same fix: platform/frameworks/base d234f0f032d1 in android-security-16.0.0_r10, identical change; diff context shows the removed block sat directly after a 'return;' in accept().
- Android 17: same fix: platform/frameworks/base bcf19c956e5a in android-security-17.0.0_r3, identical change.
Unknowns
- The exact early-return condition that skips windows without an input channel is not in the provided code context. It is described only in the commit message, which attributes it to updateInputWindowsLw.
- Whether pinned tasks can exist in a non-default TaskDisplayArea on any supported configuration, which would be outside the new getDefaultTaskDisplayArea() lookup.
- No fork comparison was provided, so the state of downstream forks is unknown.