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

Commit c82e25e1 authored by Mary Xia's avatar Mary Xia
Browse files

Rename targetsDisplayCategory to requiredDisplayCategory based on feedback to...

Rename targetsDisplayCategory to requiredDisplayCategory based on feedback to avoid confusion with `lunch target` and
specify activity needs a particular display category.

RESOURCES_FINALIZATION=attribute rename
Test: atest PackageParserTest
Bug: 260161954
Change-Id: I882da1efe8c2dd6837eaab4566d4f15d2762b757
parent 5bcb0c9f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1261,6 +1261,7 @@ package android {
    field public static final int requireDeviceUnlock = 16843756; // 0x10103ec
    field public static final int required = 16843406; // 0x101028e
    field public static final int requiredAccountType = 16843734; // 0x10103d6
    field public static final int requiredDisplayCategory;
    field public static final int requiredFeature = 16844116; // 0x1010554
    field public static final int requiredForAllUsers = 16843728; // 0x10103d0
    field public static final int requiredNotFeature = 16844117; // 0x1010555
@@ -1508,7 +1509,6 @@ package android {
    field public static final int targetCellWidth = 16844340; // 0x1010634
    field public static final int targetClass = 16842799; // 0x101002f
    field @Deprecated public static final int targetDescriptions = 16843680; // 0x10103a0
    field public static final int targetDisplayCategory;
    field public static final int targetId = 16843740; // 0x10103dc
    field public static final int targetName = 16843853; // 0x101044d
    field public static final int targetPackage = 16842785; // 0x1010021
@@ -11201,10 +11201,10 @@ package android.content.pm {
    field public String parentActivityName;
    field public String permission;
    field public int persistableMode;
    field @Nullable public String requiredDisplayCategory;
    field public int screenOrientation;
    field public int softInputMode;
    field public String targetActivity;
    field @Nullable public String targetDisplayCategory;
    field public String taskAffinity;
    field public int theme;
    field public int uiOptions;
+1 −1
Original line number Diff line number Diff line
@@ -416,7 +416,7 @@ public final class VirtualDeviceManager {
         * @param densityDpi The density of the virtual display in dpi, must be greater than 0.
         * @param displayCategories The categories of the virtual display, indicating the type of
         * activities allowed to run on the display. Activities can declare their type using
         * {@link android.content.pm.ActivityInfo#targetDisplayCategory}.
         * {@link android.content.pm.ActivityInfo#requiredDisplayCategory}.
         * @param surface The surface to which the content of the virtual display should
         * be rendered, or null if there is none initially. The surface can also be set later using
         * {@link VirtualDisplay#setSurface(Surface)}.
+14 −15
Original line number Diff line number Diff line
@@ -221,21 +221,20 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
    public String launchToken;

    /**
     * Specifies the category of the target display the activity is expected to run on. Set from
     * the {@link android.R.attr#targetDisplayCategory} attribute. Upon creation, a virtual display
     * can specify which display categories it supports and one of the category must be present in
     * the activity's manifest to allow this activity to run. The default value is {@code null},
     * which indicates the activity does not belong to a restricted display category and thus can
     * only run on a display that didn't specify any display categories. Each activity can only
     * specify one category it targets to but a virtual display can support multiple restricted
     * categories.
     *
     * Specifies the required display category of the activity. Set from the
     * {@link android.R.attr#requiredDisplayCategory} attribute. Upon creation, a display can
     * specify which display categories it supports and one of the category must be present
     * in the {@code <activity>} element to allow this activity to run. The default value is
     * {@code null}, which indicates the activity does not have a required display category and
     * thus can only run on a display that didn't specify any display categories. Each activity
     * can only specify one required category but a display can support multiple display categories.
     * <p>
     * This field should be formatted as a Java-language-style free form string(for example,
     * com.google.automotive_entertainment), which may contain uppercase or lowercase letters ('A'
     * through 'Z'), numbers, and underscores ('_') but may only start with letters.
     */
    @Nullable
    public String targetDisplayCategory;
    public String requiredDisplayCategory;

    /**
     * Activity can not be resized and always occupies the fullscreen area with all windows fully
@@ -1330,7 +1329,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
        mMaxAspectRatio = orig.mMaxAspectRatio;
        mMinAspectRatio = orig.mMinAspectRatio;
        supportsSizeChanges = orig.supportsSizeChanges;
        targetDisplayCategory = orig.targetDisplayCategory;
        requiredDisplayCategory = orig.requiredDisplayCategory;
    }

    /**
@@ -1669,8 +1668,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
        if (mKnownActivityEmbeddingCerts != null) {
            pw.println(prefix + "knownActivityEmbeddingCerts=" + mKnownActivityEmbeddingCerts);
        }
        if (targetDisplayCategory != null) {
            pw.println(prefix + "targetDisplayCategory=" + targetDisplayCategory);
        if (requiredDisplayCategory != null) {
            pw.println(prefix + "requiredDisplayCategory=" + requiredDisplayCategory);
        }
        super.dumpBack(pw, prefix, dumpFlags);
    }
@@ -1718,7 +1717,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
        dest.writeFloat(mMinAspectRatio);
        dest.writeBoolean(supportsSizeChanges);
        sForStringSet.parcel(mKnownActivityEmbeddingCerts, dest, flags);
        dest.writeString8(targetDisplayCategory);
        dest.writeString8(requiredDisplayCategory);
    }

    /**
@@ -1844,7 +1843,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
        if (mKnownActivityEmbeddingCerts.isEmpty()) {
            mKnownActivityEmbeddingCerts = null;
        }
        targetDisplayCategory = source.readString8();
        requiredDisplayCategory = source.readString8();
    }

    /**
+8 −8
Original line number Diff line number Diff line
@@ -3165,20 +3165,20 @@
        <attr name="canDisplayOnRemoteDevices" format="boolean"/>
        <attr name="allowUntrustedActivityEmbedding" />
        <attr name="knownActivityEmbeddingCerts" />
        <!-- Specifies the category of the target display the activity is expected to run on. Upon
             creation, a virtual display can specify which display categories it supports and one of
             the category must be present in the activity's manifest to allow this activity to run.
             The default value is {@code null}, which indicates the activity does not belong to a
             restricted display category and thus can only run on a display that didn't specify any
             display categories. Each activity can only specify one category it targets to but a
             virtual display can accommodate multiple restricted categories.
        <!-- Specifies the required display category of the activity. Upon creation, a display can
             specify which display categories it supports and one of the categories must be present
             in the {@code <activity>} element to allow this activity to run. The default value is
             {@code null}, which indicates the activity does not have a required display category
             and thus can only run on a display that didn't specify any display categories. Each
             activity can only specify one required category but a display can accommodate multiple
             display categories.

             <p> This field should be formatted as a Java-language-style free form string(for
             example, com.google.automotive_entertainment), which may contain uppercase or lowercase
             letters ('A' through 'Z'), numbers, and underscores ('_') but may only start with
             letters.
         -->
        <attr name="targetDisplayCategory" format="string"/>
        <attr name="requiredDisplayCategory" format="string"/>
    </declare-styleable>

    <!-- The <code>activity-alias</code> tag declares a new
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@
    <public name="handwritingBoundsOffsetBottom" />
    <public name="accessibilityDataPrivate" />
    <public name="enableTextStylingShortcuts" />
    <public name="targetDisplayCategory"/>
    <public name="requiredDisplayCategory"/>
    <public name="maxConcurrentSessionsCount" />
  </staging-public-group>

Loading