Google is committed to advancing racial equity for Black communities. See how.
Added in API level 29

SurfaceControl

class SurfaceControl : Parcelable
kotlin.Any
   ↳ android.view.SurfaceControl

Handle to an on-screen Surface managed by the system compositor. The SurfaceControl is a combination of a buffer source, and metadata about how to display the buffers. By constructing a Surface from this SurfaceControl you can submit buffers to be composited. Using SurfaceControl.Transaction you can manipulate various properties of how the buffer will be displayed on-screen. SurfaceControl's are arranged into a scene-graph like hierarchy, and as such any SurfaceControl may have a parent. Geometric properties like transform, crop, and Z-ordering will be inherited from the parent, as if the child were content in the parents buffer stream.

Summary

Nested classes

Builder class for SurfaceControl objects.

An atomic set of changes to a set of SurfaceControl.

Inherited constants

Public methods

Int

Boolean

Check whether this instance points to a valid layer with the system-compositor.

Unit

Unit

Release the local reference to the server-side surface.

String

Unit
writeToParcel(dest: Parcel!, flags: Int)

Properties

static Parcelable.Creator<SurfaceControl!>

Public methods

describeContents

Added in API level 29
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

isValid

Added in API level 29
fun isValid(): Boolean

Check whether this instance points to a valid layer with the system-compositor. For example this may be false if construction failed, or the layer was released (release).

Return
Boolean Whether this SurfaceControl is valid.

readFromParcel

Added in API level 29
fun readFromParcel(in: Parcel!): Unit

release

Added in API level 29
fun release(): Unit

Release the local reference to the server-side surface. The surface may continue to exist on-screen as long as its parent continues to exist. To explicitly remove a surface from the screen use Transaction#reparent with a null-parent. After release, isValid will return false and other methods will throw an exception. Always call release() when you're done with a SurfaceControl.

toString

Added in API level 29
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 29
fun writeToParcel(
    dest: Parcel!,
    flags: Int
): Unit
Parameters
dest Parcel!: The Parcel in which the object should be written.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 29
static val CREATOR: Parcelable.Creator<SurfaceControl!>