This reverts commit bdcc111625.
Reason for revert: It has been decided to not move forward with this experiment.
Change-Id: If52a2bb8ba57fd60ba736a5d23a254e72d78645b
This CL extends the downgrade functionality introduced earlier that was using
only sysprop for enabling the feature and adds DeviceConfig flags that allow
remote configuration. The SystemProperties used before are not removed and
used in case the DeviceConfig flag for enabling the feature is false and the
sysprop is set.
Manual testing:
1. Set the required flags (adb shell device_config put
package_manager_service downgrade_unused_apps_enabled "true" and adb shell
device_config put package_manager_service inactive_app_threshold_days "10")
2. Device should have less than 1 GB free space (use fallocate to create big
files)
3. Device has an app not used in the last 10 days: e.g. com.facebook.katana
4. Check compilation filter using adb shell dumpsys package com.facebook.katana
(should be speed-profile)
5. Run adb shell cmd package bg-dexopt-job
6. Check again compilation filter, should be verify
Bug: 139047287
Test: Integration tests added and manual testing
Change-Id: I874a0f82e9488fe1334b6c021cec865f4274b15a
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