Force notify overlay paths on package replaced due to system update uninstall
Tracks system update downgrades through a new ACTION_PACKAGE_REMOVED broadcast extra and forces OMS to re-call into PMS with the target's overlay paths by updating the overlay settings state to STATE_SYSTEM_UPDATE_UNINSTALL. This allows overlays to be re-propagated to the newly enabled, previously system PackageSetting once onPackageReplaced is invoked, to bring its state up to the latest known by OMS. This also fixes a bug with Watchable tracking in PackageUserStateImpl, which was causing overlay path updates to not propagate to the snapshot. User states are shared between copied PackageSettings, which is probably worth fixing, but that means their parent Watchable references can be out of date if they reference the pre-copy PackageSetting. This attempts to fix that in 2 places, during commit and during copy, until a better solution can be designed. Bug: 197759786 Test: Install app update to a system app, then run adb shell pm uninstall-system-updates com.example.app, adb shell dumpsys package com.example.app | grep -A 5 "overlay paths:" Test: atest OverlayManagerServiceImplTests Change-Id: Ibccafcf7b3dc9b584f412a92a233048d2a8ae592
Loading
Please register or sign in to comment