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

Commit d82ea4bd authored by Rhed Jao's avatar Rhed Jao Committed by Android (Google) Code Review
Browse files

Merge "Only allow the system or shell to delete oat artifacts"

parents 412558e9 a8670dfd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6760,6 +6760,9 @@ public class PackageManagerService implements PackageSender, TestUtilityService
    }

    long deleteOatArtifactsOfPackage(@NonNull Computer snapshot, String packageName) {
        PackageManagerServiceUtils.enforceSystemOrRootOrShell(
                "Only the system or shell can delete oat artifacts");

        PackageStateInternal packageState = snapshot.getPackageStateInternal(packageName);
        if (packageState == null || packageState.getPkg() == null) {
            return -1; // error code of deleteOptimizedFiles