Merge changes I72996d88,I2be08aa1 into udc-dev

* changes:
  Referring to manifest attribute for updateowner
  Turn on update owner enforcement by default
This commit is contained in:
Patrick Baumann
2023-04-05 19:26:26 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 1 deletions

View File

@@ -2991,6 +2991,10 @@ public class PackageInstaller {
* The update ownership enforcement can only be enabled on initial installation. Set * The update ownership enforcement can only be enabled on initial installation. Set
* this to {@code true} on package update is a no-op. * this to {@code true} on package update is a no-op.
* *
* Apps may opt themselves out of update ownership by setting the
* <a href="https://developer.android.com/guide/topics/manifest/manifest-element.html#allowupdateownership">android:alllowUpdateOwnership</a>
* attribute in their manifest to <code>false</code>.
*
* Note: To enable the update ownership enforcement, the installer must have the * Note: To enable the update ownership enforcement, the installer must have the
* {@link android.Manifest.permission#ENFORCE_UPDATE_OWNERSHIP ENFORCE_UPDATE_OWNERSHIP} * {@link android.Manifest.permission#ENFORCE_UPDATE_OWNERSHIP ENFORCE_UPDATE_OWNERSHIP}
* permission. * permission.

View File

@@ -7273,7 +7273,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
return DeviceConfig.getBoolean(NAMESPACE_PACKAGE_MANAGER_SERVICE, return DeviceConfig.getBoolean(NAMESPACE_PACKAGE_MANAGER_SERVICE,
PROPERTY_IS_UPDATE_OWNERSHIP_ENFORCEMENT_AVAILABLE, false /* defaultValue */); PROPERTY_IS_UPDATE_OWNERSHIP_ENFORCEMENT_AVAILABLE, true /* defaultValue */);
} finally { } finally {
Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token);
} }