Update the UI for the "Unused apps" preference to update with the loaded
number of unused apps instead of having the entire preference animate
in.
Bug: 187996287
Test: manual
Test: atest HibernatedAppsPreferenceControllerTest
Change-Id: I1c6998de4daaf4d8678a3ffdaf83f5d2417fa68d
Move the somewhat expensive calculation of the "Unused apps" count to
the background thread
Initially, the "Unused apps" preference is unavailable. When the bg work
finishes and we see we have a non-zero number of unused apps, we display
the preference and update the summary text.
Bug: 187996287
Test: atest HibernatedAppsPreferenceControllerTest
Test: measure latency of displaying preferences w/ custom trace points
Change-Id: Idb0d836fd8f4bcdd2605a7d59703a7ed53bcd6d4
This fixes an issue where there is some discrepancy between the "X
unused apps" string in Settings and the actual number of unused apps in
PermissionController due to the Settings logic not taking into account
the usage time.
Bug: 187464720
Test: atest HibernatedAppsPreferenceControllerTest
Test: hibernate app and revoke permission, open app, number of unused
apps matches up
Change-Id: Ifc30280e582e4183c61d421dd5378d627a80baf9
Update the summary of "unused apps" based on how many apps are
hibernated or auto revoked.
Test: HibernatedAppsPreferenceControllerTest
Bug: 181172051
Change-Id: I274eb3c0ada3d063937368232f31e52c20287552
Created an preference in Apps & Notifcations page as the entry point for
apps that are hibernated. Also added a switch preference in AppInfo page
for users to exempt an app from hibernation.
Bug: 181172051
Test: HibernatedAppsPreferenceControllerTest;
HibernationSwitchPreferenceControllerTest;
AppInfoDashboardFragmentTest
Change-Id: I72a90ab391cd521150fc155a6d9c67c846b7360d