CVE-2026-49912 AI-generated analysis
platform/frameworks/base, SystemUI lockscreen smartspace (LockscreenSmartspaceController, BcSmartspaceDataPlugin)
LockscreenSmartspaceController now reads and observes the Settings.Secure.MEDIA_CONTROLS_LOCK_SCREEN setting and passes a null media SmartspaceTarget to lockscreen smartspace views when the setting is disabled, instead of forwarding the media target unconditionally.
Root cause
The lockscreen smartspace path did not take the user's MEDIA_CONTROLS_LOCK_SCREEN setting into account. On Android 17, the pre-fix LockscreenSmartspaceController.setMediaTarget stored the target and called it.setMediaTarget(target) on every SmartspaceView unconditionally. On Android 14 to 16, the controller had no media-target gating at all; the controller function is added by the fix. As a result, a media SmartspaceTarget (for example feature type 41 MEDIA_CURRENT_PLAYING with a title/artist header action, as in the test) could be passed to lock screen smartspace views even when the user had disabled MEDIA_CONTROLS_LOCK_SCREEN.
How the fix works
- packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt: adds new state: showMediaControls (default false), storedMediaTarget (the raw target as received) and mediaTarget (the filtered target).
- LockscreenSmartspaceController.kt, in the settings-reading routine (the one that already reads LOCK_SCREEN_SHOW_NOTIFICATIONS and LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS; function name not shown in the diff): reads secureSettings.getBoolForUser(MEDIA_CONTROLS_LOCK_SCREEN, true, userTracker.userId) into showMediaControls, then calls updateMediaTarget() before session?.requestSmartspaceUpdate(). This way a settings change re-filters the target that is already stored.
- LockscreenSmartspaceController.kt: registers settingsObserver on secureSettings.getUriFor(MEDIA_CONTROLS_LOCK_SCREEN) for UserHandle.USER_ALL, right after an existing settingsObserver registration. Android 14 to 16 use contentResolver.registerContentObserver; Android 17 uses secureSettings.registerContentObserverForUserAsync.
- LockscreenSmartspaceController.kt:setMediaTarget(target) now stores the target in storedMediaTarget and calls updateMediaTarget(). updateMediaTarget computes filteredTarget = if (showMediaControls) storedMediaTarget else null, assigns it to mediaTarget, and pushes it to every view via SmartspaceView.setMediaTarget(filteredTarget). On 14 to 16, setMediaTarget is a new public function. On 17, its previous unconditional body is replaced.
- LockscreenSmartspaceController.kt:stateChangeListener.onViewAttachedToWindow (14 to 16 diffs): newly attached views get (v as SmartspaceView).setMediaTarget(mediaTarget), which is the filtered value.
- packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java:SmartspaceView.setMediaTarget: the default implementation changes from throwing UnsupportedOperationException to a no-op. This is needed because the controller now calls setMediaTarget on all attached views. Only the 14 to 16 commits change this; the 17 diff does not touch this file.
- LockscreenSmartspaceControllerTest.kt: adds a setShowMediaControls helper, a fake URI for the setting, and two tests, mediaTargetChanges_settingsDisabled_mediaTargetIsNull and mediaSettingChanges_mediaTargetIsUpdated. Together they cover the setting being disabled at start, being turned off, and being turned back on.
Completeness
- On 14 to 16 the fix covers three delivery points in the controller: a new target arriving via setMediaTarget, a setting change through the settings observer, and a view attaching via onViewAttachedToWindow.
- The gate only applies to media targets routed through LockscreenSmartspaceController.setMediaTarget. Code that calls SmartspaceView.setMediaTarget directly on a view is not filtered. The material does not show who calls the controller's setMediaTarget (no caller found per index search), so it cannot confirm that every producer goes through it.
- The setting is read for userTracker.userId only. The existing managed-profile handling (showSensitiveContentForManagedUser) is not extended to media, and the target's own UserHandle is not compared with the user who owns the setting.
- While the setting is disabled, the raw target stays in storedMediaTarget. It is not shown, but it is also not dropped, so re-enabling the setting restores it (this is tested).
- If the setting is unset, the controller reads it as true (show).
Behavior changes
- When MEDIA_CONTROLS_LOCK_SCREEN is disabled for the current user, smartspace views receive setMediaTarget(null). Turning the setting back on re-pushes the stored target without waiting for a new one.
- The default BcSmartspaceDataPlugin.SmartspaceView.setMediaTarget no longer throws UnsupportedOperationException. Views that do not override it now silently ignore the call (14 to 16).
- LockscreenSmartspaceController registers one more settings observer (MEDIA_CONTROLS_LOCK_SCREEN, USER_ALL). On 14 to 16 it also exposes a new public setMediaTarget.
- The settings-reading routine now also runs updateMediaTarget, so every observed settings change re-pushes the media target to all views.
Per major
- Android 14: Same fix: commit 8dd2f9d4de64 in android-security-14.0.0_r29 (cherry-pick of 1c140dd857ff). It adds showMediaControls, storedMediaTarget and mediaTarget, the setting observer, the new setMediaTarget and updateMediaTarget, and the attach-time push, and makes the plugin default a no-op. The test is under packages/SystemUI/tests. 8/8 lines present at android-security-14.0.0_r31.
- Android 15: Same fix: commit d0fbd46bea7c in android-security-15.0.0_r17, with the same controller and plugin changes. The tests are under packages/SystemUI/tests. 8/8 lines present at android-security-15.0.0_r19.
- Android 16: Same fix: commit 2e7f56e02d86 in android-security-16.0.0_r8, with the same controller and plugin changes. The test is in packages/SystemUI/multivalentTests. 8/8 lines present at android-security-16.0.0_r10.
- Android 17: Adapted fix: commit dc8814dec422 in android-security-17.0.0_r1. setMediaTarget and a `var mediaTarget ... private set` already existed. The fix adds storedMediaTarget and replaces the unconditional body with updateMediaTarget. The observer is registered via secureSettings.registerContentObserverForUserAsync. BcSmartspaceDataPlugin.java is not modified on 17. The test uses org.mockito.kotlin.eq and org.mockito.Mockito.anyBoolean. 8/8 lines present at android-security-17.0.0_r3.
Unknowns
- Which component delivers the media SmartspaceTarget to the controller, and on 14 to 16 how media reached the views before the controller had setMediaTarget. No caller is shown in the material.
- Whether any code outside the controller calls SmartspaceView.setMediaTarget directly and so bypasses the new filter.
- Whether the 17 tree already pushes mediaTarget at view attach time (the 17 diff does not show the attach listener).
- The exact disclosure in the original report (the bulletin only gives High / ID).
- The name of the controller function that reads the settings.