OSDN Git Service

Fixed unexpected configuration change causing activity relaunch
authorWale Ogunwale <ogunwale@google.com>
Fri, 20 Nov 2015 17:36:46 +0000 (09:36 -0800)
committerWale Ogunwale <ogunwale@google.com>
Fri, 20 Nov 2015 18:13:13 +0000 (10:13 -0800)
In commit ebcc875f we migrated the setting of the task override
configuration from WM to AM. However, the migration changed the
construction of the override configuration to take in the service
configuration as the starting value. This is incorrect since the
only values that should be set in the override configuration are
the ones that change due to resizing. We now seed the override
configuration with the EMPTY value to make it obvious that the
object should be constructed with the default values.

Also, fixed issue with WM telling activity manager to resize a stack
when the stack is already the size it wants.

Bug: 25776219
Change-Id: I882979aa87b49e7a5dc993bd9223fbd6e6cf6471

services/core/java/com/android/server/am/TaskRecord.java
services/core/java/com/android/server/wm/TaskStack.java

index 3fc6846..02cf87a 100644 (file)
@@ -1277,7 +1277,7 @@ final class TaskRecord {
             }
 
             final Configuration serviceConfig = mService.mConfiguration;
-            mOverrideConfig = new Configuration(serviceConfig);
+            mOverrideConfig = new Configuration(Configuration.EMPTY);
             // TODO(multidisplay): Update Dp to that of display stack is on.
             final float density = serviceConfig.densityDpi * DisplayMetrics.DENSITY_DEFAULT_SCALE;
             mOverrideConfig.screenWidthDp =
index 8085f13..04ab544 100644 (file)
@@ -515,10 +515,11 @@ public class TaskStack implements DimLayer.DimLayerUser {
         for (int i = 0; i < count; i++) {
             final TaskStack otherStack = mService.mStackIdToStack.valueAt(i);
             final int otherStackId = otherStack.mStackId;
-            if (StackId.isResizeableByDockedStack(otherStackId)) {
+            if (StackId.isResizeableByDockedStack(otherStackId)
+                    && !otherStack.mBounds.equals(bounds)) {
                 mService.mH.sendMessage(
                         mService.mH.obtainMessage(RESIZE_STACK, otherStackId,
-                                1 /*allowResizeInDockedMode*/, bounds));
+                                1 /*allowResizeInDockedMode*/, fullscreen ? null : bounds));
             }
         }
     }