Skip to content

Measure drawn frames with the platform frame metrics on API 24+ - #12

Merged
imayankkumar merged 5 commits into
mainfrom
maint/FP-006-frame-metrics-source
Nov 16, 2026
Merged

imayankkumar merged 5 commits into
mainfrom
maint/FP-006-frame-metrics-source

Conversation

@imayankkumar

Copy link
Copy Markdown
Owner
  • New: FramePulse.start(activity, config, listener) measures the frames the window draws on API 24+, using the platform frame metrics
  • New: on API 31+ a frame is jank when it runs past the deadline the system gave it; idle time is never jank
  • Update: the sample app and README use the new start(activity)
  • New: unit and instrumentation tests for measured frames

A frame source can now deliver a frame with the duration the platform measured for it. FPS is then the frames drawn in the window over the window length, so idle time lowers the FPS and is never jank. A frame is jank when it took longer than its deadline, or the configured threshold when there is no deadline.
Backed by Window.OnFrameMetricsAvailableListener (API 24+). First draw frames and reports without a duration are dropped.
Measures the frames the activity's window draws on API 24+, and falls back to Choreographer callbacks with display refresh-rate tracking on API 21 to 23.
The window's drawn frames are measured, so the forced highest refresh-rate mode is no longer needed.
@imayankkumar
imayankkumar merged commit 1b4b86a into main Nov 16, 2026
2 checks passed
@imayankkumar
imayankkumar deleted the maint/FP-006-frame-metrics-source branch November 16, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant