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

Commit 2482315c authored by Chad Brubaker's avatar Chad Brubaker
Browse files

Remove downgrade check for targetSandboxLevel

This is causing issues with apps adopting Instant Apps and the security
requirements that lead to downgrade being disallowed were either
reverted in late O or moved into target API checks.

Change-Id: Ide3913091788d6a37bf2d17ca22769f6bbc6d3c7
Fixes: 80307033
Test: Install v2 sandbox APK, try and upgrade with a v1 sandbox APK.
parent 3d70d20c
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -17260,17 +17260,6 @@ public class PackageManagerService extends IPackageManager.Stub
                                        + "Persistent apps are not updateable.");
                        return;
                    }
                    // Prevent apps from downgrading their targetSandbox.
                    final int oldTargetSandbox = oldPackage.applicationInfo.targetSandboxVersion;
                    final int newTargetSandbox = pkg.applicationInfo.targetSandboxVersion;
                    if (oldTargetSandbox == 2 && newTargetSandbox != 2) {
                        res.setError(PackageManager.INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE,
                                "Package " + pkg.packageName + " new target sandbox "
                                + newTargetSandbox + " is incompatible with the previous value of"
                                + oldTargetSandbox + ".");
                        return;
                    }
                    // Prevent installing of child packages
                    if (oldPackage.parentPackage != null) {
                        res.setError(PackageManager.INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME,