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

Commit 9bc8e57b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "featureIdCleanup"

* changes:
  Do not allow invalid attribution tags
  Remove legacy support for "featureId".
parents 1711a6fc a51c2ef3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ package android.app {
    field public static final int OP_RECORD_AUDIO = 27; // 0x1b
    field public static final int OP_START_FOREGROUND = 76; // 0x4c
    field public static final int OP_SYSTEM_ALERT_WINDOW = 24; // 0x18
    field public static final long SECURITY_EXCEPTION_ON_INVALID_ATTRIBUTION_TAG_CHANGE = 151105954L; // 0x901b1a2L
    field public static final int UID_STATE_BACKGROUND = 600; // 0x258
    field public static final int UID_STATE_CACHED = 700; // 0x2bc
    field public static final int UID_STATE_FOREGROUND = 500; // 0x1f4
+16 −0
Original line number Diff line number Diff line
@@ -182,6 +182,22 @@ public class AppOpsManager {
    @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.Q)
    public static final long CALL_BACK_ON_CHANGED_LISTENER_WITH_SWITCHED_OP_CHANGE = 148180766L;

    /**
     * Enforce that all attributionTags send to {@link #noteOp}, {@link #noteProxyOp},
     * and {@link #startOp} are defined in the manifest of the package that is specified as
     * parameter to the methods.
     *
     * <p>To enable this change both the package calling {@link #noteOp} as well as the package
     * specified as parameter to the method need to have this change enable.
     *
     * @hide
     */
    @TestApi
    @ChangeId
    @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.R)
    public static final long SECURITY_EXCEPTION_ON_INVALID_ATTRIBUTION_TAG_CHANGE = 151105954L;


    private static final int MAX_UNFORWARDED_OPS = 10;

    final Context mContext;
+1 −1
Original line number Diff line number Diff line
@@ -773,7 +773,7 @@ public class ParsingPackageUtils {
        if (!ParsedAttribution.isCombinationValid(pkg.getAttributions())) {
            return input.error(
                    INSTALL_PARSE_FAILED_BAD_MANIFEST,
                    "Combination <feature> tags are not valid"
                    "Combination <attribution> tags are not valid"
            );
        }

+3 −8
Original line number Diff line number Diff line
@@ -17,13 +17,13 @@
package android.content.pm.parsing.component;

import android.annotation.NonNull;
import android.content.pm.parsing.result.ParseInput;
import android.content.pm.parsing.result.ParseResult;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;

import com.android.internal.R;
import android.content.pm.parsing.result.ParseInput;
import android.content.pm.parsing.result.ParseResult;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -52,14 +52,9 @@ public class ParsedAttributionUtils {
        try {
            attributionTag = sa.getNonConfigurationString(
                    R.styleable.AndroidManifestAttribution_tag, 0);
            if (attributionTag == null) {
                // TODO moltmann: Remove handling of featureId
                attributionTag = sa.getNonConfigurationString(
                        R.styleable.AndroidManifestAttribution_featureId, 0);
            if (attributionTag == null) {
                return input.error("<attribution> does not specify android:tag");
            }
            }
            if (attributionTag.length() > ParsedAttribution.MAX_ATTRIBUTION_TAG_LEN) {
                return input.error("android:tag is too long. Max length is "
                        + ParsedAttribution.MAX_ATTRIBUTION_TAG_LEN);
+1 −3
Original line number Diff line number Diff line
@@ -1862,8 +1862,6 @@
    <p>In case this attribution inherits from another attribution, this tag can contain one or
    multiple {@link #AndroidManifestAttributionInheritFrom inherit-from} tags. -->
    <declare-styleable name="AndroidManifestAttribution" parent="AndroidManifest">
        <!-- TODO moltmann: Remove -->
        <attr name="featureId" format="string" />
        <!-- Required identifier for a attribution. Can be passed to
        {@link android.content.Context#createAttributionContext} to create a context tagged with
        this attribution
@@ -1873,7 +1871,7 @@
        <attr name="label" format="string" />
    </declare-styleable>

    <!-- Declares previously declared features this feature inherits from. -->
    <!-- Declares previously declared attributions this attribution inherits from. -->
    <declare-styleable name="AndroidManifestAttributionInheritFrom"
                       parent="AndroidManifestAttribution">
        <!-- Identifier of the attribution this attribution inherits from -->
Loading