Android security tags, read closely by Lightrion

CVE-2024-31326 AI-generated analysis

platform/frameworks/base, services/devicepolicy (DevicePolicyManagerService, Owners, OwnersData)

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 (9 corrections). Verify against the commit before relying on it.

Adds a one-time, persisted "post upgrade" migration step in DevicePolicyManagerService that pushes screen-capture-disabled, lock task, and legacy user restriction policies held by device/profile owner ActiveAdmins into the DevicePolicyEngine, because the initial Android T to U migration did not carry them over correctly.

Root cause

On upgrade from Android T to Android U, migratePoliciesToDevicePolicyEngine() in DevicePolicyManagerService.java migrated legacy ActiveAdmin state into the DevicePolicyEngine, but three policy groups were not migrated properly: (1) migrateScreenCapturePolicyLocked() returned early when mPolicyCache.getScreenCaptureDisallowedUser() == UserHandle.USER_NULL, skipping the DO / org-owned-PO parent disableScreenCapture flag in that case; (2) lock task packages/features (DevicePolicyData.mLockTaskPackages / mLockTaskFeatures) had no migration; (3) user restrictions stored in ActiveAdmin.ensureUserRestrictions() (own and parent admin) had no migration, so per the second commit message they could not be queried after the OTA (its test notes that DISALLOW_FACTORY_RESET set by a device owner stopped applying). The initial migration is gated by shouldMigrateToDevicePolicyEngine(), which includes !mOwners.isMigratedToPolicyEngine(), so an already-migrated device would not re-run it to repair the gap.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to June 2024 · Findings