CVE-2026-58986 AI-generated analysis
platform/frameworks/base, system_server media quality service (services/core/java/com/android/server/media/quality/MediaQualityService.java, IMediaQualityManager binder implementation)
Adds a global picture quality service permission check to MediaQualityService.notifyPictureProfileHandleSelection. On failure the method calls notifyOnPictureProfileError with ERROR_NO_PERMISSION and the caller's UID/PID and then returns. The fix also moves the database lookup and HAL notification under mPictureProfileLock.
Root cause
The binder method notifyPictureProfileHandleSelection(long handle, int userId) in MediaQualityService had no authorization check. It looked up the picture profile for the caller-supplied handle with mMqDatabaseUtils.getPictureProfile(handle) and, if one was found, passed the profile parameters to the vendor display HAL through mHalNotifier.notifyHalOnPictureProfileChange. Per the commit message, any unprivileged app could therefore change the device-global picture pipeline state. The method was also annotated @GuardedBy("mPictureProfileLock") but did not take that lock around the lookup and HAL notification.
How the fix works
- MediaQualityService.java:notifyPictureProfileHandleSelection (Android 16): at method entry it calls hasGlobalPictureQualityServicePermission(). If that returns false, it calls mMqManagerNotifier.notifyOnPictureProfileError(null, PictureProfile.ERROR_NO_PERMISSION, Binder.getCallingUid(), Binder.getCallingPid()), logs 'notifyPictureProfileHandleSelection: no permission' with Slog.e, and returns without touching the database or the HAL.
- MediaQualityService.java:notifyPictureProfileHandleSelection (Android 16): the existing mMqDatabaseUtils.getPictureProfile(handle) lookup and the mHalNotifier.notifyHalOnPictureProfileChange(handle, profile.getParameters()) call are now inside synchronized (mPictureProfileLock), which matches the method's @GuardedBy annotation.
- MediaQualityService.java:notifyPictureProfileHandleSelection (Android 17 variant ed7053111ca5): same logic, with three differences. It reads callingUid and callingPid once, calls hasGlobalPictureQualityServicePermission(callingUid, callingPid) with explicit arguments, and puts the DEBUG logging, getPictureProfile(handle, true), mPictureProfileForHal.add(handle) and the HAL notification inside the synchronized block.
Completeness
- The fix covers only the notifyPictureProfileHandleSelection entry point. The permission check runs before any state is read or the HAL is contacted, so a rejected call has no side effect other than the error notification and a log line.
- The fix relies on the existing hasGlobalPictureQualityServicePermission() helper. The diff does not show its implementation or which permission it enforces.
- This commit does not modify other IMediaQualityManager methods, for example getPictureProfileHandleValue, which the same MediaCodec caller also invokes. The material does not show whether those methods already have their own checks.
- The userId parameter is still unused in the patched method. No caller or user validation is added beyond the global permission check.
Behavior changes
- Callers without the global picture quality service permission no longer trigger a HAL picture profile change. Instead, notifyOnPictureProfileError is called with PictureProfile.ERROR_NO_PERMISSION and the caller's UID/PID, and an Slog.e line is written.
- The binder call still returns normally (it is a void method and throws no exception). Remote callers such as MediaCodec::updatePictureProfile will therefore see an OK status even when the request was rejected.
- The database lookup and HAL notification now run while holding mPictureProfileLock, so they are serialized with other lock-guarded picture profile operations.
Per major
- Android 14: Not affected per bulletin; code absent (MediaQualityService.java does not exist at android-security-14.0.0_r31).
- Android 15: Not affected per bulletin; code absent (MediaQualityService.java does not exist at android-security-15.0.0_r19).
- Android 16: Same fix: commit 4d9170e117b1 in android-security-16.0.0_r10 (cherry-pick of 78aaddbc99ca). Patched region fully present (5/5 lines).
- Android 17: Adapted fix: commit ed7053111ca5 in android-security-17.0.0_r3. Same permission check and lock, adapted to the Android 17 code, which uses hasGlobalPictureQualityServicePermission(callingUid, callingPid), getPictureProfile(handle, true), DEBUG logging and mPictureProfileForHal tracking. Patched region fully present (8/8 lines).
Unknowns
- The implementation of hasGlobalPictureQualityServicePermission() and the exact permission it enforces are not shown.
- It is not shown whether the error from notifyOnPictureProfileError reaches the rejected caller or only registered listeners.
- It is not shown whether sibling IMediaQualityManager methods already enforce the same permission.
- It is not shown whether the media_quality binder service is published when the IMediaQuality HAL is absent.
- The test referenced in the commit message ('atest') is not identified.