From 2933d3df56f1c65f4e5e5f866e3f429f6f97b9d2 Mon Sep 17 00:00:00 2001 From: Matt Pape Date: Mon, 11 Mar 2019 15:42:55 -0700 Subject: [PATCH] Remove interface for dex_boot. Per API council feedback, we are making changes to include only the namespace in the system API defined in DeviceConfig.java. Strings which define property names should be defined in code local to the feature instead. Bug: 126411407 Test: atest FrameworksCoreTests:DeviceConfigTest atest FrameworksServicesTests:DexManagerTests Change-Id: I6af1b6f2d0071f800fa33efa2a548577635dd013 --- api/system-current.txt | 7 +------ core/java/android/provider/DeviceConfig.java | 20 ++++++++----------- .../com/android/server/pm/dex/DexManager.java | 10 +++++++--- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 232144fd3d162..8f7e165725b86 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5862,6 +5862,7 @@ package android.provider { field public static final String NAMESPACE_AUTOFILL = "autofill"; field public static final String NAMESPACE_CONNECTIVITY = "connectivity"; field public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture"; + field public static final String NAMESPACE_DEX_BOOT = "dex_boot"; field public static final String NAMESPACE_GAME_DRIVER = "game_driver"; field public static final String NAMESPACE_INPUT_NATIVE_BOOT = "input_native_boot"; field public static final String NAMESPACE_MEDIA_NATIVE = "media_native"; @@ -5877,12 +5878,6 @@ package android.provider { field public static final String SERVICE_ENABLED = "service_enabled"; } - public static interface DeviceConfig.DexBoot { - field public static final String NAMESPACE = "dex_boot"; - field public static final String PRIV_APPS_OOB_ENABLED = "priv_apps_oob_enabled"; - field public static final String PRIV_APPS_OOB_WHITELIST = "priv_apps_oob_whitelist"; - } - public static interface DeviceConfig.IntelligenceAttention { field public static final String ATTENTION_ENABLED = "attention_enabled"; field public static final String ATTENTION_SETTINGS = "attention_settings"; diff --git a/core/java/android/provider/DeviceConfig.java b/core/java/android/provider/DeviceConfig.java index e4593e55a2c64..3e7a11accfe9e 100644 --- a/core/java/android/provider/DeviceConfig.java +++ b/core/java/android/provider/DeviceConfig.java @@ -104,6 +104,14 @@ public final class DeviceConfig { @TestApi public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture"; + /** + * Namespace for how dex runs. The feature requires a reboot to reach a clean state. + * + * @hide + */ + @SystemApi + public static final String NAMESPACE_DEX_BOOT = "dex_boot"; + /** * Namespace for all Game Driver features. * @@ -289,18 +297,6 @@ public final class DeviceConfig { String RAMPING_RINGER_VIBRATION_DURATION = "ramping_ringer_vibration_duration"; } - /** - * Namespace for how dex runs. The feature may requires reboot to a clean state. - * - * @hide - */ - @SystemApi - public interface DexBoot { - String NAMESPACE = "dex_boot"; - String PRIV_APPS_OOB_ENABLED = "priv_apps_oob_enabled"; - String PRIV_APPS_OOB_WHITELIST = "priv_apps_oob_whitelist"; - } - /** * Namespace for {@link AttentionManagerService} related features. * diff --git a/services/core/java/com/android/server/pm/dex/DexManager.java b/services/core/java/com/android/server/pm/dex/DexManager.java index 3b805d5151788..f56231fc02afa 100644 --- a/services/core/java/com/android/server/pm/dex/DexManager.java +++ b/services/core/java/com/android/server/pm/dex/DexManager.java @@ -16,7 +16,7 @@ package com.android.server.pm.dex; -import static android.provider.DeviceConfig.DexBoot; +import static android.provider.DeviceConfig.NAMESPACE_DEX_BOOT; import static com.android.server.pm.InstructionSets.getAppDexInstructionSets; import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo; @@ -72,6 +72,10 @@ public class DexManager { private static final String PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB_LIST = "pm.dexopt.priv-apps-oob-list"; + // flags for Device Config API + private static final String PRIV_APPS_OOB_ENABLED = "priv_apps_oob_enabled"; + private static final String PRIV_APPS_OOB_WHITELIST = "priv_apps_oob_whitelist"; + private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private final Context mContext; @@ -713,8 +717,8 @@ public class DexManager { return isPackageSelectedToRunOobInternal( SystemProperties.getBoolean(PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB, false), SystemProperties.get(PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB_LIST, "ALL"), - DeviceConfig.getProperty(DexBoot.NAMESPACE, DexBoot.PRIV_APPS_OOB_ENABLED), - DeviceConfig.getProperty(DexBoot.NAMESPACE, DexBoot.PRIV_APPS_OOB_WHITELIST), + DeviceConfig.getProperty(NAMESPACE_DEX_BOOT, PRIV_APPS_OOB_ENABLED), + DeviceConfig.getProperty(NAMESPACE_DEX_BOOT, PRIV_APPS_OOB_WHITELIST), packageNamesInSameProcess); }