Stay organized with collections
Save and categorize content based on your preferences.
OnJankDataListenerRegistration
class OnJankDataListenerRegistration
Handle to a registered OnJankDatalistener.
Summary
Public methods |
open Unit |
Request a flush of any pending jank classification data.
|
open Unit |
Schedule the removal of the registered listener after the frame with the provided id.
|
Public methods
flush
open fun flush(): Unit
Request a flush of any pending jank classification data.
May cause the registered listener to be invoked inband. Since jank is tracked by the system compositor by surface, flushing the data on one listener, will also cause other listeners on the same surface to receive jank classification data.
removeAfter
open fun removeAfter(afterVsync: Long): Unit
Schedule the removal of the registered listener after the frame with the provided id.
Because jank classification is only possible after frames have been displayed, the callbacks are always delayed. To ensure receipt of all jank classification data, an application can schedule the removal to happen no sooner than after the data for the frame with the provided id has been provided.
Use a value <= 0 for afterVsync to remove the listener immediately, ensuring no future callbacks.
Parameters |
afterVsync |
Long: the id of the Vsync after which to remove the listener |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-13 UTC."],[],[],null,["# SurfaceControl.OnJankDataListenerRegistration\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnJankDataListenerRegistration\n==============================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/SurfaceControl.OnJankDataListenerRegistration \"View this page in Java\") \n\n```\nclass OnJankDataListenerRegistration\n```\n\n|---|-----------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.SurfaceControl.OnJankDataListenerRegistration](#) |\n\nHandle to a registered OnJankDatalistener.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [flush](#flush())`()` Request a flush of any pending jank classification data. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [removeAfter](#removeAfter(kotlin.Long))`(`afterVsync:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Schedule the removal of the registered listener after the frame with the provided id. |\n\nPublic methods\n--------------\n\n### flush\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun flush(): Unit\n```\n\nRequest a flush of any pending jank classification data.\n\nMay cause the registered listener to be invoked inband. Since jank is tracked by the system compositor by surface, flushing the data on one listener, will also cause other listeners on the same surface to receive jank classification data. \n\n### removeAfter\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun removeAfter(afterVsync: Long): Unit\n```\n\nSchedule the removal of the registered listener after the frame with the provided id.\n\nBecause jank classification is only possible after frames have been displayed, the callbacks are always delayed. To ensure receipt of all jank classification data, an application can schedule the removal to happen no sooner than after the data for the frame with the provided id has been provided.\n\nUse a value \\\u003c= 0 for afterVsync to remove the listener immediately, ensuring no future callbacks.\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `afterVsync` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the id of the Vsync after which to remove the listener |"]]