To allow testing, and work on rooted userdebug devices, allow the root
user to issue package bg-dexopt commands.
Bug: 111798412
Test: atest BackgroundDexOptServiceIntegrationTests
Change-Id: I5f52b8322ba386c797a9176a1b216cc547c66456
- Ensure that calling uid is shell.
- Clear calling identity such that we don't get permission
failures when calling getCurrentUser()
Test: self
Change-Id: Ifbaceb47edbbc4a6b002d49411ca4635ffc33a08
Fixes: 111798412
Add three tests:
1. Under normal conditions, check that dexopt upgrades test app to
$(getprop pm.dexopt.bg-dexopt).
2. Under low storage conditions and package is unused, check
that dexopt downgrades test app to $(getprop pm.dexopt.inactive).
3. Under low storage conditions and package is recently used, check
that dexopt upgrades test app to $(getprop pm.dexopt.bg-dexopt).
Test: atest -v BackgroundDexOptServiceIntegrationTests
BUG: 64807719
Change-Id: Iaa50d5120ea0255b38226bda0452e7e47f1ff5d0