Commit Graph

6 Commits

Author SHA1 Message Date
Kevin Han
4d762a190a Enable hibernation by default for Settings
Enable hibernation by default

Bug: 192397298
Test: forrest
Change-Id: I350d2e82459be2bd8b8bca4d183ac508ec199b4f
2021-06-30 21:30:43 -07:00
Kevin Han
730a573d28 Update "Unused apps" load-in UI
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
2021-06-14 18:37:04 -07:00
Kevin Han
8df22e7cd9 Move unused apps count calculation to bg thread
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
2021-06-03 19:14:25 -07:00
Kevin Han
53aaab09b8 Fix "X unused apps" string to match w/ unused apps
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
2021-05-11 17:04:55 -07:00
Zhen Zhang
1f99d6a4b5 Update summary based on hibernated apps number
Update the summary of "unused apps" based on how many apps are
hibernated or auto revoked.

Test: HibernatedAppsPreferenceControllerTest
Bug: 181172051

Change-Id: I274eb3c0ada3d063937368232f31e52c20287552
2021-03-23 11:10:43 -07:00
Zhen Zhang
48bd52e091 Update settings for app hibernation
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
2021-03-15 21:34:46 -07:00