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

Commit 7bc3a709 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Scope package manager queries for ephemeral apps

Ephemeral apps can only see their own components or those components
exposed via the "visibleToEphemeral" XML attribute.

Normal apps can only see other normal apps. There is no way to expose
ephemeral components to normal apps.

Bug: 33458220
Test: Manually install ephemeral/normal apps and ensure they can only see appropriate components
Change-Id: I6ae65fd2a6ddc9aa9691f02cd55d4953048966b0
parent b7717682
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1425,6 +1425,7 @@ package android {
    field public static final int viewportWidth = 16843778; // 0x1010402
    field public static final int visibility = 16842972; // 0x10100dc
    field public static final int visible = 16843156; // 0x1010194
    field public static final int visibleToEphemeral = 16844095; // 0x101053f
    field public static final int vmSafeMode = 16843448; // 0x10102b8
    field public static final int voiceIcon = 16843908; // 0x1010484
    field public static final int voiceLanguage = 16843349; // 0x1010255
+1 −0
Original line number Diff line number Diff line
@@ -1536,6 +1536,7 @@ package android {
    field public static final int viewportWidth = 16843778; // 0x1010402
    field public static final int visibility = 16842972; // 0x10100dc
    field public static final int visible = 16843156; // 0x1010194
    field public static final int visibleToEphemeral = 16844095; // 0x101053f
    field public static final int vmSafeMode = 16843448; // 0x10102b8
    field public static final int voiceIcon = 16843908; // 0x1010484
    field public static final int voiceLanguage = 16843349; // 0x1010255
+1 −0
Original line number Diff line number Diff line
@@ -1425,6 +1425,7 @@ package android {
    field public static final int viewportWidth = 16843778; // 0x1010402
    field public static final int visibility = 16842972; // 0x10100dc
    field public static final int visible = 16843156; // 0x1010194
    field public static final int visibleToEphemeral = 16844095; // 0x101053f
    field public static final int vmSafeMode = 16843448; // 0x10102b8
    field public static final int voiceIcon = 16843908; // 0x1010484
    field public static final int voiceLanguage = 16843349; // 0x1010255
+22 −0
Original line number Diff line number Diff line
@@ -282,6 +282,10 @@ public class IntentFilter implements Parcelable {

    private int mVerifyState;

    /** Whether or not the intent filter is visible to ephemeral apps. */
    private boolean mVisibleToEphemeral;
    /** Whether or not the intent filter is part of an ephemeral app. */
    private boolean mEphemeral;
    // These functions are the start of more optimized code for managing
    // the string sets...  not yet implemented.

@@ -647,6 +651,24 @@ public class IntentFilter implements Parcelable {
        if (verified) mVerifyState |= STATE_VERIFIED;
    }

    /** @hide */
    public void setVisibleToEphemeral(boolean visibleToEmphemeral) {
        mVisibleToEphemeral = visibleToEmphemeral;
    }
    /** @hide */
    public boolean isVisibleToEphemeral() {
        return mVisibleToEphemeral;
    }

    /** @hide */
    public void setEphemeral(boolean ephemeral) {
        mEphemeral = ephemeral;
    }
    /** @hide */
    public boolean isEphemeral() {
        return mEphemeral;
    }

    /**
     * Add a new Intent action to match against.  If any actions are included
     * in the filter, then an Intent's action must be one of those values for
+6 −0
Original line number Diff line number Diff line
@@ -362,6 +362,12 @@ public class ActivityInfo extends ComponentInfo
     */
    public static final int FLAG_ON_TOP_LAUNCHER = 0x80000;

    /**
     * Bit in {@link #flags} indicating if the activity is visible to ephemeral applications.
     * @hide
     */
    public static final int FLAG_VISIBLE_TO_EPHEMERAL = 0x100000;

    /**
     * @hide Bit in {@link #flags}: If set, this component will only be seen
     * by the system user.  Only works with broadcast receivers.  Set from the
Loading