SurfaceControl.JankData


public static class SurfaceControl.JankData
extends Object

java.lang.Object
   ↳ android.view.SurfaceControl.JankData


Jank information to be fed back via OnJankDataListener.

Apps may register a OnJankDataListener to get periodic batches of jank classification data from the ( composer regarding rendered frames. A frame is considered janky if it did not reach the display at the intended time, typically due to missing a rendering deadline. This API provides information that can be used to identify the root cause of the scheduling misses and provides overall frame scheduling statistics.

This API can be used in conjunction with the FrameMetrics API by associating jank classification data with FrameMetrics data via the frame VSync id.

Summary

Constants

int JANK_APPLICATION

Bitmask for jank due to deadlines missed by the application.

int JANK_COMPOSER

Bitmask for jank due to deadlines missed by the composer.

int JANK_NONE

No jank detected, the frame was on time.

int JANK_OTHER

Bitmask for jank due to deadlines missed by other system components.

Public methods

long getActualAppFrameTimeNanos()

Returns the actual time in nanoseconds taken by the application to render this frame.

int getJankType()

Returns the bitmask indicating the types of jank observed.

long getScheduledAppFrameTimeNanos()

Returns the duration in nanoseconds the application was scheduled to use to render this frame.

long getVsyncId()

Returns the id of the frame for this jank classification.

String toString()

Returns a string representation of the object.

Inherited methods

Constants

JANK_APPLICATION

public static final int JANK_APPLICATION

Bitmask for jank due to deadlines missed by the application.

Constant Value: 2 (0x00000002)

JANK_COMPOSER

public static final int JANK_COMPOSER

Bitmask for jank due to deadlines missed by the composer.

Constant Value: 1 (0x00000001)

JANK_NONE

public static final int JANK_NONE

No jank detected, the frame was on time.

Constant Value: 0 (0x00000000)

JANK_OTHER

public static final int JANK_OTHER

Bitmask for jank due to deadlines missed by other system components.

Constant Value: 4 (0x00000004)

Public methods

getActualAppFrameTimeNanos

public long getActualAppFrameTimeNanos ()

Returns the actual time in nanoseconds taken by the application to render this frame.

Returns
long the actual app time in ns

getJankType

public int getJankType ()

Returns the bitmask indicating the types of jank observed.

Returns
int the jank type bitmask Value is either 0 or a combination of JANK_NONE, JANK_COMPOSER, JANK_APPLICATION, and JANK_OTHER

getScheduledAppFrameTimeNanos

public long getScheduledAppFrameTimeNanos ()

Returns the duration in nanoseconds the application was scheduled to use to render this frame.

Note that this may be higher than the frame interval to allow for CPU/GPU parallelization of work.

Returns
long scheduled app time in ns

getVsyncId

public long getVsyncId ()

Returns the id of the frame for this jank classification.

Returns
long the frame id

toString

public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.