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

Commit 84e35ead authored by Kenny Root's avatar Kenny Root
Browse files

Delete old forward-locked apps on upgrade

The old style forward-locked apps were in a directory called
/data/app-private but the new style forward-locked apps are in ASEC
containers. This made the upgrade path confused and it wouldn't
correctly generate the InstallArgs to delete the old file.

Bug: 6619438
Change-Id: If4323fa8701d9fc653998f5db58670b4124b9e87
parent b7161f57
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -6140,7 +6140,22 @@ public class PackageManagerService extends IPackageManager.Stub {

    private InstallArgs createInstallArgs(int flags, String fullCodePath, String fullResourcePath,
            String nativeLibraryPath) {
        if (installOnSd(flags) || installForwardLocked(flags)) {
        final boolean isInAsec;
        if (installOnSd(flags)) {
            /* Apps on SD card are always in ASEC containers. */
            isInAsec = true;
        } else if (installForwardLocked(flags)
                && !fullCodePath.startsWith(mDrmAppPrivateInstallDir.getAbsolutePath())) {
            /*
             * Forward-locked apps are only in ASEC containers if they're the
             * new style
             */
            isInAsec = true;
        } else {
            isInAsec = false;
        }

        if (isInAsec) {
            return new AsecInstallArgs(fullCodePath, fullResourcePath, nativeLibraryPath,
                    installOnSd(flags), installForwardLocked(flags));
        } else {