Cleanup app data folder for the user as part of reconcile.
Bug: 162757029 Fixes: 162757029 Test: presubmit Change-Id: If3f10117cef28afe1dcf28424254515c5c7c48b8
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user