Handle application info change for system context
When handling application info changes, we update the application infos of all the tracked packages. However, we also have the system package, which is not directly tracked, and thus not updated in this case. The system context (corresponding to the system package) does not have a base resources path initially, and it won't have one set, as it is not updated with the new application info. However, while handling application info changes, we also update in-place all the tracked ResourceImpls (including the one from the system context) using the new application info. Thus, the system context has its resources updated, despite its package info being stale. From the system context is derived a system UI context, which has the same underlying info. When creating a new context from this system UI context, we try to initialize the resources based on the package info. As this info is stale, we only have the base system resources, but we are missing (along other state) the color overlays. This ensures that the package info of the system context is also updated when handling application info changes, so that any contexts created from this one would have the correct state. Flag: android.content.res.system_context_handle_app_info_changed Test: atest testHandleApplicationInfoChanged_systemContext Bug: 362420029 Change-Id: I027ce41419944e2af3c66cb753e7a0f97c8f57f3
Loading
Please register or sign in to comment