Commit Graph

8 Commits

Author SHA1 Message Date
yuqingmao
2aba347087 Add API of isOatArtifactDeletionEnabled for system apps
The interface of `isOatArtifactDeletionEnabled` is only available on internal system server. As request from ART service, it should be an open API available in system apps, for logic of `canOptimizePackage` and other purposes.

Bug: 229203212
Test: atest AppHibernationIntegrationTest

Change-Id: I195fdddcce2451e230414ce1a02202e9f8c6af19
2022-05-23 11:09:12 -07:00
Kevin Han
caa924a1c6 Introduce API to get hibernation stats
Introduce an API to get relevant stats about hibernated apps. For now,
this only includes the amount of storage saved from the app being
hibernated. This will be used to in user-facing UI surfaces to show how
much storage hibernation has saved the user.

Bug: 213480570
Test: atest AppHibernationServiceTest
CTS-Coverage-Bug: 216383448
Change-Id: I41877aa2f4959b3f2b13731c8336077555379338
2022-01-27 14:01:12 -08:00
Zhen Zhang
649f4ae0b6 Let AppHibernationManager be mockable
Remove final keyword to let AppHibernationManager be mockable. This can
help testing other classes where the APIs are used.

Test: built successfully
Bug: 183142489
Change-Id: I96eec719d71f549f6a2209fd0db22412c1fa487f
2021-03-23 00:36:33 +00:00
Kevin Han
f0df72a9c7 Add API to get hibernating packages
Add API to AppHibernationService to get hibernating packages so
Settings can access this information.

Bug: 175829330
Test: atest AppHibernationServiceTest
Change-Id: Icd186807c19ece55a21fc4d240d2f0132951af82
2021-03-19 10:38:16 -07:00
Kevin Han
152e389bae Add MANAGE_APP_HIBERNATION permission
Add permission for app hibernation state manipulation.

Bug: 183058954
Test: run hibernation job and confirm the API works for
PermissionController

(cherrypick of ag/13909632)

Merged-In: Id57ee57f49710d0b8a49a4ec561800db43089f87
Change-Id: Id57ee57f49710d0b8a49a4ec561800db43089f87
2021-03-19 10:37:05 -07:00
Kevin Han
f4261d7215 Introduce global package hibernation
Introduce the concept of global package hibernation / package-level
hibernation. This opens the way for optimizations at the package or
APK level based off usage across all users.

Bug: 175829330
Test: atest AppHibernationServiceTest
Test: adb shell cmd app_hibernation get-state --global
com.google.android.deskclock

Change-Id: Ic989fc09a4c60f3bbf28b34fe38fa07e77eedacb
2021-01-28 15:32:23 -08:00
Kevin Han
63576ff7d3 Add app hibernation service stubs
Add app hibernation system service and manager class and start it when
app hibernation flag is enabled.

The actual API is currently stubbed and will be implemented in further
CLs.

Bug: 175829330
Test: adb shell device_config put app_hibernation
app_hibernation_enabled true
adb reboot
adb shell services list

Change-Id: Ide2758d3eaabae7d3df6356d4b6435c5137c554d
2021-01-13 16:43:11 -08:00
Kevin Han
2a5c2ee653 Add OWNERS files for app hibernation
Add OWNERS in services/core/java/com/android/server/apphibernation for
system service code and core/java/android/apphibernation/OWNERS for
client-facing code.

Bug: 175829330
Test: builds
Change-Id: I76d95309b641d9e75e68a50c6563df9f95b9c142
2021-01-07 14:55:00 -08:00