From 48bd52e09130a124a2f970f11c08128f2a0402eb Mon Sep 17 00:00:00 2001 From: Zhen Zhang Date: Wed, 3 Mar 2021 13:53:34 -0800 Subject: [PATCH] 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 --- res/values/strings.xml | 12 ++ res/xml/app_and_notification.xml | 10 ++ res/xml/app_info_settings.xml | 13 ++ res/xml/app_info_settings_v2.xml | 13 ++ res/xml/apps.xml | 10 ++ src/com/android/settings/Utils.java | 3 + .../HibernatedAppsPreferenceController.java | 61 ++++++++ ...bernationPreferenceCategoryController.java | 30 ++++ .../appinfo/AppInfoDashboardFragment.java | 7 + ...HibernationSwitchPreferenceController.java | 145 +++++++++++++++++ ...ibernatedAppsPreferenceControllerTest.java | 63 ++++++++ ...rnationSwitchPreferenceControllerTest.java | 146 ++++++++++++++++++ 12 files changed, 513 insertions(+) create mode 100644 src/com/android/settings/applications/HibernatedAppsPreferenceController.java create mode 100644 src/com/android/settings/applications/appinfo/AppHibernationPreferenceCategoryController.java create mode 100644 src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceController.java create mode 100644 tests/unit/src/com/android/settings/applications/HibernatedAppsPreferenceControllerTest.java create mode 100644 tests/unit/src/com/android/settings/applications/appinfo/HibernationSwitchPreferenceControllerTest.java diff --git a/res/values/strings.xml b/res/values/strings.xml index 7e10006638d..c464da02fb2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9800,6 +9800,18 @@ Control app access to your data + + Unused apps + + + + %d unused app + %d unused apps + + + + Remove permissions and free up space + All apps diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml index 49d8e9b85fd..8b4c912485c 100644 --- a/res/xml/app_and_notification.xml +++ b/res/xml/app_and_notification.xml @@ -83,6 +83,16 @@ + + + + + + + + + + + + + + + + + +