Don't remove temporary missing package's user data.

If a package was installed on SD card, we don't want to remove it's user
data when SD card is removed.

Bug: 211944048
Test: presubmit
Change-Id: I440906ccb9ce8b3e510a25c6c2f51bff1e001658
This commit is contained in:
Alex Buynytskyy
2022-01-20 15:46:55 -08:00
parent 4812c71042
commit 62b193ca95

View File

@@ -476,13 +476,9 @@ final class AppDataHelper {
} else if (!ps.getInstalled(userId)) {
throw new PackageManagerException(
"Package " + packageName + " not installed for user " + userId);
} else if (ps.getPkg() == null) {
throw new PackageManagerException("Package " + packageName + " is not parsed yet");
} else {
if (!shouldHaveAppStorage(ps.getPkg())) {
throw new PackageManagerException(
"Package " + packageName + " shouldn't have storage");
}
} else if (ps.getPkg() != null && !shouldHaveAppStorage(ps.getPkg())) {
throw new PackageManagerException(
"Package " + packageName + " shouldn't have storage");
}
}
}