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

Commit e15d6c04 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am 5ea08853: am 294d1eeb: am 026457a4: am 64e26348: am 0d616883: Merge "Fix...

am 5ea08853: am 294d1eeb: am 026457a4: am 64e26348: am 0d616883: Merge "Fix moving of apps into legacy ASEC." into mnc-dev

* commit '5ea08853':
  Fix moving of apps into legacy ASEC.
parents 101d93bf 5ea08853
Loading
Loading
Loading
Loading
+18 −10
Original line number Original line Diff line number Diff line
@@ -15926,10 +15926,15 @@ public class PackageManagerService extends IPackageManager.Stub {
                        "Cannot move system application");
                        "Cannot move system application");
            }
            }
            if (Objects.equals(ps.volumeUuid, volumeUuid)) {
            if (pkg.applicationInfo.isExternalAsec()) {
                throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR,
                currentAsec = true;
                        "Package already moved to " + volumeUuid);
                currentVolumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
            }
            } else if (pkg.applicationInfo.isForwardLocked()) {
                currentAsec = true;
                currentVolumeUuid = "forward_locked";
            } else {
                currentAsec = false;
                currentVolumeUuid = ps.volumeUuid;
                final File probe = new File(pkg.codePath);
                final File probe = new File(pkg.codePath);
                final File probeOat = new File(probe, "oat");
                final File probeOat = new File(probe, "oat");
@@ -15937,6 +15942,12 @@ public class PackageManagerService extends IPackageManager.Stub {
                    throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR,
                    throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR,
                            "Move only supported for modern cluster style installs");
                            "Move only supported for modern cluster style installs");
                }
                }
            }
            if (Objects.equals(currentVolumeUuid, volumeUuid)) {
                throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR,
                        "Package already moved to " + volumeUuid);
            }
            if (ps.frozen) {
            if (ps.frozen) {
                throw new PackageManagerException(MOVE_FAILED_OPERATION_PENDING,
                throw new PackageManagerException(MOVE_FAILED_OPERATION_PENDING,
@@ -15944,9 +15955,6 @@ public class PackageManagerService extends IPackageManager.Stub {
            }
            }
            ps.frozen = true;
            ps.frozen = true;
            currentAsec = pkg.applicationInfo.isForwardLocked()
                    || pkg.applicationInfo.isExternalAsec();
            currentVolumeUuid = ps.volumeUuid;
            codeFile = new File(pkg.codePath);
            codeFile = new File(pkg.codePath);
            installerPackageName = ps.installerPackageName;
            installerPackageName = ps.installerPackageName;
            packageAbiOverride = ps.cpuAbiOverrideString;
            packageAbiOverride = ps.cpuAbiOverrideString;