Fix not updating split bounds after devices unfolded
When the default display changed due to unfolded the device, the split root tasks might be changed to invisible before reporting display info changed to split component. This causing the split component didn't update split layout due to the divider bar is not "initialized" after released with stage roots changed to invisible. This makes sure to update split layout while the split is activated no matter the divider bar is initialized or not. Fix: 189726605 Test: atest WMShellUnitTests Test: check the split bounds updated properly after the device unfolded. Change-Id: I722b08116a97b8482ea6e25b60ffe71005076cd7
This commit is contained in:
@@ -172,13 +172,12 @@ public final class SplitLayout {
|
||||
affectsLayout = true;
|
||||
}
|
||||
|
||||
if (mInitialized && affectsLayout) {
|
||||
if (mInitialized) {
|
||||
release();
|
||||
init();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return affectsLayout;
|
||||
}
|
||||
|
||||
/** Updates recording bounds of divider window and both of the splits. */
|
||||
|
||||
@@ -602,7 +602,8 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
public void onDisplayAreaInfoChanged(DisplayAreaInfo displayAreaInfo) {
|
||||
mDisplayAreaInfo = displayAreaInfo;
|
||||
if (mSplitLayout != null
|
||||
&& mSplitLayout.updateConfiguration(mDisplayAreaInfo.configuration)) {
|
||||
&& mSplitLayout.updateConfiguration(mDisplayAreaInfo.configuration)
|
||||
&& mMainStage.isActive()) {
|
||||
onBoundsChanged(mSplitLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,6 @@ public class SplitLayoutTests extends ShellTestCase {
|
||||
@UiThreadTest
|
||||
public void testUpdateConfiguration() {
|
||||
final Configuration config = getConfiguration();
|
||||
mSplitLayout.init();
|
||||
|
||||
// Verify it returns true if new config won't affect split layout.
|
||||
assertThat(mSplitLayout.updateConfiguration(config)).isFalse();
|
||||
|
||||
Reference in New Issue
Block a user