Allow only selected priv apps to run OOB

- Add pm.dexopt.priv-apps-oob-list to allow selecting specific packages
  to run OOB, in a comma-separated string of package names. When set to
  "ALL" (default), all priv apps will run in OOB.
- Add a global config priv_app_oob_list to persist the state for
  experiment.
- Also make background dexopt to respect the config.

Test: 0. Reset previous OOB settings.
      1. settings put global priv_app_oob_list \
         com.google.android.gms,com.android.vending
      2. cmd package compile -m speed -f com.google.android.gms (then
         com.android.vending, com.google.android.googlequicksearchbox)
      3. dumpsys package dexopt
         # .vending and .gms are "verify", .googlequicksearchbox is
         # "speed".
Test: settings put global priv_app_oob_list 'ALL'  # see the same result
Test: settings delete global priv_app_oob_list  # see the same result
Test: atest SettingsBackupTest
Bug: 30972906
Bug: 63920015
Change-Id: Iba47b4763a026cdc94939db0a743822278917269
This commit is contained in:
Victor Hsieh
2018-04-19 14:26:28 -07:00
parent 8ea760c815
commit 785d618b1a
8 changed files with 179 additions and 92 deletions

View File

@@ -8901,6 +8901,14 @@ public final class Settings {
*/
public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled";
/**
* Comma separated list of privileged package names, which will be running out-of-box APK.
* Default: "ALL"
*
* @hide
*/
public static final String PRIV_APP_OOB_LIST = "priv_app_oob_list";
/**
* The interval in milliseconds at which location requests will be throttled when they are
* coming from the background.