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

Commit e9492d2d authored by Jackal Guo's avatar Jackal Guo Committed by Android (Google) Code Review
Browse files

Merge "Add a switch for update ownership enforcement"

parents ccf864a8 abd1cc3a
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
    private static final String PROPERTY_KNOWN_DIGESTERS_LIST = "known_digesters_list";

    /**
     * Whether of not requesting the approval before committing sessions is available.
     * Whether or not requesting the approval before committing sessions is available.
     *
     * Flag type: {@code boolean}
     * Namespace: NAMESPACE_PACKAGE_MANAGER_SERVICE
@@ -507,6 +507,15 @@ public class PackageManagerService implements PackageSender, TestUtilityService
    private static final String PROPERTY_IS_PRE_APPROVAL_REQUEST_AVAILABLE =
            "is_preapproval_available";

    /**
     * Whether or not the update ownership enforcement is available.
     *
     * Flag type: {@code boolean}
     * Namespace: NAMESPACE_PACKAGE_MANAGER_SERVICE
     */
    private static final String PROPERTY_IS_UPDATE_OWNERSHIP_ENFORCEMENT_AVAILABLE =
            "is_update_ownership_enforcement_available";

    /**
     * The default response for package verification timeout.
     *
@@ -7074,6 +7083,16 @@ public class PackageManagerService implements PackageSender, TestUtilityService
        }
    }

    static boolean isUpdateOwnershipEnforcementAvailable() {
        final long token = Binder.clearCallingIdentity();
        try {
            return DeviceConfig.getBoolean(NAMESPACE_PACKAGE_MANAGER_SERVICE,
                    PROPERTY_IS_UPDATE_OWNERSHIP_ENFORCEMENT_AVAILABLE, false /* defaultValue */);
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }

    /**
     * Returns the array containing per-uid timeout configuration.
     * This is derived from DeviceConfig flags.