CVE-2026-58979 AI-generated analysis
platform/frameworks/base, WindowManager (services/core/java/com/android/server/wm/PresentationController.java)
PresentationController now requires the presentation's host task to be the globally focused task on every display that can host tasks (Display.canHostTasks()), instead of only on TYPE_INTERNAL displays, so unfocused apps can no longer add presentation windows to task-hosting external displays.
Root cause
In PresentationController.java, the check that decides whether a presentation may be shown computed isHostGloballyFocused (hostTask != null and hostTask == mRoot.getTopDisplayFocusedLeafTask()). It only enforced that value when displayContent.getDisplay().getType() == TYPE_INTERNAL and returned true for any other display. External displays host tasks by default and offer app-launch and interaction capabilities similar to the internal display. As a result, an untrusted app whose host task was not globally focused could add a presentation on such a display without any user warning (commit message: "external displays can be hijacked without any warnings").
How the fix works
- services/core/java/com/android/server/wm/PresentationController.java, in the presentation-allowed check that contains isHostGloballyFocused: the TYPE_INTERNAL import and the `if (!isHostGloballyFocused && type == TYPE_INTERNAL) return false;` branch are removed.
- In the same method, a new local `canDisplayHostTasks = displayContent.getDisplay().canHostTasks()` is computed, and the method now returns `isHostGloballyFocused || !canDisplayHostTasks`. A presentation is allowed only if its host task is the globally focused leaf task, or if the target display cannot host tasks.
- services/tests/wmtests/src/com/android/server/wm/PresentationControllerTests.java: a new testPresentationCannotLaunchWithUnfocusedHostTaskOnDifferentDisplay asserts failure on a display where canHostTasks() is true. The former can-launch test becomes testPresentationCanLaunchWithUnfocusedHostTaskOnDifferentDisplayNotHostingTasks, which mocks canHostTasks() to false and asserts success. An existing test now creates a globally focused host task on the default display before adding its presentation. Binder.getCallingUid() is replaced by Process.myUid() throughout, and createTaskInRootTask now receives UserHandle.getUserId(uid).
- The commit lists three Cherrypick-From references (3b4aad43, e3f24f4e, ec88ac8e). It has Merged-In/Change-Id I180cf2cc28f8f2e0b39e62fc6d02ebaadd042f89 and Flag: EXEMPT CVE_FIX.
Completeness
- Covers: new presentation requests on any display for which Display.canHostTasks() is true. The internal-display focus requirement appears to be kept, because testPresentationCannotLaunchOnInternalDisplayWithoutHostHavingGlobalFocus is unchanged. However, the diff does not directly show that internal displays report canHostTasks() == true.
- isHostGloballyFocused is false when hostTask is null, so a request with no host task would be rejected on task-hosting displays if it reaches this check. The material does not show whether it does.
- Leaves out (stated in the commit message): an existing presentation is not removed when a display later changes to host tasks, so it can continue to occlude activities on that display.
- Leaves out: displays with canHostTasks() == false keep the old permissive behavior (no focus requirement). The diff does not show whether private presentations (TYPE_PRIVATE_PRESENTATION) reach this check, because the earlier part of the method is not included.
Behavior changes
- Presentation requests whose host task is not the globally focused leaf task are rejected on every display that can host tasks, not only on internal displays. The commit message notes this may affect apps that assume they can launch presentations on external displays at any time.
- Presentations on displays that cannot host tasks are unaffected and are still allowed with an unfocused host task.
Per major
- Android 14: code absent: PresentationController.java and its tests do not exist at android-security-14.0.0_r31; not affected per the bulletin.
- Android 15: code absent: PresentationController.java and its tests do not exist at android-security-15.0.0_r19; not affected per the bulletin.
- Android 16: not affected per the bulletin. At android-security-16.0.0_r10, 5/8 lines of the patched region are present. The material does not show whether that branch has the old or the new check.
- Android 17: same fix: commit ca5297bdc957 in android-security-17.0.0_r3 (7/8 lines of the patched region present).
Unknowns
- The name of the patched method in PresentationController.java is not shown in the diff hunk headers.
- The code before the patched lines is not included in the material. This covers how hostTask is resolved, whether a null host task reaches the check, and how private presentations and same-display host tasks are handled.
- Whether internal displays report canHostTasks() == true is not shown directly.
- The material does not explain why Android 16 is not listed as affected, or what state its check is in.