Avoid token resource from being affected by derived resource
For example:
ActivityResources
ActivityResource[0] by real activity
ActivityResource[1] by Activity#createConfigurationContext
If the ResourcesKey for [0] and [1] use the same token identity for
creating the ResourcesKey, when updateResourcesForActivity iterates
ActivityResources to update:
The first update for [0] is no problem.
But when updating [1], the key finds the ResourcesImpl instance
for [0]. And [1]'s override configuration applies to [0], which
causes the problem.
By using token identity only for base resource (for token itself),
the derived resource can have its own ResourcesImpl, which avoids
affecting the base resource.
Bug: 413273054
Flag: android.content.res.ignore_non_public_config_diff_for_resources_key
Test: atest FrameworksCoreTests:ResourcesManagerTest# \
testUpdateActivityResourcesOverrideWindowConfiguration
Change-Id: I1ac1b94b540deb2de69dcec5781fd29d51103ed7
Loading
Please register or sign in to comment