Update override config to include some changes from global config

In override config for task we set Configuration#screenLayout field based on
initial global config + shrink to fit the area on screen given for this task.
However this field also contains information (like layout direction) that we
do not intend to override and it can be changed in global config separately.
In this case we need to update the override config with changes from global
config.

Bug: 28616488
Change-Id: I22673257621b3f9ae7933b37bd0fb9446c6042ea
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index ba044cc4..b77381c 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -73,7 +73,6 @@
 import static com.android.server.am.ActivityRecord.STARTING_WINDOW_REMOVED;
 import static com.android.server.am.ActivityRecord.STARTING_WINDOW_SHOWN;
 import static com.android.server.am.ActivityStackSupervisor.FindTaskResult;
-import static com.android.server.am.ActivityStackSupervisor.MOVING;
 import static com.android.server.am.ActivityStackSupervisor.ON_TOP;
 import static com.android.server.am.ActivityStackSupervisor.PRESERVE_WINDOWS;
 import static com.android.server.wm.AppTransition.TRANSIT_ACTIVITY_CLOSE;
@@ -4464,6 +4463,7 @@
         // Short circuit: if the two configurations are equal (the common case), then there is
         // nothing to do.
         final Configuration newConfig = mService.mConfiguration;
+        r.task.sanitizeOverrideConfiguration(newConfig);
         final Configuration taskConfig = r.task.mOverrideConfig;
         if (r.configuration.equals(newConfig)
                 && r.taskConfigOverride.equals(taskConfig)