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

Commit de7ba680 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Fix PackageSetting isUpdatedSystemApp and SYSTEM_EXT rescan" into rvc-dev am: 1fd15d20

Change-Id: I61860d8234a4477acfd55e3778329fa531a19519
parents 53aa8b8d 1fd15d20
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -10969,10 +10969,10 @@ public class PackageManagerService extends IPackageManager.Stub
            // to null here, only to reset them at a later point.
            Settings.updatePackageSetting(pkgSetting, disabledPkgSetting, sharedUserSetting,
                    destCodeFile, destResourceFile, parsedPackage.getNativeLibraryDir(),
                    AndroidPackageUtils.getRawPrimaryCpuAbi(parsedPackage),
                    AndroidPackageUtils.getRawSecondaryCpuAbi(parsedPackage),
                    PackageInfoWithoutStateUtils.appInfoFlags(parsedPackage),
                    PackageInfoWithoutStateUtils.appInfoPrivateFlags(parsedPackage),
                    AndroidPackageUtils.getPrimaryCpuAbi(parsedPackage, pkgSetting),
                    AndroidPackageUtils.getSecondaryCpuAbi(parsedPackage, pkgSetting),
                    PackageInfoUtils.appInfoFlags(parsedPackage, pkgSetting),
                    PackageInfoUtils.appInfoPrivateFlags(parsedPackage, pkgSetting),
                    UserManagerService.getInstance(),
                    usesStaticLibraries, parsedPackage.getUsesStaticLibrariesVersions(),
                    parsedPackage.getMimeGroups());
@@ -11164,6 +11164,8 @@ public class PackageManagerService extends IPackageManager.Stub
        // TODO(b/135203078): Remove, move to constructor
        pkgSetting.pkg = parsedPackage;
        pkgSetting.pkgFlags = PackageInfoUtils.appInfoFlags(parsedPackage, pkgSetting);
        pkgSetting.pkgPrivateFlags =
                PackageInfoUtils.appInfoPrivateFlags(parsedPackage, pkgSetting);
        if (parsedPackage.getLongVersionCode() != pkgSetting.versionCode) {
            pkgSetting.versionCode = parsedPackage.getLongVersionCode();
        }
@@ -16954,6 +16956,7 @@ public class PackageManagerService extends IPackageManager.Stub
                    final boolean vendor = oldPackage.isVendor();
                    final boolean product = oldPackage.isProduct();
                    final boolean odm = oldPackage.isOdm();
                    final boolean systemExt = oldPackage.isSystemExt();
                    final @ParseFlags int systemParseFlags = parseFlags;
                    final @ScanFlags int systemScanFlags = scanFlags
                            | SCAN_AS_SYSTEM
@@ -16961,14 +16964,14 @@ public class PackageManagerService extends IPackageManager.Stub
                            | (oem ? SCAN_AS_OEM : 0)
                            | (vendor ? SCAN_AS_VENDOR : 0)
                            | (product ? SCAN_AS_PRODUCT : 0)
                            | (odm ? SCAN_AS_ODM : 0);
                            | (odm ? SCAN_AS_ODM : 0)
                            | (systemExt ? SCAN_AS_SYSTEM_EXT : 0);
                    if (DEBUG_INSTALL) {
                        Slog.d(TAG, "replaceSystemPackageLI: new=" + parsedPackage
                                + ", old=" + oldPackage);
                    }
                    res.setReturnCode(PackageManager.INSTALL_SUCCEEDED);
                    ps.getPkgState().setUpdatedSystemApp(true);
                    targetParseFlags = systemParseFlags;
                    targetScanFlags = systemScanFlags;
                } else { // non system replace
+3 −0
Original line number Diff line number Diff line
@@ -521,6 +521,9 @@ public final class Settings {
                p.secondaryCpuAbiString, p.cpuAbiOverrideString,
                p.appId, p.versionCode, p.pkgFlags, p.pkgPrivateFlags,
                p.usesStaticLibraries, p.usesStaticLibrariesVersions, p.mimeGroups);
        if (ret != null) {
            ret.getPkgState().setUpdatedSystemApp(false);
        }
        mDisabledSysPackages.remove(name);
        return ret;
    }
+1 −1
Original line number Diff line number Diff line
@@ -2794,7 +2794,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
            }

            if ((changedInstallPermission || replace) && !ps.areInstallPermissionsFixed() &&
                    !ps.isSystem() || !ps.getPkgState().isUpdatedSystemApp()) {
                    !ps.isSystem() || ps.getPkgState().isUpdatedSystemApp()) {
                // This is the first that we have heard about this package, so the
                // permissions we have now selected are fixed until explicitly
                // changed.
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ import java.util.List;
 *
 * It is assumed that anything inside the package was not cached or written to disk, so none of
 * these fields are either. They must be set on every boot from other state on the device.
 *
 * These fields are also not copied into any cloned PackageSetting, to preserve the old behavior
 * where they would be lost implicitly by re-generating the package object.
 */
@DataClass(genSetters = true, genConstructor = false, genBuilder = false)
public class PackageStateUnserialized {