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

Commit 45dde31b authored by Song Chun Fan's avatar Song Chun Fan Committed by Android (Google) Code Review
Browse files

Merge "[pm] Deprecating GET_ATTRIBUTIONS flag"

parents 699ad68d d538d494
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -12630,7 +12630,8 @@ package android.content.pm {
    field public static final int FLAG_PERMISSION_WHITELIST_SYSTEM = 1; // 0x1
    field public static final int FLAG_PERMISSION_WHITELIST_UPGRADE = 4; // 0x4
    field public static final int GET_ACTIVITIES = 1; // 0x1
    field public static final int GET_ATTRIBUTIONS = -2147483648; // 0x80000000
    field @Deprecated public static final int GET_ATTRIBUTIONS = -2147483648; // 0x80000000
    field public static final long GET_ATTRIBUTIONS_LONG = 2147483648L; // 0x80000000L
    field public static final int GET_CONFIGURATIONS = 16384; // 0x4000
    field @Deprecated public static final int GET_DISABLED_COMPONENTS = 512; // 0x200
    field @Deprecated public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 32768; // 0x8000
+1 −1
Original line number Diff line number Diff line
@@ -2576,7 +2576,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
    /**
     * Returns whether attributions provided by the application are meant to be user-visible.
     * Defaults to false if application info is retrieved without
     * {@link PackageManager#GET_ATTRIBUTIONS}.
     * {@link PackageManager#GET_ATTRIBUTIONS_LONG}.
     */
    public boolean areAttributionsUserVisible() {
        return (privateFlagsExt & PRIVATE_FLAG_EXT_ATTRIBUTIONS_ARE_USER_VISIBLE) != 0;
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ public class PackageInfo implements Parcelable {
    /**
     * Array of all {@link android.R.styleable#AndroidManifestAttribution
     * <attribution>} tags included under <manifest>, or null if there were none. This
     * is only filled if the flag {@link PackageManager#GET_ATTRIBUTIONS} was set.
     * is only filled if the flag {@link PackageManager#GET_ATTRIBUTIONS_LONG} was set.
     */
    @SuppressWarnings({"ArrayReturn", "NullableCollection"})
    public @Nullable Attribution[] attributions;
+8 −2
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ public abstract class PackageManager {
            GET_DISABLED_UNTIL_USED_COMPONENTS,
            GET_UNINSTALLED_PACKAGES,
            MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS,
            GET_ATTRIBUTIONS,
            GET_ATTRIBUTIONS_LONG,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface PackageInfoFlagsBits {}
@@ -1127,8 +1127,9 @@ public abstract class PackageManager {
    public static final int MATCH_CLONE_PROFILE = 0x20000000;

    /**
     * {@link PackageInfo} flag: return all attributions declared in the package manifest
     * @deprecated Use {@link #GET_ATTRIBUTIONS_LONG} to avoid unintended sign extension.
     */
    @Deprecated
    public static final int GET_ATTRIBUTIONS = 0x80000000;

    /** @hide */
@@ -1152,6 +1153,11 @@ public abstract class PackageManager {
     */
    public static final int MATCH_APEX = 0x40000000;

    /**
     * {@link PackageInfo} flag: return all attributions declared in the package manifest
     */
    public static final long GET_ATTRIBUTIONS_LONG = 0x80000000L;

    /**
     * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when
     * resolving an intent that matches the {@code CrossProfileIntentFilter},
+2 −1
Original line number Diff line number Diff line
@@ -398,7 +398,8 @@ public class PermissionUsageHelper implements AppOpsManager.OnOpActiveChangedLis
            Context userContext = getUserContext(user);
            PackageInfo packageInfo = userContext.getPackageManager().getPackageInfo(
                    packageName,
                    PackageManager.GET_PERMISSIONS | PackageManager.GET_ATTRIBUTIONS);
                    PackageManager.PackageInfoFlags.of(
                            PackageManager.GET_PERMISSIONS | PackageManager.GET_ATTRIBUTIONS_LONG));
            Context pkgContext = userContext.createPackageContext(packageInfo.packageName, 0);
            for (Attribution attribution : packageInfo.attributions) {
                try {
Loading