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

Commit bdbc925a authored by Kenny Root's avatar Kenny Root
Browse files

resolved conflicts for merge of b0903104 to master

Change-Id: Iff20980c44d42b41ae411c4201e0927cee19d415
parents 5f551ef6 b0903104
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -731,20 +731,32 @@ class PackageManagerService extends IPackageManager.Stub {
        }
    }

    void cleanupInstallFailedPackage(PackageSetting pkgSettings) {
    void cleanupInstallFailedPackage(PackageSetting ps) {
        Log.i(TAG, "Cleaning up incompletely installed app: " + ps.name);
        if (mInstaller != null) {
            boolean useSecureFS = useEncryptedFilesystemForPackage(pkgSettings.pkg);
            int retCode = mInstaller.remove(pkgSettings.name, useSecureFS);
            boolean useSecureFS = useEncryptedFilesystemForPackage(ps.pkg);
            int retCode = mInstaller.remove(ps.name, useSecureFS);
            if (retCode < 0) {
                Log.w(TAG, "Couldn't remove app data directory for package: "
                           + pkgSettings.name + ", retcode=" + retCode);
                           + ps.name + ", retcode=" + retCode);
            }
        } else {
            //for emulator
            File dataDir = new File(pkgSettings.pkg.applicationInfo.dataDir);
            PackageParser.Package pkg = mPackages.get(ps.name);
            File dataDir = new File(pkg.applicationInfo.dataDir);
            dataDir.delete();
        }
        mSettings.removePackageLP(pkgSettings.name);
        if (ps.codePath != null) {
            if (!ps.codePath.delete()) {
                Log.w(TAG, "Unable to remove old code file: " + ps.codePath);
            }
        }
        if (ps.resourcePath != null) {
            if (!ps.resourcePath.delete() && !ps.resourcePath.equals(ps.codePath)) {
                Log.w(TAG, "Unable to remove old code file: " + ps.resourcePath);
            }
        }
        mSettings.removePackageLP(ps.name);
    }

    void readPermissions() {