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

Commit 341669af authored by Songchun Fan's avatar Songchun Fan Committed by Song Chun Fan
Browse files

[RESTRICT AUTOMERGE][pm] still allow debuggable for system app downgrades

Turns out we do have internal tests that downgrades system apps, so adding this exception to allow for that.

BUG: 267232653
BUG: 256202273

Test: manual
Change-Id: Ie281bbdc8788ee64ff99a7c5150da7ce7926235e
(cherry picked from commit ceeca68b)
parent 0f29716a
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -15003,6 +15003,9 @@ public class PackageManagerService extends IPackageManager.Stub
                        if (disabledPs != null) {
                            dataOwnerPkg = disabledPs.pkg;
                        }
                        if (!Build.IS_DEBUGGABLE && !dataOwnerPkg.isDebuggable()) {
                            // Only restrict non-debuggable builds and non-debuggable version of
                            // the app
                            try {
                                checkDowngrade(dataOwnerPkg, pkgLite);
                            } catch (PackageManagerException e) {
@@ -15015,6 +15018,7 @@ public class PackageManagerService extends IPackageManager.Stub
                            }
                        }
                    }
                }
                if (installedPkg != null) {
                    if ((installFlags & PackageManager.INSTALL_REPLACE_EXISTING) != 0) {