From a262436fe18ed18179ca24ade5d819e875e44448 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Thu, 22 Apr 2021 18:22:10 +0800 Subject: [PATCH] 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 --- core/java/android/view/ViewRootImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index be8e51980c3ce..924ad0b733be1 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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);