Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af2f51f2 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent d55f80cc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment