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

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

Merge "Signal ASL in APK with manifest property" into main

parents 77864c64 efe45ee4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -266,6 +266,15 @@ public abstract class PackageManager {
    public static final String PROPERTY_LEGACY_UPDATE_OWNERSHIP_DENYLIST =
            "android.app.PROPERTY_LEGACY_UPDATE_OWNERSHIP_DENYLIST";

    /**
     * Application level {@link android.content.pm.PackageManager.Property PackageManager
     * .Property} for a app to inform the installer that a file containing the app's android
     * safety label data is bundled into the APK at the given path.
     * @hide
     */
    public static final String PROPERTY_ANDROID_SAFETY_LABEL_PATH =
            "android.content.SAFETY_LABEL_PATH";

    /**
     * A property value set within the manifest.
     * <p>
+0 −15
Original line number Diff line number Diff line
@@ -421,8 +421,6 @@ public class PackageImpl implements ParsedPackage, AndroidPackageInternal,
    @NonNull
    private String[] mUsesStaticLibrariesSorted;

    private boolean mAppMetadataFileInApk = false;

    @NonNull
    public static PackageImpl forParsing(@NonNull String packageName, @NonNull String baseCodePath,
            @NonNull String codePath, @NonNull TypedArray manifestArray, boolean isCoreApp,
@@ -1065,11 +1063,6 @@ public class PackageImpl implements ParsedPackage, AndroidPackageInternal,
        return memtagMode;
    }

    @Override
    public boolean isAppMetadataFileInApk() {
        return mAppMetadataFileInApk;
    }

    @Nullable
    @Override
    public Bundle getMetaData() {
@@ -2157,12 +2150,6 @@ public class PackageImpl implements ParsedPackage, AndroidPackageInternal,
        return this;
    }

    @Override
    public PackageImpl setAppMetadataFileInApk(boolean fileInApk) {
        mAppMetadataFileInApk = fileInApk;
        return this;
    }

    @Override
    public PackageImpl setMetaData(@Nullable Bundle value) {
        metaData = value;
@@ -3277,7 +3264,6 @@ public class PackageImpl implements ParsedPackage, AndroidPackageInternal,
        dest.writeLong(this.mBooleans);
        dest.writeLong(this.mBooleans2);
        dest.writeBoolean(this.mAllowCrossUidActivitySwitchFromBelow);
        dest.writeBoolean(this.mAppMetadataFileInApk);
    }

    public PackageImpl(Parcel in) {
@@ -3445,7 +3431,6 @@ public class PackageImpl implements ParsedPackage, AndroidPackageInternal,
        this.mBooleans = in.readLong();
        this.mBooleans2 = in.readLong();
        this.mAllowCrossUidActivitySwitchFromBelow = in.readBoolean();
        this.mAppMetadataFileInApk = in.readBoolean();

        assignDerivedFields();
        assignDerivedFields2();
+0 −3
Original line number Diff line number Diff line
@@ -127,7 +127,4 @@ public interface ParsedPackage extends AndroidPackage {
    ParsedPackage setDirectBootAware(boolean directBootAware);

    ParsedPackage setPersistent(boolean persistent);

    /** Retrieves whether the apk contains a app metadata file. */
    boolean isAppMetadataFileInApk();
}
+0 −3
Original line number Diff line number Diff line
@@ -133,9 +133,6 @@ public interface ParsingPackage {
            @Nullable SparseArray<int[]> splitDependencies
    );

    /** Sets whether the apk contains a app metadata file. */
    ParsingPackage setAppMetadataFileInApk(boolean fileInApk);

    ParsingPackage setMetaData(Bundle metaData);

    ParsingPackage setForceQueryable(boolean forceQueryable);
+0 −10
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.ConfigurationInfo;
import android.content.pm.FeatureGroupInfo;
import android.content.pm.FeatureInfo;
import android.content.pm.Flags;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.Property;
@@ -134,7 +133,6 @@ import org.xmlpull.v1.XmlPullParserException;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.security.PublicKey;
@@ -165,8 +163,6 @@ public class ParsingPackageUtils {
     */
    public static final String ANDROID_MANIFEST_FILENAME = "AndroidManifest.xml";

    public static final String APP_METADATA_FILE_NAME = "app.metadata";

    /**
     * Path prefix for apps on expanded storage
     */
@@ -640,12 +636,6 @@ public class ParsingPackageUtils {
                pkg.setSigningDetails(SigningDetails.UNKNOWN);
            }

            if (Flags.aslInApkAppMetadataSource()) {
                try (InputStream in = assets.open(APP_METADATA_FILE_NAME)) {
                    pkg.setAppMetadataFileInApk(true);
                } catch (Exception e) { }
            }

            return input.success(pkg);
        } catch (Exception e) {
            return input.error(INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION,
Loading