From 7cdd20a7e20cacc9fb5fcc257e164c63b1718bfe Mon Sep 17 00:00:00 2001 From: Songchun Fan Date: Thu, 27 Apr 2023 08:30:57 -0700 Subject: [PATCH] [pm] allow debuggable apps to be downgraded on release builds By preserving the INSTALL_REQUEST_DOWNGRADE flag throughout the installation session, we can check whether the app is debuggable and downgradable at a later stage of the installation during isDowngradePermitted(). If the app is debuggable and the downgrade has been requested, the installation should be allowed. BUG: 272769908 Test: atest CtsPermissionTestCases android.permission.cts.LocationAccessCheckTest#notificationIsNotShownAfterAppDoesNotRequestLocationAnymore Change-Id: Ic5d9c7b65a70ba343a0bb1c5405537fc37f7ec8c --- .../core/java/com/android/server/pm/PackageInstallerService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java index f358ce796fcfa..1721f83538ff4 100644 --- a/services/core/java/com/android/server/pm/PackageInstallerService.java +++ b/services/core/java/com/android/server/pm/PackageInstallerService.java @@ -724,7 +724,6 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements params.installFlags |= PackageManager.INSTALL_ALLOW_DOWNGRADE; } else { params.installFlags &= ~PackageManager.INSTALL_ALLOW_DOWNGRADE; - params.installFlags &= ~PackageManager.INSTALL_REQUEST_DOWNGRADE; } if (mDisableVerificationForUid != INVALID_UID) {