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

Commit 3a696609 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Remove legacy support for "featureId".

"featureId" was the old name of "attributionTag". This was never shipped
in any public build and is hence just dead code.

Bug: 151105954
Test: atest CtsAppOpsTestCases
Change-Id: I7570e7f84cc3f6cabaa769c700c3ceaf7eed0ae9
parent 2a0235df
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -773,7 +773,7 @@ public class ParsingPackageUtils {
        if (!ParsedAttribution.isCombinationValid(pkg.getAttributions())) {
        if (!ParsedAttribution.isCombinationValid(pkg.getAttributions())) {
            return input.error(
            return input.error(
                    INSTALL_PARSE_FAILED_BAD_MANIFEST,
                    INSTALL_PARSE_FAILED_BAD_MANIFEST,
                    "Combination <feature> tags are not valid"
                    "Combination <attribution> tags are not valid"
            );
            );
        }
        }


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


import android.annotation.NonNull;
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.Resources;
import android.content.res.TypedArray;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.content.res.XmlResourceParser;


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


    <!-- Declares previously declared features this feature inherits from. -->
    <!-- Declares previously declared attributions this attribution inherits from. -->
    <declare-styleable name="AndroidManifestAttributionInheritFrom"
    <declare-styleable name="AndroidManifestAttributionInheritFrom"
                       parent="AndroidManifestAttribution">
                       parent="AndroidManifestAttribution">
        <!-- Identifier of the attribution this attribution inherits from -->
        <!-- Identifier of the attribution this attribution inherits from -->
+0 −4
Original line number Original line Diff line number Diff line
@@ -376,10 +376,6 @@ bool ManifestFixer::BuildRules(xml::XmlActionExecutor* executor,
  });
  });
  manifest_action["instrumentation"]["meta-data"] = meta_data_action;
  manifest_action["instrumentation"]["meta-data"] = meta_data_action;


  // TODO moltmann: Remove
  manifest_action["feature"];
  manifest_action["feature"]["inherit-from"];

  manifest_action["attribution"];
  manifest_action["attribution"];
  manifest_action["attribution"]["inherit-from"];
  manifest_action["attribution"]["inherit-from"];
  manifest_action["original-package"];
  manifest_action["original-package"];