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. |
| static Long |
The presentation time is unknown. |
| static Long |
The presentation time is unset. |
| Public methods | |
|---|---|
| open Long |
Returns the actual time in nanoseconds taken by the application to render this frame. |
| open Long |
Returns the time in nanoseconds the frame was intended to be presented, such as the one set by android. |
| open Int |
Returns the bitmask indicating the types of jank observed. |
| open Long |
Returns the time in nanoseconds the frame was actually presented. |
| 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 |
toString()Returns a string representation of the object. |
Constants
JANK_APPLICATION
static val JANK_APPLICATION: Int
Bitmask for jank due to deadlines missed by the application.
Value: 2JANK_COMPOSER
static val JANK_COMPOSER: Int
Bitmask for jank due to deadlines missed by the composer.
Value: 1JANK_NONE
static val JANK_NONE: Int
No jank detected, the frame was on time.
Value: 0JANK_OTHER
static val JANK_OTHER: Int
Bitmask for jank due to deadlines missed by other system components.
Value: 4PRESENTATION_TIME_UNKNOWN
static val PRESENTATION_TIME_UNKNOWN: Long
The presentation time is unknown.
Value: -1LSee Also
PRESENTATION_TIME_UNSET
static val PRESENTATION_TIME_UNSET: Long
The presentation time is unset.
Value: 0LPublic methods
getActualAppFrameTimeNanos
open fun getActualAppFrameTimeNanos(): Long
Returns the actual time in nanoseconds taken by the application to render this frame.
Value is a non-negative duration in nanoseconds.
| Return | |
|---|---|
Long |
the actual app time in ns. Value is a non-negative duration in nanoseconds. |
getDesiredPresentTimeNanos
open fun getDesiredPresentTimeNanos(): Long
Returns the time in nanoseconds the frame was intended to be presented, such as the one set by android.view.SurfaceControl.Transaction#setDesiredPresentTime. Will be PRESENTATION_TIME_UNSET if a desired present time was not set for this frame.
| Return | |
|---|---|
Long |
the desired present 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 the following:
|
getPresentTimeNanos
open fun getPresentTimeNanos(): Long
Returns the time in nanoseconds the frame was actually presented. If the frame was not presented (for example, if it was replaced by a new frame before being sent to the display), this value will be PRESENTATION_TIME_UNSET. If the presentation status of the frame is unknown (for example, if the device does not support display present fences), this value will be PRESENTATION_TIME_UNKNOWN.
| Return | |
|---|---|
Long |
the present time in ns |
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.
Value is a non-negative duration in nanoseconds.
| Return | |
|---|---|
Long |
scheduled app time in ns. Value is a non-negative duration in nanoseconds. |
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
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |