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

Commit 5f0e438b authored by Suchi Amalapurapu's avatar Suchi Amalapurapu Committed by Android Git Automerger
Browse files

am 3d802ef7: am aa4db173: am 9a212adc: Fix 2641875 Initialize the cache path...

am 3d802ef7: am aa4db173: am 9a212adc: Fix 2641875 Initialize the cache path only if the container exists. This did exist before but was somehow removed. Fix a known test failure as well.
parents 634e9a12 3d802ef7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1444,7 +1444,7 @@ public class PackageManagerTests extends AndroidTestCase {
        int result = PackageManager.MOVE_FAILED_FORWARD_LOCKED;
        sampleMoveFromRawResource(installFlags, moveFlags, fail, result);
    }
    //TODO: To be reenabled after investigation
    @MediumTest
    public void testMoveAppFailInternalToExternalDelete() {
        int installFlags = 0;
        int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA;
@@ -1461,7 +1461,8 @@ public class PackageManagerTests extends AndroidTestCase {
            ip = installFromRawResource("install.apk", R.raw.install, installFlags, false,
                    false, -1, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
            // Delete the package now retaining data.
            pm.deletePackage(ip.pkg.packageName, null, PackageManager.DONT_DELETE_DATA);
            GenericReceiver receiver = new DeleteReceiver(ip.pkg.packageName);
            invokeDeletePackage(ip.pkg.packageName, PackageManager.DONT_DELETE_DATA, receiver);
            assertTrue(invokeMovePackageFail(ip.pkg.packageName, moveFlags, result));
        } catch (Exception e) {
            failStr(e);
+3 −1
Original line number Diff line number Diff line
@@ -5082,7 +5082,8 @@ class PackageManagerService extends IPackageManager.Stub {
        }
    }

    private InstallArgs createInstallArgs(Uri packageURI, int flags, String pkgName) {
    private InstallArgs createInstallArgs(Uri packageURI, int flags,
            String pkgName) {
        if (installOnSd(flags)) {
            String cid = getNextCodePath(null, pkgName, "/" + SdInstallArgs.RES_FILE_NAME);
            return new SdInstallArgs(packageURI, cid);
@@ -5342,6 +5343,7 @@ class PackageManagerService extends IPackageManager.Stub {
        SdInstallArgs(String cid) {
            super(null, null, PackageManager.INSTALL_EXTERNAL, null);
            this.cid = cid;
            cachePath = PackageHelper.getSdDir(cid);
        }

        SdInstallArgs(Uri packageURI, String cid) {