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

Commit a9431c23 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add manifest attribute for display across devices"

parents c84134d2 79dcbeea
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -411,6 +411,7 @@ package android {
    field public static final int calendarViewShown = 16843596; // 0x101034c
    field public static final int calendarViewStyle = 16843613; // 0x101035d
    field public static final int canControlMagnification = 16844039; // 0x1010507
    field public static final int canDisplayOnRemoteDevices;
    field public static final int canPauseRecording = 16844314; // 0x101061a
    field public static final int canPerformGestures = 16844045; // 0x101050d
    field public static final int canRecord = 16844060; // 0x101051c
+6 −0
Original line number Diff line number Diff line
@@ -448,6 +448,12 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
     * @see android.app.Activity#setVrModeEnabled(boolean, ComponentName)
     */
    public static final int FLAG_ENABLE_VR_MODE = 0x8000;
    /**
     * Bit in {@link #flags} indicating if the activity can be displayed on a remote device.
     * Corresponds to {@link android.R.attr#canDisplayOnRemoteDevices}
     * @hide
     */
    public static final int FLAG_CAN_DISPLAY_ON_REMOTE_DEVICES = 0x10000;

    /**
     * Bit in {@link #flags} indicating if the activity is always focusable regardless of if it is
+2 −0
Original line number Diff line number Diff line
@@ -194,6 +194,8 @@ public class ParsingPackageUtils {

    public static final String METADATA_MAX_ASPECT_RATIO = "android.max_aspect";
    public static final String METADATA_SUPPORTS_SIZE_CHANGES = "android.supports_size_changes";
    public static final String METADATA_CAN_DISPLAY_ON_REMOTE_DEVICES =
            "android.can_display_on_remote_devices";
    public static final String METADATA_ACTIVITY_WINDOW_LAYOUT_AFFINITY =
            "android.activity_window_layout_affinity";
    public static final String METADATA_ACTIVITY_LAUNCH_MODE = "android.activity.launch_mode";
+15 −0
Original line number Diff line number Diff line
@@ -420,6 +420,21 @@ public class ParsedActivityUtils {
            }
        }

        if (!isAlias) {
            // Default allow the activity to be displayed on a remote device unless it explicitly
            // set to false.
            boolean canDisplayOnRemoteDevices = array.getBoolean(
                    R.styleable.AndroidManifestActivity_canDisplayOnRemoteDevices, true);
            if (activity.getMetaData() != null && !activity.getMetaData().getBoolean(
                    ParsingPackageUtils.METADATA_CAN_DISPLAY_ON_REMOTE_DEVICES, true)) {
                canDisplayOnRemoteDevices = false;
            }
            if (canDisplayOnRemoteDevices) {
                activity.setFlags(activity.getFlags()
                        | ActivityInfo.FLAG_CAN_DISPLAY_ON_REMOTE_DEVICES);
            }
        }

        ParseResult<ActivityInfo.WindowLayout> layoutResult =
                resolveActivityWindowLayout(activity, input);
        if (layoutResult.isError()) {
+3 −0
Original line number Diff line number Diff line
@@ -2953,6 +2953,9 @@
             usually TVs.
             <p>Requires permission {@code android.permission.DISABLE_SYSTEM_SOUND_EFFECTS}. -->
        <attr name="playHomeTransitionSound" format="boolean"/>
        <!-- Indicates whether the activity can be displayed on a remote device which may or
             may not be running Android. -->
        <attr name="canDisplayOnRemoteDevices" format="boolean"/>
    </declare-styleable>

    <!-- The <code>activity-alias</code> tag declares a new
Loading