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

Commit 6e67aa16 authored by Winson Chiu's avatar Winson Chiu
Browse files

Expose PackageState#getSeInfo

Exposed through PackageState instead of AndroidPackage so that the
overrideSeInfo can be applied through PackageState instead of
exposing the value separately and relying on the caller to apply
the override.

This also moves the backing field into PackageSetting, since
there's no reason to keep it in PackageImpl now. It's always
re-set on package scan.

Bug: 254029037

Change-Id: I703a45a86d9c7b4e27f225b3cf2c66427744c32a
parent 505fefbe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ package com.android.server.pm.pkg {
    method public int getAppId();
    method @NonNull public String getPackageName();
    method @Nullable public String getPrimaryCpuAbi();
    method @Nullable public String getSeInfo();
    method @Nullable public String getSecondaryCpuAbi();
    method @NonNull public com.android.server.pm.pkg.PackageUserState getStateForUser(@NonNull android.os.UserHandle);
    method @NonNull public java.util.List<com.android.server.pm.pkg.SharedLibrary> getUsesLibraries();
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ public class AppDataHelper {

        final int appId = UserHandle.getAppId(pkg.getUid());

        String pkgSeInfo = AndroidPackageUtils.getSeInfo(pkg, ps);
        String pkgSeInfo = ps.getSeInfo();

        Preconditions.checkNotNull(pkgSeInfo);

+1 −1
Original line number Diff line number Diff line
@@ -763,7 +763,7 @@ final class InstallPackageHelper {
                || (installFlags & PackageManager.INSTALL_REQUEST_DOWNGRADE) != 0);

        if (ps != null && doSnapshotOrRestore) {
            final String seInfo = AndroidPackageUtils.getSeInfo(request.getPkg(), ps);
            final String seInfo = ps.getSeInfo();
            final RollbackManagerInternal rollbackManager =
                    mInjector.getLocalService(RollbackManagerInternal.class);
            rollbackManager.snapshotAndRestoreUserData(packageName,
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ public final class MovePackageHelper {
        final InstallSource installSource = packageState.getInstallSource();
        final String packageAbiOverride = packageState.getCpuAbiOverride();
        final int appId = UserHandle.getAppId(pkg.getUid());
        final String seinfo = AndroidPackageUtils.getSeInfo(pkg, packageState);
        final String seinfo = packageState.getSeInfo();
        final String label = String.valueOf(pm.getApplicationLabel(
                AndroidPackageUtils.generateAppInfoWithoutState(pkg)));
        final int targetSdkVersion = pkg.getTargetSdkVersion();
+1 −1
Original line number Diff line number Diff line
@@ -493,7 +493,7 @@ public class PackageDexOptimizer {
            // TODO: Consider adding 2 different APIs for primary and secondary dexopt.
            // installd only uses downgrade flag for secondary dex files and ignores it for
            // primary dex files.
            String seInfo = AndroidPackageUtils.getSeInfo(pkg, pkgSetting);
            String seInfo = pkgSetting.getSeInfo();
            boolean completed = getInstallerLI().dexopt(path, uid, pkg.getPackageName(), isa,
                    dexoptNeeded, oatDir, dexoptFlags, compilerFilter, pkg.getVolumeUuid(),
                    classLoaderContext, seInfo, /* downgrade= */ false ,
Loading