Android security tags, read closely by Lightrion

CVE-2024-0041 AI-generated analysis

platform/frameworks/base, SystemUI status bar events (SystemStatusAnimationSchedulerImpl, privacy/persistent dot)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (6 corrections). Verify against the commit before relying on it.

Rewrites SystemStatusAnimationSchedulerImpl.removePersistentDot() so that, when the status chip is ANIMATING_OUT, the hide-dot listeners are notified immediately. Before, the notification came from a coroutine that waited for a state change under a DISAPPEAR_ANIMATION_DURATION timeout, and it was silently dropped when the animator callback arrived late.

Root cause

In packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImpl.kt, removePersistentDot() handled the ANIMATING_OUT state by launching a coroutine on coroutineScope. That coroutine ran withTimeout(DISAPPEAR_ANIMATION_DURATION) { animationState.first { SHOWING_PERSISTENT_DOT || IDLE || ANIMATION_QUEUED }; notifyHidePersistentDot() }. The state transition it waited for is driven by the animator's onAnimationEnd callback. If that callback arrived more than DISAPPEAR_ANIMATION_DURATION after the removal request, the timeout expired and notifyHidePersistentDot() was never called. Listeners were then never told to hide the dot, so the persistent dot was not removed even though hasPersistentDot had been set to false. The new test testDotIsRemoved_evenIfAnimatorCallbackIsDelayed reproduces this case: it advances the test scheduler past DISAPPEAR_ANIMATION_DURATION before the animator fires, which the test comment says caused the old code to miss the callback. In addition, notifyHidePersistentDot() itself changed animationState (to ANIMATION_QUEUED or IDLE) when the state was SHOWING_PERSISTENT_DOT.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to February 2024 · Findings