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

Commit 74c4f561 authored by William Loh's avatar William Loh Committed by Android (Google) Code Review
Browse files

Merge "Create app metadata folder only when needed" into main

parents c99b1a97 bdcce366
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1667,15 +1667,6 @@ public class PackageManagerServiceUtils {
        if (appMetadataFile.exists()) {
            return true;
        }
        if (isSystem) {
            try {
                makeDirRecursive(new File(appMetadataFilePath).getParentFile(), 0700);
            } catch (Exception e) {
                Slog.e(TAG, "Failed to create app metadata dir for package "
                        + pkg.getPackageName() + ": " + e.getMessage());
                return false;
            }
        }
        Map<String, Property> properties = pkg.getProperties();
        if (!properties.containsKey(PROPERTY_ANDROID_SAFETY_LABEL_PATH)) {
            return false;
@@ -1684,6 +1675,15 @@ public class PackageManagerServiceUtils {
        if (!fileInAPkPathProperty.isString()) {
            return false;
        }
        if (isSystem && !appMetadataFile.getParentFile().exists()) {
            try {
                makeDirRecursive(appMetadataFile.getParentFile(), 0700);
            } catch (Exception e) {
                Slog.e(TAG, "Failed to create app metadata dir for package "
                        + pkg.getPackageName() + ": " + e.getMessage());
                return false;
            }
        }
        String fileInApkPath = fileInAPkPathProperty.getString();
        List<AndroidPackageSplit> splits = pkg.getSplits();
        for (int i = 0; i < splits.size(); i++) {