summaryrefslogtreecommitdiff
path: root/core/java/android/view/WindowContainerTransaction.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2019-12-18 02:13:12 -0800
committerWinson Chung <winsonc@google.com>2020-03-13 20:28:52 -0700
commitf6878a43166af16d3f6fbfcafc2dab0d41358eba (patch)
tree1c6e758ff6ed399b4646363f6ebb94f675fb439d /core/java/android/view/WindowContainerTransaction.java
parent764e7971d844c89aefe4e4dd98db676e67cb29e5 (diff)
Add WCT call to set container hidden state
- This can be used for SysUI to control container visibility without clobbering the system determined task visibility Bug: 139371701 Test: atest WmTests:TaskOrganizerTests Change-Id: I8f54b2c18dd99ab8de5184e27ca4698417a6701e
Diffstat (limited to 'core/java/android/view/WindowContainerTransaction.java')
-rw-r--r--core/java/android/view/WindowContainerTransaction.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/java/android/view/WindowContainerTransaction.java b/core/java/android/view/WindowContainerTransaction.java
index 9c16e1334e00..56b49515f419 100644
--- a/core/java/android/view/WindowContainerTransaction.java
+++ b/core/java/android/view/WindowContainerTransaction.java
@@ -168,6 +168,18 @@ public class WindowContainerTransaction implements Parcelable {
}
/**
+ * Sets whether a container or its children should be hidden. When {@code false}, the existing
+ * visibility of the container applies, but when {@code true} the container will be forced
+ * to be hidden.
+ */
+ public WindowContainerTransaction setHidden(IWindowContainer container, boolean hidden) {
+ Change chg = getOrCreateChange(container.asBinder());
+ chg.mHidden = hidden;
+ chg.mChangeMask |= Change.CHANGE_HIDDEN;
+ return this;
+ }
+
+ /**
* Set the smallestScreenWidth of a container.
*/
public WindowContainerTransaction setSmallestScreenWidthDp(IWindowContainer container,
@@ -250,9 +262,11 @@ public class WindowContainerTransaction implements Parcelable {
public static final int CHANGE_FOCUSABLE = 1;
public static final int CHANGE_BOUNDS_TRANSACTION = 1 << 1;
public static final int CHANGE_PIP_CALLBACK = 1 << 2;
+ public static final int CHANGE_HIDDEN = 1 << 3;
private final Configuration mConfiguration = new Configuration();
private boolean mFocusable = true;
+ private boolean mHidden = false;
private int mChangeMask = 0;
private @ActivityInfo.Config int mConfigSetMask = 0;
private @WindowConfiguration.WindowConfig int mWindowSetMask = 0;
@@ -268,6 +282,7 @@ public class WindowContainerTransaction implements Parcelable {
protected Change(Parcel in) {
mConfiguration.readFromParcel(in);
mFocusable = in.readBoolean();
+ mHidden = in.readBoolean();
mChangeMask = in.readInt();
mConfigSetMask = in.readInt();
mWindowSetMask = in.readInt();
@@ -296,7 +311,7 @@ public class WindowContainerTransaction implements Parcelable {
return mConfiguration;
}
- /** Gets the requested focusable value */
+ /** Gets the requested focusable state */
public boolean getFocusable() {
if ((mChangeMask & CHANGE_FOCUSABLE) == 0) {
throw new RuntimeException("Focusable not set. check CHANGE_FOCUSABLE first");
@@ -304,6 +319,14 @@ public class WindowContainerTransaction implements Parcelable {
return mFocusable;
}
+ /** Gets the requested hidden state */
+ public boolean getHidden() {
+ if ((mChangeMask & CHANGE_HIDDEN) == 0) {
+ throw new RuntimeException("Hidden not set. check CHANGE_HIDDEN first");
+ }
+ return mHidden;
+ }
+
public int getChangeMask() {
return mChangeMask;
}
@@ -369,6 +392,7 @@ public class WindowContainerTransaction implements Parcelable {
public void writeToParcel(Parcel dest, int flags) {
mConfiguration.writeToParcel(dest, flags);
dest.writeBoolean(mFocusable);
+ dest.writeBoolean(mHidden);
dest.writeInt(mChangeMask);
dest.writeInt(mConfigSetMask);
dest.writeInt(mWindowSetMask);