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
This commit is contained in:
@@ -69,6 +69,10 @@ public class AppDashboardFragment extends DashboardFragment {
|
||||
use(SpecialAppAccessPreferenceController.class).setSession(getSettingsLifecycle());
|
||||
mAppsPreferenceController = use(AppsPreferenceController.class);
|
||||
mAppsPreferenceController.setFragment(this /* fragment */);
|
||||
|
||||
final HibernatedAppsPreferenceController hibernatedAppsPreferenceController =
|
||||
use(HibernatedAppsPreferenceController.class);
|
||||
getSettingsLifecycle().addObserver(hibernatedAppsPreferenceController);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user