CVE-2026-58955 AI-generated analysis
platform/frameworks/base, NotificationManagerService / PreferencesHelper (notification channel preferences)
PreferencesHelper.updateNotificationChannel now copies the isImportanceLockedByCriticalDeviceFunction and isBlockable attributes from the existing channel onto the replacement channel object, so a locked channel keeps its lock state after an update.
Root cause
In services/core/java/com/android/server/notification/PreferencesHelper.java, updateNotificationChannel() replaces the stored NotificationChannel with the caller-supplied updatedChannel object (r.channels.put(updatedChannel.getId(), updatedChannel)). Before the fix, when the existing channel had isImportanceLockedByCriticalDeviceFunction() true and was neither blockable nor at IMPORTANCE_NONE, only the importance value was copied onto updatedChannel. The lock flag and the blockable flag were never copied. As a result, the stored channel could come out of the update with these flags at the defaults of the supplied object (per the new test comment, a newly constructed channel has blockable/locked set to false).
How the fix works
- PreferencesHelper.java:updateNotificationChannel: the single condition 'channel.isImportanceLockedByCriticalDeviceFunction() && !(channel.isBlockable() || channel.getImportance() == IMPORTANCE_NONE)' is split, with an outer check on channel.isImportanceLockedByCriticalDeviceFunction().
- Inside the outer block, updatedChannel.setImportanceLockedByCriticalDeviceFunction(true) is called unconditionally, so the replacement object keeps the lock.
- The original importance-preservation rule stays as the inner condition: if the existing channel is not blockable and its importance is not IMPORTANCE_NONE, updatedChannel.setImportance(channel.getImportance()) overrides the requested importance.
- updatedChannel.setBlockable(channel.isBlockable()) copies the blockable flag from the existing channel, so that flag also survives the replacement.
- PreferencesHelperTest.java: one existing test's expected importance, checked after an updateNotificationChannel call from SYSTEM_UID, changes from IMPORTANCE_LOW to IMPORTANCE_HIGH. Three new tests cover these cases: locked and non-blockable (importance kept, flags kept); locked and blockable (importance changes, flags kept); locked and non-blockable with existing IMPORTANCE_NONE (importance changes, flags kept).
Completeness
- Covers only the updateNotificationChannel() path in PreferencesHelper, which is the only production code touched.
- Only the two flags named in the commit (lock flag and blockable) plus importance are inherited. As before, the replacement still overwrites any other attribute of the stored channel that is missing from the caller-supplied object.
- When the existing channel is blockable, or its stored importance is IMPORTANCE_NONE, the requested importance is still accepted (by design, per the new tests). In those cases only the flags are preserved.
- The material does not show whether other code paths that replace or mutate an existing channel object (for example channel creation for an id that already exists, or restore/XML paths) handle the lock flag.
Behavior changes
- After an update of a channel locked by a critical device function, the stored channel stays locked and keeps its blockable value.
- No new exceptions or error codes: the update silently keeps the protected values.
- Logging and metrics code in the same method is unchanged. Because updatedChannel now carries the inherited flags, the !channel.equals(updatedChannel) comparison may give a different result for updates that differed only in those flags.
Per major
- Android 14: same fix: commit 6af82997fd78 in android-security-14.0.0_r31, with an identical hunk in PreferencesHelper.updateNotificationChannel (around line 1124) and identical test changes.
- Android 15: same fix: commit ec26050f7f04 in android-security-15.0.0_r19 (the analysed commit), hunk around line 1194.
- Android 16: same fix: commit 9e7353b7d788 in android-security-16.0.0_r10, identical hunk around line 1322.
- Android 17: same fix: commit d01eb65a9c33 in android-security-17.0.0_r3, identical hunk around line 1301.
Unknowns
- Which entry point the reporter used (an app-facing API or system UI/Settings). The material only shows the PreferencesHelper layer.
- The exact trigger sequence. It is not shown whether one update or a series of updates is needed to lose the protected importance, because the setup of the modified pre-existing test is not in the diff.
- Whether the 'updateDefaultApps' default-app set reflects the same critical-function roles on all affected branches.
- Whether other channel-mutation paths in PreferencesHelper (creating a channel with an existing id, XML restore) preserve the lock flag. They are not in the material.