Don't override config of display contexts with activity display.
This change migrates the previous usages of ResourcesManager#getResources() from using the display id of expected resources to an override display ID which will override the display properties from the parent token resources. This ensures that all contexts derived from a display context keep the overrides for their intended display. This also changes the meaning of ResourcesKey#mOverrideConfiguration and ResourcesKey#mDisplayId. Previously mDisplayId was used as both the current display of the ResourcesKey and used to apply overrides to mOverrideConfiguration. This made it unclear whether a particular key should keep its display override when an activity changes display or whether it should inherit the new display from the activity. Now the display IDs and overrides are managed by the ActivityResources struct and the ResourcesKey is expected to only contain the final display ID expected for the resources in 'mDisplayId' and the final configuration that should be applied to the global configuration in 'mOverrideConfiguration'. Fixes: 153866583 Fixes: 156758475 Fixes: 163813210 Fixes: 163812902 Fixes: 163813227 Test: ActivityThreadTest Test: ResourcesManagerTest Test: AppConfigurationTests#testActivityContextDerivedDisplayContextOrientationWhenRotating Change-Id: If93f98f93ee15b27d8c7292a2f830c2cc0f49277
Loading
Please register or sign in to comment