Merge "Remove unnecessary calculation of display configuration" into tm-qpr-dev
This commit is contained in:
@@ -1614,24 +1614,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
}
|
||||
config = new Configuration();
|
||||
computeScreenConfiguration(config);
|
||||
} else if (!(mTransitionController.isCollecting(this)
|
||||
// If waiting for a remote display change, don't prematurely update configuration.
|
||||
|| mRemoteDisplayChangeController.isWaitingForRemoteDisplayChange())) {
|
||||
// No obvious action we need to take, but if our current state mismatches the
|
||||
// activity manager's, update it, disregarding font scale, which should remain set
|
||||
// to the value of the previous configuration.
|
||||
// Here we're calling Configuration#unset() instead of setToDefaults() because we
|
||||
// need to keep override configs clear of non-empty values (e.g. fontSize).
|
||||
final Configuration currentConfig = getRequestedOverrideConfiguration();
|
||||
mTmpConfiguration.unset();
|
||||
mTmpConfiguration.updateFrom(currentConfig);
|
||||
computeScreenConfiguration(mTmpConfiguration);
|
||||
if (currentConfig.diff(mTmpConfiguration) != 0) {
|
||||
mWaitingForConfig = true;
|
||||
setLayoutNeeded();
|
||||
mDisplayRotation.prepareNormalRotationAnimation();
|
||||
config = new Configuration(mTmpConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
|
||||
@@ -2993,6 +2993,7 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
// Add a decor insets provider window.
|
||||
final WindowState navbar = createNavBarWithProvidedInsets(squareDisplay);
|
||||
squareDisplay.getDisplayPolicy().updateDecorInsetsInfoIfNeeded(navbar);
|
||||
squareDisplay.sendNewConfiguration();
|
||||
final Task task = new TaskBuilder(mSupervisor).setDisplay(squareDisplay).build();
|
||||
|
||||
// create a fixed portrait activity
|
||||
|
||||
@@ -220,10 +220,7 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
|
||||
// Check that changes are reported
|
||||
Configuration c = new Configuration(newDisp1.getRequestedOverrideConfiguration());
|
||||
c.windowConfiguration.setBounds(new Rect(0, 0, 1000, 1300));
|
||||
newDisp1.onRequestedOverrideConfigurationChanged(c);
|
||||
mAtm.mRootWindowContainer.ensureVisibilityAndConfig(null /* starting */,
|
||||
newDisp1.mDisplayId, false /* markFrozenIfConfigChanged */,
|
||||
false /* deferResume */);
|
||||
newDisp1.performDisplayOverrideConfigUpdate(c);
|
||||
assertEquals(0, added.size());
|
||||
assertEquals(1, changed.size());
|
||||
assertEquals(0, removed.size());
|
||||
|
||||
Reference in New Issue
Block a user