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

Commit dbd81bcb authored by Songchun Fan's avatar Songchun Fan Committed by Automerger Merge Worker
Browse files

[RESTRICT AUTOMERGE][pm] still allow debuggable for system app downgrades am: 14a91d2b

parents 9fff87e4 14a91d2b
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -2473,12 +2473,15 @@ final class InstallPackageHelper {
                    if (disabledPs != null) {
                        dataOwnerPkg = disabledPs.getPkg();
                    }
                    if (!Build.IS_DEBUGGABLE && !dataOwnerPkg.isDebuggable()) {
                        // Only restrict non-debuggable builds and non-debuggable version of the app
                        try {
                            PackageManagerServiceUtils.checkDowngrade(dataOwnerPkg, pkgLite);
                        } catch (PackageManagerException e) {
                        String errorMsg = "System app: " + packageName + " cannot be downgraded to"
                                + " older than its preloaded version on the system image. "
                                + e.getMessage();
                            String errorMsg =
                                    "System app: " + packageName + " cannot be downgraded to"
                                            + " older than its preloaded version on the system"
                                            + " image. " + e.getMessage();
                            Slog.w(TAG, errorMsg);
                            return Pair.create(
                                    PackageManager.INSTALL_FAILED_VERSION_DOWNGRADE, errorMsg);
@@ -2486,6 +2489,7 @@ final class InstallPackageHelper {
                    }
                }
            }
        }
        return Pair.create(PackageManager.INSTALL_SUCCEEDED, null);
    }