PlaceholderSurface


@RequiresApi(value = 17)
@UnstableApi
public final class PlaceholderSurface extends Surface


A placeholder Surface.

Summary

Public fields

final boolean

Whether the surface is secure.

Public methods

synchronized static boolean

Returns whether the device supports secure placeholder surfaces.

static PlaceholderSurface
newInstanceV17(Context context, boolean secure)

Returns a newly created placeholder surface.

void

Inherited Constants

From android.os.Parcelable
static final int
static final int
From android.view.Surface
static final int
static final int
static final Parcelable.Creator<Surface>
static final int
static final int
static final int
static final int
static final int
static final int

Inherited methods

From android.view.Surface
void
int
void
boolean
Canvas
lockCanvas(Rect inOutDirty)
Canvas
void
void
setFrameRate(
    float frameRate,
    int compatibility,
    int changeFrameRateStrategy
)
String
void

This method is deprecated.

void
void
writeToParcel(Parcel dest, int flags)

Public fields

secure

public final boolean secure

Whether the surface is secure.

Public methods

isSecureSupported

synchronized public static boolean isSecureSupported(Context context)

Returns whether the device supports secure placeholder surfaces.

Parameters
Context context

Any Context.

Returns
boolean

Whether the device supports secure placeholder surfaces.

newInstanceV17

public static PlaceholderSurface newInstanceV17(Context context, boolean secure)

Returns a newly created placeholder surface. The surface must be released by calling release when it's no longer required.

Must only be called if SDK_INT is 17 or higher.

Parameters
Context context

Any Context.

boolean secure

Whether a secure surface is required. Must only be requested if isSecureSupported returns true.

Throws
java.lang.IllegalStateException

If a secure surface is requested on a device for which isSecureSupported returns false.

release

public void release()