Update the split layout while density changed
According to mDividerSnapAlgorithm, the density change results in the
position of the driver bar changed, but the split layout is changed
only in the legacy transition environment. This CL updates the split
layout when the display density changed.
Bug: 273430199
Test: atest SplitLayoutTests
atest StageCoordinatorTests
Change-Id: I767c499494c3498de36c007c7d3f1a0c275f776b
This commit is contained in:
@@ -717,6 +717,10 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
||||
return bounds.width() > bounds.height();
|
||||
}
|
||||
|
||||
public boolean isDensityChanged(int densityDpi) {
|
||||
return mDensity != densityDpi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if this layout is landscape.
|
||||
*/
|
||||
|
||||
@@ -2183,6 +2183,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
return;
|
||||
}
|
||||
mDisplayLayout.set(mDisplayController.getDisplayLayout(displayId));
|
||||
|
||||
if (mSplitLayout != null && mSplitLayout.isDensityChanged(newConfig.densityDpi)
|
||||
&& mMainStage.isActive()
|
||||
&& mSplitLayout.updateConfiguration(newConfig)
|
||||
&& ENABLE_SHELL_TRANSITIONS) {
|
||||
mSplitLayout.update(null /* t */);
|
||||
onLayoutSizeChanged(mSplitLayout);
|
||||
}
|
||||
}
|
||||
|
||||
void updateSurfaces(SurfaceControl.Transaction transaction) {
|
||||
|
||||
Reference in New Issue
Block a user