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

Commit 7cdd20a7 authored by Songchun Fan's avatar Songchun Fan
Browse files

[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
parent c31d0bea
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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) {