CVE-2026-28645 AI-generated analysis
platform/frameworks/base, services/usb (UsbService, lockdown-mode USB data signal control)
UsbService.StrongAuthTracker.onStrongAuthRequiredChanged now re-enables USB data on all ports only when the strong-auth change belongs to the main user (UserManagerInternal.getMainUserId()). Disabling USB data on lockdown still applies for any user.
Root cause
In services/usb/java/com/android/server/usb/UsbService.java, StrongAuthTracker keeps one tracker-wide boolean, mLockdownModeStatus. onStrongAuthRequiredChanged(int userId) computed lockDownTriggeredByUser from getStrongAuthForUser(userId). Whenever the lockdown status changed, it iterated mPortManager.getPorts() and called enableUsbData(port.getId(), !lockDownTriggeredByUser, STRONG_AUTH_OPERATION_ID, ...). The userId was never compared against the main user. The fix comment states that entering guest mode or switching to a non-main user from the lockscreen may not require auth. A strong-auth callback for such a user without STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN could therefore flip the global status back and re-enable USB data even though the device had been placed in lockdown.
How the fix works
- UsbService.java: the StrongAuthTracker constructor now fetches UserManagerInternal via LocalServices.getService(UserManagerInternal.class) and stores it in mUserManagerInternal. On 15 the commit adds the imports com.android.server.LocalServices, com.android.server.pm.UserManagerInternal and android.annotation.SuppressLint.
- UsbService.java: StrongAuthTracker.onStrongAuthRequiredChanged wraps the port loop in `if (lockDownTriggeredByUser || mUserManagerInternal.getMainUserId() == userId)`. Disabling (lockDownTriggeredByUser == true) still happens for any user. Enabling (lockDownTriggeredByUser == false) happens only when userId is the main user. The early return on unchanged status and the assignment mLockdownModeStatus = lockDownTriggeredByUser are kept before the new condition.
- UsbService.java: StrongAuthTracker changed from private to package-visible with @VisibleForTesting, and @SuppressLint("AndroidFrameworkRequiresPermission") is added on the override.
- tests/UsbTests/src/com/android/server/usb/UsbServiceTest.java: setUp registers a mock UserManagerInternal in LocalServices and mocks Context.getResources(). Three new tests cover: lockdown disabling USB for user 10; clearing lockdown re-enabling USB for the main user; and clearing lockdown for a non-main user producing no UsbPortManager interaction.
Completeness
- Covers the re-enable path in StrongAuthTracker.onStrongAuthRequiredChanged for all ports returned by mPortManager.getPorts().
- Does not make lockdown state per-user: mLockdownModeStatus is still a single boolean and is still assigned before the new condition. A non-main-user callback with lockdown cleared therefore sets mLockdownModeStatus = false without enabling USB. If the elided early-return check compares against mLockdownModeStatus (as its comment suggests), a later main-user callback with the same cleared value would return early and not re-enable USB. That outcome fails closed, not open.
- The commit's own comment marks this as a temporary solution (TODO b/500854486). This change does not remove user switching from the lockscreen under lockdown, and secondary users do not get USB data re-enabled through this path at all.
- This commit does not change other callers of enableUsbData / enableUsbDataInternal, and the material does not show them.
Behavior changes
- After lockdown is cleared, this callback re-enables USB data only for the main user. Guest and secondary users no longer trigger re-enabling, which the code comment explicitly accepts as temporary.
- Entering lockdown still disables USB data on all ports regardless of which user triggered it.
- StrongAuthTracker now depends on UserManagerInternal being registered in LocalServices at construction time.
- StrongAuthTracker visibility changed from private to package-private (@VisibleForTesting).
Per major
- Android 14: Not listed as affected by the bulletin. The per-major facts nevertheless report 8/8 lines of the patched region present at android-security-14.0.0_r31. The material does not show a 14 commit, so how those lines got there is unknown.
- Android 15: Same fix: fc3f36a616a3 in android-security-15.0.0_r17 (cherry-pick of d1d84790170ed14a43e94916b2a72705a28ed120). Uses enableUsbData(port.getId(), !lockDownTriggeredByUser, STRONG_AUTH_OPERATION_ID, new IUsbOperationInternal.Default()). Present at android-security-15.0.0_r19 (8/8 lines).
- Android 16: Adapted fix: cabd39ad7bd1 in android-security-16.0.0_r8. Same condition, but the loop calls enableUsbDataInternal(..., STRONG_AUTH_OPERATION_ID, sDefaultOperation, OS_USB_DISABLE_REASON_LOCKDOWN_MODE, true). The commit also introduces the static sDefaultOperation. The LocalServices import already existed. Present at android-security-16.0.0_r10 (8/8 lines).
- Android 17: Adapted fix: 7a1a896e52d3 in android-security-17.0.0_r3. Same condition; the loop calls enableUsbDataInternal(..., sDefaultOperation, USB_DISABLE_REASON_LOCKDOWN_MODE, true). sDefaultOperation already existed. The commit does not add a SuppressLint import, although it uses @SuppressLint. Present at android-security-17.0.0_r3 (8/8 lines).
Unknowns
- Whether StrongAuthTracker registration in UsbService is gated by the USB data signal staking flag in production builds (only the test flag setup is shown).
- Why the patched region is reported present on android-security-14.0.0_r31 when the bulletin does not list Android 14; no 14 commit is in the material.
- The exact early-return condition in onStrongAuthRequiredChanged (elided in the diff context).
- Whether UserManagerInternal.getMainUserId() can return USER_NULL on some configurations (e.g. no main user). In that case the re-enable path would never run; the material does not show this.