Use the TaskFragment override screenLayout for fix rotation
Or the screenLayout that caulated from DisplayContent could be different from the actual screenLayout of the Activity after display rotated. Bug: 235917242 Test: atest AppConfigurationTests#testAppOrientationRequestConfigChanges Change-Id: I62c6c6b1ce5df69d2a26984f97330f60a35d87d7
This commit is contained in:
@@ -448,8 +448,14 @@ class WindowToken extends WindowContainer<WindowState> {
|
||||
if (mFixedRotationTransformState != null) {
|
||||
mFixedRotationTransformState.disassociate(this);
|
||||
}
|
||||
// TODO(b/233855302): Remove TaskFragment override if the DisplayContent uses the same
|
||||
// bounds for screenLayout calculation.
|
||||
final Configuration overrideConfig = new Configuration(config);
|
||||
overrideConfig.screenLayout = TaskFragment.computeScreenLayoutOverride(
|
||||
overrideConfig.screenLayout, overrideConfig.screenWidthDp,
|
||||
overrideConfig.screenHeightDp);
|
||||
mFixedRotationTransformState = new FixedRotationTransformState(info, displayFrames,
|
||||
new Configuration(config), mDisplayContent.getRotation());
|
||||
overrideConfig, mDisplayContent.getRotation());
|
||||
mFixedRotationTransformState.mAssociatedTokens.add(this);
|
||||
mDisplayContent.getDisplayPolicy().simulateLayoutDisplay(displayFrames);
|
||||
onFixedRotationStatePrepared();
|
||||
|
||||
Reference in New Issue
Block a user