Introducing WindowConfiguration
Used to house configurations that don't affect resources and that
we don't want to communicate to apps, but need to be propagated
along side Configuration.
Test: bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests
Test: adb shell am instrument -w -e package com.android.server.wm com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I97de3efbe6d5e1d3b07156a8cfbce9be5eae5cb5
diff --git a/services/core/java/com/android/server/wm/StackWindowController.java b/services/core/java/com/android/server/wm/StackWindowController.java
index 9c44c14..358b8be 100644
--- a/services/core/java/com/android/server/wm/StackWindowController.java
+++ b/services/core/java/com/android/server/wm/StackWindowController.java
@@ -16,11 +16,9 @@
package com.android.server.wm;
-import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import android.app.ActivityManager.StackId;
-import android.app.RemoteAction;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Handler;
@@ -30,11 +28,9 @@
import android.util.SparseArray;
import android.view.DisplayInfo;
-import com.android.server.UiThread;
import com.android.internal.annotations.VisibleForTesting;
import java.lang.ref.WeakReference;
-import java.util.List;
import static com.android.server.wm.WindowContainer.POSITION_BOTTOM;
import static com.android.server.wm.WindowContainer.POSITION_TOP;
@@ -278,9 +274,9 @@
int width;
int height;
- final Rect parentAppBounds = parentConfig.appBounds;
+ final Rect parentAppBounds = parentConfig.windowConfiguration.getAppBounds();
- config.setAppBounds(!bounds.isEmpty() ? bounds : null);
+ config.windowConfiguration.setAppBounds(!bounds.isEmpty() ? bounds : null);
boolean intersectParentBounds = false;
if (StackId.tasksAreFloating(mStackId)) {
@@ -295,7 +291,7 @@
nonDecorBounds.inset(mTmpNonDecorInsets);
// Move app bounds to zero to apply intersection with parent correctly. They are
// used only for evaluating width and height, so it's OK to move them around.
- config.appBounds.offsetTo(0, 0);
+ config.windowConfiguration.getAppBounds().offsetTo(0, 0);
intersectParentBounds = true;
}
width = (int) (stableBounds.width() / density);
@@ -319,8 +315,8 @@
intersectParentBounds = true;
}
- if (intersectParentBounds && config.appBounds != null) {
- config.appBounds.intersect(parentAppBounds);
+ if (intersectParentBounds && config.windowConfiguration.getAppBounds() != null) {
+ config.windowConfiguration.getAppBounds().intersect(parentAppBounds);
}
config.screenWidthDp = width;