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

Commit 030c6bd1 authored by Joanne Chung's avatar Joanne Chung Committed by Android (Google) Code Review
Browse files

Merge "Fix SdkSandboxStorageHostTest" into main

parents f0e50c66 10234269
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.PatternMatcher;
import android.os.PersistableBundle;
import android.os.Process;
import android.os.SELinux;
import android.os.SystemClock;
import android.os.Trace;
@@ -3189,6 +3190,9 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
            pkg.isScannedAsStoppedSystemApp());
        if (!pkg.hasSharedUser()) {
            serializer.attributeInt(null, "userId", pkg.getAppId());

            serializer.attributeBoolean(null, "isSdkLibrary",
                    pkg.getAndroidPackage() != null && pkg.getAndroidPackage().isSdkLibrary());
        } else {
            serializer.attributeInt(null, "sharedUserId", pkg.getAppId());
        }
@@ -4039,10 +4043,12 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
        int targetSdkVersion = 0;
        byte[] restrictUpdateHash = null;
        boolean isScannedAsStoppedSystemApp = false;
        boolean isSdkLibrary = false;
        try {
            name = parser.getAttributeValue(null, ATTR_NAME);
            realName = parser.getAttributeValue(null, "realName");
            appId = parseAppId(parser);
            isSdkLibrary = parser.getAttributeBoolean(null, "isSdkLibrary", false);
            sharedUserAppId = parseSharedUserAppId(parser);
            codePathStr = parser.getAttributeValue(null, "codePath");

@@ -4157,7 +4163,8 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
                PackageManagerService.reportSettingsProblem(Log.WARN,
                        "Error in package manager settings: <package> has no codePath at "
                                + parser.getPositionDescription());
            } else if (appId > 0) {
            } else if (appId > 0 || (appId == Process.INVALID_UID && isSdkLibrary
                    && Flags.disallowSdkLibsToBeApps())) {
                packageSetting = addPackageLPw(name.intern(), realName, new File(codePathStr),
                        appId, pkgFlags, pkgPrivateFlags, domainSetId);
                if (PackageManagerService.DEBUG_SETTINGS)