Sync PRIV_APP_OOB_ENABLED setting to pm.dexopt.priv-apps-oob
The settings value is used as a proxy for server side experiment to
populate configuration to the device. This is only for experiment and
should be removed later.
Test: adb shell settings put global priv_app_oob_enabled 0
# saw pm.dexopt.priv-apps-oob changed to false
Test: adb shell settings put global priv_app_oob_enabled 1
# saw pm.dexopt.priv-apps-oob changed to true
Bug: 67415855
Bug: 63920015
Change-Id: I4eb2beb14cd2c86c4bfc439d9742e95d3aba45a9
This commit is contained in:
@@ -551,6 +551,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
|
||||
private static final String VENDOR_OVERLAY_DIR = "/vendor/overlay";
|
||||
|
||||
private static final String PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB = "pm.dexopt.priv-apps-oob";
|
||||
|
||||
/** Canonical intent used to identify what counts as a "web browser" app */
|
||||
private static final Intent sBrowserIntent;
|
||||
static {
|
||||
@@ -9598,7 +9600,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
|
||||
if (Build.IS_DEBUGGABLE &&
|
||||
pkg.isPrivileged() &&
|
||||
SystemProperties.getBoolean("pm.dexopt.priv-apps-oob", false)) {
|
||||
SystemProperties.getBoolean(PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB, false)) {
|
||||
PackageManagerServiceUtils.logPackageHasUncompressedCode(pkg);
|
||||
}
|
||||
|
||||
@@ -19900,6 +19902,23 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
|
||||
.getUriFor(Secure.INSTANT_APPS_ENABLED), false, co, UserHandle.USER_SYSTEM);
|
||||
co.onChange(true);
|
||||
|
||||
// This observer provides an one directional mapping from Global.PRIV_APP_OOB_ENABLED to
|
||||
// pm.dexopt.priv-apps-oob property. This is only for experiment and should be removed once
|
||||
// it is done.
|
||||
ContentObserver privAppOobObserver = new ContentObserver(mHandler) {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
int oobEnabled = Global.getInt(resolver, Global.PRIV_APP_OOB_ENABLED, 0);
|
||||
SystemProperties.set(PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB,
|
||||
oobEnabled == 1 ? "true" : "false");
|
||||
}
|
||||
};
|
||||
mContext.getContentResolver().registerContentObserver(
|
||||
Global.getUriFor(Global.PRIV_APP_OOB_ENABLED), false, privAppOobObserver,
|
||||
UserHandle.USER_SYSTEM);
|
||||
// At boot, restore the value from the setting, which persists across reboot.
|
||||
privAppOobObserver.onChange(true);
|
||||
|
||||
// Disable any carrier apps. We do this very early in boot to prevent the apps from being
|
||||
// disabled after already being started.
|
||||
CarrierAppUtils.disableCarrierAppsUntilPrivileged(mContext.getOpPackageName(), this,
|
||||
|
||||
Reference in New Issue
Block a user