Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2dd2cbcb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Sync PRIV_APP_OOB_ENABLED setting to pm.dexopt.priv-apps-oob"

parents 53ef795e 12633114
Loading
Loading
Loading
Loading
+20 −1
Original line number Original line Diff line number Diff line
@@ -551,6 +551,8 @@ public class PackageManagerService extends IPackageManager.Stub
    private static final String VENDOR_OVERLAY_DIR = "/vendor/overlay";
    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 */
    /** Canonical intent used to identify what counts as a "web browser" app */
    private static final Intent sBrowserIntent;
    private static final Intent sBrowserIntent;
    static {
    static {
@@ -9598,7 +9600,7 @@ public class PackageManagerService extends IPackageManager.Stub
        if (Build.IS_DEBUGGABLE &&
        if (Build.IS_DEBUGGABLE &&
                pkg.isPrivileged() &&
                pkg.isPrivileged() &&
                SystemProperties.getBoolean("pm.dexopt.priv-apps-oob", false)) {
                SystemProperties.getBoolean(PROPERTY_NAME_PM_DEXOPT_PRIV_APPS_OOB, false)) {
            PackageManagerServiceUtils.logPackageHasUncompressedCode(pkg);
            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);
                        .getUriFor(Secure.INSTANT_APPS_ENABLED), false, co, UserHandle.USER_SYSTEM);
        co.onChange(true);
        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
        // Disable any carrier apps. We do this very early in boot to prevent the apps from being
        // disabled after already being started.
        // disabled after already being started.
        CarrierAppUtils.disableCarrierAppsUntilPrivileged(mContext.getOpPackageName(), this,
        CarrierAppUtils.disableCarrierAppsUntilPrivileged(mContext.getOpPackageName(), this,