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

Commit 2bd438cd authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] deprecate MATCH_CLONE_PROFILE which collides with another flag

The old value collides with another flag (MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS).

Deprecating the flag and adding a long version of the same flag.

BUG: 314815969
Test: builds

Change-Id: I2ccec1ad10ae9fb7fb7de8029b4cef163d797dc6
parent 42ef1e2a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4085,7 +4085,8 @@ package android.content.pm {
    field @Deprecated public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; // 0x1
    field @Deprecated public static final int MASK_PERMISSION_FLAGS = 255; // 0xff
    field public static final int MATCH_ANY_USER = 4194304; // 0x400000
    field public static final int MATCH_CLONE_PROFILE = 536870912; // 0x20000000
    field @Deprecated public static final int MATCH_CLONE_PROFILE = 536870912; // 0x20000000
    field @FlaggedApi("android.content.pm.fix_duplicated_flags") public static final long MATCH_CLONE_PROFILE_LONG = 17179869184L; // 0x400000000L
    field public static final int MATCH_FACTORY_ONLY = 2097152; // 0x200000
    field public static final int MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS = 536870912; // 0x20000000
    field public static final int MATCH_INSTANT = 8388608; // 0x800000
+35 −17
Original line number Diff line number Diff line
@@ -919,6 +919,10 @@ public abstract class PackageManager {
    @Retention(RetentionPolicy.SOURCE)
    public @interface InstrumentationInfoFlags {}

    //-------------------------------------------------------------------------
    // Beginning of GET_ and MATCH_ flags
    //-------------------------------------------------------------------------

    /**
     * {@link PackageInfo} flag: return information about
     * activities in the package in {@link PackageInfo#activities}.
@@ -1216,29 +1220,20 @@ public abstract class PackageManager {
     */
    public static final int MATCH_DIRECT_BOOT_AUTO = 0x10000000;

    /** @hide */
    @Deprecated
    public static final int MATCH_DEBUG_TRIAGED_MISSING = MATCH_DIRECT_BOOT_AUTO;

    /**
     * {@link ResolveInfo} flag: allow matching components across clone profile
     * <p>
     * This flag is used only for query and not resolution, the default behaviour would be to
     * restrict querying across clone profile. This flag would be honored only if caller have
     * permission {@link Manifest.permission.QUERY_CLONED_APPS}.
     * @deprecated Use {@link #MATCH_CLONE_PROFILE_LONG} instead.
     *
     * @hide
     * <p>
     */
    @SuppressLint("UnflaggedApi") // Just adding the @Deprecated annotation
    @Deprecated
    @SystemApi
    public static final int MATCH_CLONE_PROFILE = 0x20000000;

    /**
     * @deprecated Use {@link #GET_ATTRIBUTIONS_LONG} to avoid unintended sign extension.
     */
    @Deprecated
    public static final int GET_ATTRIBUTIONS = 0x80000000;

    /** @hide */
    @Deprecated
    public static final int MATCH_DEBUG_TRIAGED_MISSING = MATCH_DIRECT_BOOT_AUTO;

    /**
     * {@link PackageInfo} flag: include system apps that are in the uninstalled state and have
     * been set to be hidden until installed via {@link #setSystemAppState}.
@@ -1256,6 +1251,12 @@ public abstract class PackageManager {
     */
    public static final int MATCH_APEX = 0x40000000;

    /**
     * @deprecated Use {@link #GET_ATTRIBUTIONS_LONG} to avoid unintended sign extension.
     */
    @Deprecated
    public static final int GET_ATTRIBUTIONS = 0x80000000;

    /**
     * {@link PackageInfo} flag: return all attributions declared in the package manifest
     */
@@ -1281,6 +1282,23 @@ public abstract class PackageManager {
    @FlaggedApi(android.content.pm.Flags.FLAG_QUARANTINED_ENABLED)
    public static final long MATCH_QUARANTINED_COMPONENTS = 1L << 33;

    /**
     * {@link ResolveInfo} flag: allow matching components across clone profile
     * <p>
     * This flag is used only for query and not resolution, the default behaviour would be to
     * restrict querying across clone profile. This flag would be honored only if caller have
     * permission {@link Manifest.permission.QUERY_CLONED_APPS}.
     *
     * @hide
     */
    @FlaggedApi(android.content.pm.Flags.FLAG_FIX_DUPLICATED_FLAGS)
    @SystemApi
    public static final long MATCH_CLONE_PROFILE_LONG = 1L << 34;

    //-------------------------------------------------------------------------
    // End of GET_ and MATCH_ flags
    //-------------------------------------------------------------------------

    /**
     * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when
     * resolving an intent that matches the {@code CrossProfileIntentFilter},
+7 −0
Original line number Diff line number Diff line
@@ -108,3 +108,10 @@ flag {
    description: "Feature flag to reduce app crashes caused by split installs with INSTALL_DONT_KILL"
    bug: "291212866"
}

flag {
    name: "fix_duplicated_flags"
    namespace: "package_manager_service"
    description: "Feature flag to fix duplicated PackageManager flag values"
    bug: "314815969"
}