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

Commit 0af30527 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Cleanup app data folder for the user as part of reconcile."

parents 7e1a23b9 7c3a3a8f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -377,6 +377,12 @@ final class AppDataHelper {
                + Integer.toHexString(flags) + " migrateAppData=" + migrateAppData);
        List<String> result = onlyCoreApps ? new ArrayList<>() : null;

        try {
            mInstaller.cleanupInvalidPackageDirs(volumeUuid, userId, flags);
        } catch (Installer.InstallerException e) {
            logCriticalInfo(Log.WARN, "Failed to cleanup deleted dirs: " + e);
        }

        final File ceDir = Environment.getDataUserCeDirectory(volumeUuid, userId);
        final File deDir = Environment.getDataUserDeDirectory(volumeUuid, userId);

+14 −0
Original line number Diff line number Diff line
@@ -357,6 +357,20 @@ public class Installer extends SystemService {
        }
    }

    /**
     * Remove all invalid dirs under app data folder.
     * All dirs are supposed to be valid file and package names.
     */
    public void cleanupInvalidPackageDirs(String uuid, int userId, int flags)
            throws InstallerException {
        if (!checkBeforeRemote()) return;
        try {
            mInstalld.cleanupInvalidPackageDirs(uuid, userId, flags);
        } catch (Exception e) {
            throw InstallerException.from(e);
        }
    }

    public void moveCompleteApp(String fromUuid, String toUuid, String packageName,
            int appId, String seInfo, int targetSdkVersion,
            String fromCodePath) throws InstallerException {