summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/TaskFragment.java7
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index b90a2111ac84..a031acad638f 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -2753,7 +2753,12 @@ class TaskFragment extends WindowContainer<WindowContainer> {
if (!forceUpdate && width == mLastSurfaceSize.x && height == mLastSurfaceSize.y) {
return;
}
- t.setWindowCrop(mSurfaceControl, width, height);
+ if (fillsParent()) {
+ // Rely on parent's crop.
+ t.setCrop(mSurfaceControl, null);
+ } else {
+ t.setWindowCrop(mSurfaceControl, width, height);
+ }
mLastSurfaceSize.set(width, height);
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
index c0f251e06d17..dc4adcc4315b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
@@ -132,8 +132,8 @@ public class TaskFragmentTest extends WindowTestsBase {
final int parentSw = parentConfig.smallestScreenWidthDp;
final Rect bounds = new Rect(parentBounds);
bounds.inset(100, 100);
- mTaskFragment.setBounds(bounds);
mTaskFragment.setWindowingMode(WINDOWING_MODE_MULTI_WINDOW);
+ mTaskFragment.setBounds(bounds);
// Calculate its own sw with smaller bounds in multi-window mode.
assertNotEquals(parentSw, mTaskFragment.getConfiguration().smallestScreenWidthDp);