CVE-2026-58944 AI-generated analysis
platform/frameworks/base, WindowManager / ActivityTaskManagerService (services/core/java/com/android/server/wm)
In ActivityTaskManagerService's move-task-to-front path, the fix iterates every ActivityRecord in the target Task and calls SafeActivityOptions.getOptions(r) for each so that the caller's display permissions for the supplied ActivityOptions are verified against all activities in the task (throwing SecurityException on failure, per the commit message) before the task is moved.
Root cause
In services/core/java/com/android/server/wm/ActivityTaskManagerService.java, the method that calls mTaskSupervisor.findTaskToMoveToFront(task, flags, realOptions, "moveTaskToFront", ...) converted the caller-supplied SafeActivityOptions into ActivityOptions with only options.getOptions(mTaskSupervisor). Per the commit message, this did not verify the caller's display permissions for the options against the activities contained in the Task. The exact checks performed by getOptions(ActivityRecord) versus getOptions(ActivityTaskSupervisor) are not shown in the material.
How the fix works
- ActivityTaskManagerService.java, move-task-to-front method (identified by the "moveTaskToFront" reason string passed to mTaskSupervisor.findTaskToMoveToFront): the ternary 'realOptions = options != null ? options.getOptions(mTaskSupervisor) : null' is replaced by an explicit null check block.
- Inside that block, before computing realOptions, the fix calls task.forAllActivities((r) -> { options.getOptions(r); }); the return value is discarded and the call is made only for its permission-check side effect on each ActivityRecord in the task. Per the commit message, any failure throws a SecurityException, which happens before findTaskToMoveToFront is reached.
- Only after all activities pass is realOptions = options.getOptions(mTaskSupervisor) computed and passed to findTaskToMoveToFront as before. The null-options path is unchanged (realOptions stays null).
- Single-file, single-commit fix (9 insertions, 3 deletions); the commit message references ActivityTaskManagerServiceTests but no test diff is included in the material.
Completeness
- Covers: the move-task-to-front call site in ActivityTaskManagerService when a non-null SafeActivityOptions is supplied; every activity currently in the Task (via task.forAllActivities) is checked, not just the top one.
- Leaves out: the check is only added at this one call site; other methods that convert SafeActivityOptions with getOptions(mTaskSupervisor) for an existing task are not touched by this diff and are not shown in the material, so their status is unknown.
- The check is performed on the activities present in the task at the time of the call; the diff does not add any later re-validation.
Behavior changes
- Move-task-to-front requests carrying ActivityOptions now run a per-activity check and can fail with a SecurityException (per the commit message) when any activity in the target task fails the display permission check for the caller.
- Additional per-activity work (one getOptions(r) call per ActivityRecord in the task) on every move-to-front call that supplies options.
- No change when options is null.
Per major
- Android 14: same fix: platform/frameworks/base 25931d579306 in android-security-14.0.0_r31, identical hunk at line 2268 of ActivityTaskManagerService.java.
- Android 15: same fix: platform/frameworks/base c4e0cdfe07eb in android-security-15.0.0_r19, hunk at line 2283.
- Android 16: same fix: platform/frameworks/base d24c107b928d in android-security-16.0.0_r10, identical hunk at line 2343.
- Android 17: same fix: platform/frameworks/base 4c71997176db in android-security-17.0.0_r3, identical hunk at line 2482.
Unknowns
- The implementation of SafeActivityOptions.getOptions(ActivityRecord) and which option fields (e.g. display-related) it validates is not included in the material; the per-activity check semantics are known only from the commit message.
- The enclosing method name is inferred from the "moveTaskToFront" reason string; the provided code context (lines 1331-1390, startNextMatchingActivity) does not cover the patched region.
- Whether SafeActivityOptions are aborted or cleaned up when the new loop throws (the finally block body is not shown).
- The referenced ActivityTaskManagerServiceTests changes are not shown.
- Whether other SafeActivityOptions consumers in ActivityTaskManagerService have the same gap is not shown.