From d378c630bb70689240329d4736680df717f1c8de Mon Sep 17 00:00:00 2001 From: Jackal Guo Date: Wed, 21 Dec 2022 15:11:48 +0800 Subject: [PATCH] Add new manifest attr allowUpdateOwnership (4/n) Setting this new attr to false indicates to the platform that this package wants to opt-out of the update ownership enforcement. This overrides the installers' use of setRequestUpdateOwnership. Bug: 244413073 Test: atest PackageManagerServiceUnitTests:AndroidPackageTest Test: atest CtsPackageInstallTestCases:UpdateOwnershipEnforcementTest Change-Id: I4b3e851b87a25583a7c43b40a7fad07ad46c3761 --- core/api/current.txt | 1 + core/res/res/values/attrs_manifest.xml | 9 +++++++++ core/res/res/values/public-staging.xml | 1 + .../com/android/server/pm/InstallPackageHelper.java | 4 ++++ .../android/server/pm/parsing/pkg/PackageImpl.java | 11 +++++++++++ .../com/android/server/pm/pkg/AndroidPackage.java | 6 ++++++ .../android/server/pm/pkg/parsing/ParsingPackage.java | 2 ++ .../server/pm/pkg/parsing/ParsingPackageUtils.java | 5 ++++- .../pm/test/parsing/parcelling/AndroidPackageTest.kt | 1 + 9 files changed, 39 insertions(+), 1 deletion(-) diff --git a/core/api/current.txt b/core/api/current.txt index 1acab8a443b05..8b7db18980327 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -385,6 +385,7 @@ package android { field public static final int allowTaskReparenting = 16843268; // 0x1010204 field public static final int allowUndo = 16843999; // 0x10104df field public static final int allowUntrustedActivityEmbedding = 16844393; // 0x1010669 + field public static final int allowUpdateOwnership; field public static final int alpha = 16843551; // 0x101031f field public static final int alphabeticModifiers = 16844110; // 0x101054e field public static final int alphabeticShortcut = 16843235; // 0x10101e3 diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index 8ac13efba7008..ef94484f8de62 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -1783,6 +1783,14 @@ --> + + +