Fix frame rate idleness and TextureView video play logic
Previously we check whether setFrameRateCategoy is called to detect idleness. However, if the frame rate cateogry remain the same when View are invalided, setFrameRateCategoy will not be called. Therefore, moving the logic to votePreferredFrameRate and votePreferredFrameRateCategory. Also, increase the timeout for revaluating idleness from 500 ms to 1000 ms.
Morever, update video play logic in TextureView to do the following:
1. Store the last 3 invalidates time - FT1, FT2, FT3.
2. If FT2-FT1 > 15ms && FT3-FT2 > 15ms -> vote for NORMAL category
Also, don't take the too frequent invalidation (interval between 2 ms)
into account when determining whether it's a infrequent or frequent
update.
Bug: 322398850
Test: atest ViewRootImplTest
Change-Id: I6181f8d25dcd0922cbc2921d1e2972ce347e8028
4 files changed