Try fixing the flakiness of TaplTestsQuickstep#testSwitchToOverview

The new configuration did not reported to the NexusLauncher activity
when the device rotated to landscape. It seems that the configuration
object of the ActivityClientRecord was unexpectedly updated somewhere,
so the configuration handling was skipped and not reporting to the
activity.

Copy the configuration from mPendingMergedConfiguration vs. directly
assigning the given configuration object reference.

Bug: 185820525
Test: atest NexusLauncherTests:TaplTestsQuickstep
Change-Id: I6768fe86e5c977c32a975562ec058c82d4f9c2fc
This commit is contained in:
Louis Chang
2021-04-22 18:22:10 +08:00
parent a3c90ed855
commit a262436fe1

View File

@@ -2776,8 +2776,8 @@ public final class ViewRootImpl implements ViewParent,
if (!mPendingMergedConfiguration.equals(mLastReportedMergedConfiguration)) {
if (DEBUG_CONFIGURATION) Log.v(mTag, "Visible with new config: "
+ mPendingMergedConfiguration.getMergedConfiguration());
performConfigurationChange(mPendingMergedConfiguration, !mFirst,
INVALID_DISPLAY /* same display */);
performConfigurationChange(new MergedConfiguration(mPendingMergedConfiguration),
!mFirst, INVALID_DISPLAY /* same display */);
updatedConfiguration = true;
}
@@ -5319,8 +5319,8 @@ public final class ViewRootImpl implements ViewParent,
mPendingMergedConfiguration.setConfiguration(config,
mLastReportedMergedConfiguration.getOverrideConfiguration());
performConfigurationChange(mPendingMergedConfiguration, false /* force */,
INVALID_DISPLAY /* same display */);
performConfigurationChange(new MergedConfiguration(mPendingMergedConfiguration),
false /* force */, INVALID_DISPLAY /* same display */);
} break;
case MSG_CLEAR_ACCESSIBILITY_FOCUS_HOST: {
setAccessibilityFocus(null, null);