summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorEvan Rosky <erosky@google.com>2020-02-28 19:37:04 -0800
committerEvan Rosky <erosky@google.com>2020-03-06 00:45:46 +0000
commit05ec88668e7526cf0d64ad681fdb388271e5459c (patch)
treef9fafda092498c928bf1dfcc096e99371d2d693b /core/java
parent6a84d7bef4a7c114bd37caf31b7b41efdc785bde (diff)
Fix config change on secondary split adjustment
This adds some more config controls to containerTransaction so that sysui divider can "freeze" the configuration w/h while it is offset for IME. Bug: 133381284 Bug: 149952263 Bug: 150400846 Test: Just after boot, open split with settings in secondary and open the search activity. This should show IME and not randomly hide it when background apps are started. Also added a wmtest. Change-Id: I731378f625079f8a1413469f71455650d9e59a50
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/WindowContainerTransaction.java42
1 files changed, 41 insertions, 1 deletions
diff --git a/core/java/android/view/WindowContainerTransaction.java b/core/java/android/view/WindowContainerTransaction.java
index f406be9ebac7..e05c3743565c 100644
--- a/core/java/android/view/WindowContainerTransaction.java
+++ b/core/java/android/view/WindowContainerTransaction.java
@@ -72,6 +72,33 @@ public class WindowContainerTransaction implements Parcelable {
}
/**
+ * Resize a container's app bounds. This is the bounds used to report appWidth/Height to an
+ * app's DisplayInfo. It is derived by subtracting the overlapping portion of the navbar from
+ * the full bounds.
+ */
+ public WindowContainerTransaction setAppBounds(IWindowContainer container, Rect appBounds) {
+ Change chg = getOrCreateChange(container.asBinder());
+ chg.mConfiguration.windowConfiguration.setAppBounds(appBounds);
+ chg.mConfigSetMask |= ActivityInfo.CONFIG_WINDOW_CONFIGURATION;
+ chg.mWindowSetMask |= WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS;
+ return this;
+ }
+
+ /**
+ * Resize a container's configuration size. The configuration size is what gets reported to the
+ * app via screenWidth/HeightDp and influences which resources get loaded. This size is
+ * derived by subtracting the overlapping portions of both the statusbar and the navbar from
+ * the full bounds.
+ */
+ public WindowContainerTransaction setScreenSizeDp(IWindowContainer container, int w, int h) {
+ Change chg = getOrCreateChange(container.asBinder());
+ chg.mConfiguration.screenWidthDp = w;
+ chg.mConfiguration.screenHeightDp = h;
+ chg.mConfigSetMask |= ActivityInfo.CONFIG_SCREEN_SIZE;
+ return this;
+ }
+
+ /**
* Notify activies within the hiearchy of a container that they have entered picture-in-picture
* mode with the given bounds.
*/
@@ -161,7 +188,8 @@ public class WindowContainerTransaction implements Parcelable {
@Override
public String toString() {
- return "WindowContainerTransaction { changes = " + mChanges + " }";
+ return "WindowContainerTransaction { changes = " + mChanges + " hops = " + mHierarchyOps
+ + " }";
}
@Override
@@ -269,6 +297,11 @@ public class WindowContainerTransaction implements Parcelable {
(mConfigSetMask & ActivityInfo.CONFIG_WINDOW_CONFIGURATION) != 0
&& ((mWindowSetMask & WindowConfiguration.WINDOW_CONFIG_BOUNDS)
!= 0);
+ final boolean changesAppBounds =
+ (mConfigSetMask & ActivityInfo.CONFIG_WINDOW_CONFIGURATION) != 0
+ && ((mWindowSetMask & WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS)
+ != 0);
+ final boolean changesSs = (mConfigSetMask & ActivityInfo.CONFIG_SCREEN_SIZE) != 0;
final boolean changesSss =
(mConfigSetMask & ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE) != 0;
StringBuilder sb = new StringBuilder();
@@ -276,9 +309,16 @@ public class WindowContainerTransaction implements Parcelable {
if (changesBounds) {
sb.append("bounds:" + mConfiguration.windowConfiguration.getBounds() + ",");
}
+ if (changesAppBounds) {
+ sb.append("appbounds:" + mConfiguration.windowConfiguration.getAppBounds() + ",");
+ }
if (changesSss) {
sb.append("ssw:" + mConfiguration.smallestScreenWidthDp + ",");
}
+ if (changesSs) {
+ sb.append("sw/h:" + mConfiguration.screenWidthDp + "x"
+ + mConfiguration.screenHeightDp + ",");
+ }
if ((mChangeMask & CHANGE_FOCUSABLE) != 0) {
sb.append("focusable:" + mFocusable + ",");
}