summaryrefslogtreecommitdiff
path: root/core/java/android/view/SurfaceControl.java
diff options
context:
space:
mode:
authorTiger Huang <tigerhuang@google.com>2019-12-24 20:08:57 +0800
committerTiger Huang <tigerhuang@google.com>2020-01-09 17:01:42 +0800
commit969c60859ad932cfc362e8dba45019f2720139be (patch)
treed59cf2ce24ac8cd1f1845cdaedf50e3031190e4e /core/java/android/view/SurfaceControl.java
parent78beac60dc2bda8dccd26e05d460f668c5691d6d (diff)
Window Manager Flag Migration (9/n)
Update the leash of InsetsSourceControl and send it to the client while the insets source window is moved. This CL also guarantees that the array of InsetsSourceControl send to the client side doesn't contain any null element. Bug: 118118435 Test: atest InsetsSourceProviderTest InsetsStateControllerTest InsetsPolicyTest WindowStateTests CommandQueueTest RegisterStatusBarResultTest InsetsFlagsTest LightBarControllerTest RegisterStatusBarResultTest ViewRootImplTest DisplayPolicyLayoutTests DisplayPolicyInsetsTests DisplayPolicyTests TaskSnapshotSurfaceTest NavigationBarColorTest Test: Rotate Camera in the new insets mode Change-Id: I96d7ac5c37abbb472dab4cd2c24644e136d23947
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
-rw-r--r--core/java/android/view/SurfaceControl.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index f6d6522f80d6..ff8455ab0915 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -677,6 +677,22 @@ public final class SurfaceControl implements Parcelable {
}
/**
+ * Set the initial visibility for the SurfaceControl.
+ *
+ * @param hidden Whether the Surface is initially HIDDEN.
+ * @hide
+ */
+ @NonNull
+ public Builder setHidden(boolean hidden) {
+ if (hidden) {
+ mFlags |= HIDDEN;
+ } else {
+ mFlags &= ~HIDDEN;
+ }
+ return this;
+ }
+
+ /**
* Set a parent surface for our new SurfaceControl.
*
* Child surfaces are constrained to the onscreen region of their parent.
@@ -789,8 +805,7 @@ public final class SurfaceControl implements Parcelable {
* @param name The surface name, must not be null.
* @param w The surface initial width.
* @param h The surface initial height.
- * @param flags The surface creation flags. Should always include {@link #HIDDEN}
- * in the creation flags.
+ * @param flags The surface creation flags.
* @param metadata Initial metadata.
* @throws throws OutOfResourcesException If the SurfaceControl cannot be created.
*/
@@ -801,15 +816,6 @@ public final class SurfaceControl implements Parcelable {
throw new IllegalArgumentException("name must not be null");
}
- if ((flags & SurfaceControl.HIDDEN) == 0) {
- Log.w(TAG, "Surfaces should always be created with the HIDDEN flag set "
- + "to ensure that they are not made visible prematurely before "
- + "all of the surface's properties have been configured. "
- + "Set the other properties and make the surface visible within "
- + "a transaction. New surface name: " + name,
- new Throwable());
- }
-
mName = name;
mWidth = w;
mHeight = h;