CVE-2023-40120 AI-generated analysis
platform/frameworks/base, SystemUI media controls (MediaDataManager)
SystemUI's MediaDataManager now treats blank (not only null) media titles as missing, falls through the existing fallbacks, and finally substitutes a new placeholder string "<app name> is running" when no title source is non-blank.
Root cause
In packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt, the song title was taken from MediaMetadata.METADATA_KEY_DISPLAY_TITLE, then METADATA_KEY_TITLE, then HybridGroupManager.resolveTitle(notif), but each fallback was gated on `song == null`. An app posting a media session whose title fields were empty strings or whitespace passed the null checks, so no fallback ran and the resulting MediaData.song was blank. There was also no final fallback when every source was absent, so the media control could be shown without a title identifying the app.
How the fix works
- packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt (MediaDataManager, title resolution): the two fallback conditions change from `song == null` to `song.isNullOrBlank()`. A blank METADATA_KEY_DISPLAY_TITLE now falls through to METADATA_KEY_TITLE, and a blank METADATA_KEY_TITLE falls through to HybridGroupManager.resolveTitle(notif).
- Same function: a third branch is added. If the title is still null or blank after all sources, `song = context.getString(R.string.controls_media_empty_title, app)` supplies a placeholder built from the app name.
- packages/SystemUI/res/values/strings.xml: new string resource controls_media_empty_title = "%1$s is running" (app_name placeholder, CHAR_LIMIT=NONE).
- packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt: adds tests for an empty title and a blank title (placeholder expected), and for empty metadata with a non-blank notification title (notification title expected). The APP_NAME constant changes to "com.android.systemui.tests" and a MediaData ArgumentCaptor is added.
Completeness
- Covers the title (song) field only. A null or blank value at each source moves on to the next one, and the placeholder is used when all three sources are null or blank.
- The artist field directly below (`metadata.getString(MediaMetadata.METADATA_KEY_ARTIST)`) is not changed by this commit. The diff shows its declaration but no blank handling for it.
- The placeholder depends on the `app` value being meaningful. The diff does not show how `app` is derived or whether it can itself be blank.
- Only the notification-driven media data path visible in the diff is changed. Other MediaData construction paths (e.g. resumption or smartspace) are not in the diff and their handling is unknown.
Behavior changes
- Media controls whose title sources are all empty or whitespace now display "<app name> is running" instead of a blank title.
- Empty-string metadata titles now fall back to the notification's content title, where previously the empty string was used as-is.
- New translatable string resource controls_media_empty_title added to SystemUI.
Per major
- Android 14: same fix: resolved via commit 070eff919c85 in android-security-14.0.0_r2 (the bulletin lists 14-next). At android-security-14.0.0_r29 the controls_media_empty_title string is present and 5/8 lines of the patched region are present. The Kotlin file is not at its original path at r29. Per index search, a MediaDataManager.kt exists under media/controls/domain/pipeline in android-14.0.0_r75, but the material does not show the fixed title chain there.
- Android 15: not affected per the bulletin; android-security-15.0.0_r17 has 5/8 lines of the patched region present. Whether the full fix is present is not shown.
- Android 16: not affected per the bulletin; android-security-16.0.0_r8 has 4/8 lines of the patched region present. Whether the full fix is present is not shown.
- Android 17: not affected per the bulletin; android-security-17.0.0_r1 has 4/8 lines of the patched region present. Whether the full fix is present is not shown.
Unknowns
- The material does not explain the bulletin's EoP classification. The concrete impact of a blank-title media control is not shown.
- How the `app` name is derived in this function, and whether it can be blank, is not shown in the diff.
- Whether Android 11 to 13 received the same or an adapted patch is not shown. The material only shows the Android 14 resolution.
- Whether the relocated MediaDataManager in later trees contains the full fixed title chain is not shown. Only partial line counts are available.