JankData


class JankData
kotlin.Any
   ↳ 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
static Int

Bitmask for jank due to deadlines missed by the application.

static Int

Bitmask for jank due to deadlines missed by the composer.

static Int

No jank detected, the frame was on time.

static Int

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

Public methods
open Long

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

open Int

Returns the bitmask indicating the types of jank observed.

open Long

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

open Long

Returns the id of the frame for this jank classification.

open String

Constants

JANK_APPLICATION

static val JANK_APPLICATION: Int

Bitmask for jank due to deadlines missed by the application.

Value: 2

JANK_COMPOSER

static val JANK_COMPOSER: Int

Bitmask for jank due to deadlines missed by the composer.

Value: 1

JANK_NONE

static val JANK_NONE: Int

No jank detected, the frame was on time.

Value: 0

JANK_OTHER

static val JANK_OTHER: Int

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

Value: 4

Public methods

getActualAppFrameTimeNanos

open fun getActualAppFrameTimeNanos(): Long

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

Return
Long the actual app time in ns

getJankType

open fun getJankType(): Int

Returns the bitmask indicating the types of jank observed.

Return
Int the jank type bitmask Value is either 0 or a combination of android.view.SurfaceControl.JankData#JANK_NONE, android.view.SurfaceControl.JankData#JANK_COMPOSER, android.view.SurfaceControl.JankData#JANK_APPLICATION, and android.view.SurfaceControl.JankData#JANK_OTHER

getScheduledAppFrameTimeNanos

open fun getScheduledAppFrameTimeNanos(): Long

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.

Return
Long scheduled app time in ns

getVsyncId

open fun getVsyncId(): Long

Returns the id of the frame for this jank classification.

Return
Long the frame id

toString

open fun toString(): String
Return
String a string representation of the object.