Add Widget State Tracker
This change adds the state tracking portion of the detailed app jank
metrics feature. App Widgets will add/update/remove states throughout
their lifecycle; this change adds logic that will keep track of those
state changes. Several states could be active at once, when a state is
no longer active it will be moved to a previous state list.
The previously active states will eventually be processed and returned to
the state pool. States will be processed after each batch of JankData is
received. Currently JankData batches are received after 50 frames have
been rendered.
This change also adds unit tests that test the basic functionality of
the StateTracker. This includes adding/removing states as well as
retrieving states to process and returning processed states back to the
state pool.
Change-Id: I17a3f163f7b67d9451a9fe13c0d6520d2f658fb1
Bug: 368405795
Test: atest CoreAppJankTestCases
Flag: android.app.jank.detailed_app_jank_metrics_api
7 files changed