We can reimplement this pre API 29 by using a draw (or pre draw) listener then posting at front. JankStats likely does this.
The sticking point is, you need a window. But maybe we should just grab all windows and go with the timestamp for the first one.
We can also get smarter when we have a touch event, as we'll know which window the touch event is associated with and could check the UI for that touch event. Of course that might prove tricky if the touch is to close a window and we send the update event from the below window long after it's gone.
https://developer.android.com/reference/android/view/ViewTreeObserver#registerFrameCommitCallback(java.lang.Runnable)
We can reimplement this pre API 29 by using a draw (or pre draw) listener then posting at front. JankStats likely does this.
The sticking point is, you need a window. But maybe we should just grab all windows and go with the timestamp for the first one.
We can also get smarter when we have a touch event, as we'll know which window the touch event is associated with and could check the UI for that touch event. Of course that might prove tricky if the touch is to close a window and we send the update event from the below window long after it's gone.