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

Commit 946e32f3 authored by Zoran Jovanovic's avatar Zoran Jovanovic Committed by Todd Kennedy
Browse files

RRO: Flag ApplicationInfo if it's an RRO

This is important when deciding whether or not to create
a hidden app detail activity or within AppInfo in Settings
application.

Bug: 119440359
Bug: 124556507
Test: build and test with Settings app
Change-Id: I02324e5c0a146f4df4cc4a5b1b62059bc9153d23
parent cf49db12
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11051,6 +11051,7 @@ package android.content.pm {
    method public void dump(android.util.Printer, String);
    method public static CharSequence getCategoryTitle(android.content.Context, int);
    method public boolean isProfileableByShell();
    method public boolean isResourceOverlay();
    method public boolean isVirtualPreload();
    method public CharSequence loadDescription(android.content.pm.PackageManager);
    field public static final int CATEGORY_AUDIO = 1; // 0x1
+17 −0
Original line number Diff line number Diff line
@@ -671,6 +671,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
    public static final int PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE  = 1 << 27;

    /**
     * Indicates whether this package is in fact a runtime resource overlay.
     *
     * @hide
     */
    public static final int PRIVATE_FLAG_IS_RESOURCE_OVERLAY = 1 << 28;


    /** @hide */
    @IntDef(flag = true, prefix = { "PRIVATE_FLAG_" }, value = {
            PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE,
@@ -683,6 +691,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
            PRIVATE_FLAG_HAS_DOMAIN_URLS,
            PRIVATE_FLAG_HIDDEN,
            PRIVATE_FLAG_INSTANT,
            PRIVATE_FLAG_IS_RESOURCE_OVERLAY,
            PRIVATE_FLAG_ISOLATED_SPLIT_LOADING,
            PRIVATE_FLAG_OEM,
            PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE,
@@ -2022,6 +2031,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_ISOLATED_SPLIT_LOADING) != 0;
    }

    /**
     * Returns true if the package has declared in its manifest that it is a
     * runtime resource overlay.
     */
    public boolean isResourceOverlay() {
        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_IS_RESOURCE_OVERLAY) != 0;
    }

    /**
     * @hide
     */
+3 −0
Original line number Diff line number Diff line
@@ -2108,6 +2108,9 @@ public class PackageParser {
                    return null;
                }

                pkg.applicationInfo.privateFlags |=
                    ApplicationInfo.PRIVATE_FLAG_IS_RESOURCE_OVERLAY;

                XmlUtils.skipCurrentTag(parser);

            } else if (tagName.equals(TAG_KEY_SETS)) {