Merge "Fix max bounds doesn't get updated on dual TDA build"
This commit is contained in:
committed by
Android (Google) Code Review
commit
9c593afe73
@@ -182,6 +182,11 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
|
||||
// writing to proto (which has significant cost if we write a lot of empty configurations).
|
||||
mHasOverrideConfiguration = !Configuration.EMPTY.equals(overrideConfiguration);
|
||||
mRequestedOverrideConfiguration.setTo(overrideConfiguration);
|
||||
final Rect newBounds = mRequestedOverrideConfiguration.windowConfiguration.getBounds();
|
||||
if (mHasOverrideConfiguration && providesMaxBounds()
|
||||
&& diffRequestedOverrideMaxBounds(newBounds) != BOUNDS_CHANGE_NONE) {
|
||||
mRequestedOverrideConfiguration.windowConfiguration.setMaxBounds(newBounds);
|
||||
}
|
||||
// Update full configuration of this container and all its children.
|
||||
final ConfigurationContainer parent = getParent();
|
||||
onConfigurationChanged(parent != null ? parent.getConfiguration() : Configuration.EMPTY);
|
||||
@@ -341,9 +346,6 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
|
||||
|
||||
mRequestsTmpConfig.setTo(getRequestedOverrideConfiguration());
|
||||
mRequestsTmpConfig.windowConfiguration.setBounds(bounds);
|
||||
if (overrideMaxBounds) {
|
||||
mRequestsTmpConfig.windowConfiguration.setMaxBounds(bounds);
|
||||
}
|
||||
onRequestedOverrideConfigurationChanged(mRequestsTmpConfig);
|
||||
|
||||
return boundsChange;
|
||||
|
||||
@@ -5210,7 +5210,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
mCurrentOverrideConfigurationChanges = currOverrideConfig.diff(overrideConfiguration);
|
||||
super.onRequestedOverrideConfigurationChanged(overrideConfiguration);
|
||||
mCurrentOverrideConfigurationChanges = 0;
|
||||
mWmService.setNewDisplayOverrideConfiguration(overrideConfiguration, this);
|
||||
mWmService.setNewDisplayOverrideConfiguration(currOverrideConfig, this);
|
||||
mAtmService.addWindowLayoutReasons(
|
||||
ActivityTaskManagerService.LAYOUT_REASON_CONFIG_CHANGED);
|
||||
}
|
||||
|
||||
@@ -366,6 +366,30 @@ public class ConfigurationContainerTests {
|
||||
assertTrue(child.getConfiguration().windowConfiguration.getMaxBounds().isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnRequestedOverrideConfigurationChangedOverrideMaxBounds() {
|
||||
final TestConfigurationContainer root =
|
||||
new TestConfigurationContainer(true /* providesMaxBounds */);
|
||||
final Rect bounds = new Rect(0, 0, 10, 10);
|
||||
final TestConfigurationContainer child = new TestConfigurationContainer();
|
||||
root.addChild(child);
|
||||
final Configuration configuration = new Configuration();
|
||||
configuration.windowConfiguration.setBounds(bounds);
|
||||
|
||||
root.onRequestedOverrideConfigurationChanged(configuration);
|
||||
|
||||
assertEquals(bounds, root.getBounds());
|
||||
assertEquals(bounds, root.getConfiguration().windowConfiguration.getBounds());
|
||||
assertEquals(bounds, child.getBounds());
|
||||
assertEquals(bounds, child.getConfiguration().windowConfiguration.getBounds());
|
||||
|
||||
assertEquals(bounds, root.getMaxBounds());
|
||||
assertEquals(bounds, root.getConfiguration().windowConfiguration.getMaxBounds());
|
||||
assertEquals(bounds, child.getMaxBounds());
|
||||
assertEquals(bounds, child.getConfiguration().windowConfiguration.getMaxBounds());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contains minimal implementation of {@link ConfigurationContainer}'s abstract behavior needed
|
||||
* for testing.
|
||||
|
||||
Reference in New Issue
Block a user