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

Commit 5fa92a43 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

CDM support for the new limited VDM role.

Bug: 368633836
Test: presubmit
Flag: android.companion.virtualdevice.flags.enable_limited_vdm_role
Change-Id: I87439fcd81a9895788740d013ca3d67f2cef6bf4
parent e5e77e59
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -277,6 +277,7 @@ package android {
    field public static final String REQUEST_COMPANION_PROFILE_COMPUTER = "android.permission.REQUEST_COMPANION_PROFILE_COMPUTER";
    field public static final String REQUEST_COMPANION_PROFILE_GLASSES = "android.permission.REQUEST_COMPANION_PROFILE_GLASSES";
    field public static final String REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING = "android.permission.REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING";
    field @FlaggedApi("android.companion.virtualdevice.flags.enable_limited_vdm_role") public static final String REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING = "android.permission.REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING";
    field public static final String REQUEST_COMPANION_PROFILE_WATCH = "android.permission.REQUEST_COMPANION_PROFILE_WATCH";
    field public static final String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
    field public static final String REQUEST_COMPANION_SELF_MANAGED = "android.permission.REQUEST_COMPANION_SELF_MANAGED";
@@ -9983,6 +9984,7 @@ package android.companion {
    field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER) public static final String DEVICE_PROFILE_COMPUTER = "android.app.role.COMPANION_DEVICE_COMPUTER";
    field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_GLASSES) public static final String DEVICE_PROFILE_GLASSES = "android.app.role.COMPANION_DEVICE_GLASSES";
    field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING) public static final String DEVICE_PROFILE_NEARBY_DEVICE_STREAMING = "android.app.role.COMPANION_DEVICE_NEARBY_DEVICE_STREAMING";
    field @FlaggedApi("android.companion.virtualdevice.flags.enable_limited_vdm_role") @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING) public static final String DEVICE_PROFILE_SENSOR_DEVICE_STREAMING = "android.app.role.COMPANION_DEVICE_SENSOR_DEVICE_STREAMING";
    field public static final String DEVICE_PROFILE_WATCH = "android.app.role.COMPANION_DEVICE_WATCH";
  }
+18 −3
Original line number Diff line number Diff line
@@ -90,9 +90,9 @@ public final class AssociationRequest implements Parcelable {
    public static final String DEVICE_PROFILE_GLASSES = "android.app.role.COMPANION_DEVICE_GLASSES";

    /**
     * Device profile: a virtual display capable of rendering Android applications, and sending back
     * Device profile: a virtual device capable of rendering Android applications, and sending back
     * input events.
     *
     * <p>
     * Only applications that have been granted
     * {@link android.Manifest.permission#REQUEST_COMPANION_PROFILE_APP_STREAMING} are allowed to
     * request to be associated with such devices.
@@ -106,7 +106,7 @@ public final class AssociationRequest implements Parcelable {
    /**
     * Device profile: a virtual device capable of rendering content from an Android host to a
     * nearby device.
     *
     * <p>
     * Only applications that have been granted
     * {@link android.Manifest.permission#REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING}
     * are allowed to request to be associated with such devices.
@@ -117,6 +117,21 @@ public final class AssociationRequest implements Parcelable {
    public static final String DEVICE_PROFILE_NEARBY_DEVICE_STREAMING =
            "android.app.role.COMPANION_DEVICE_NEARBY_DEVICE_STREAMING";

    /**
     * Device profile: a virtual device capable of streaming sensor data such as camera, audio and
     * IMU between an Android host and a nearby device.
     * <p>
     * Only applications that have been granted
     * {@link android.Manifest.permission#REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING}
     * are allowed to request to be associated with such devices.
     *
     * @see AssociationRequest.Builder#setDeviceProfile
     */
    @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_ENABLE_LIMITED_VDM_ROLE)
    @RequiresPermission(Manifest.permission.REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING)
    public static final String DEVICE_PROFILE_SENSOR_DEVICE_STREAMING =
            "android.app.role.COMPANION_DEVICE_SENSOR_DEVICE_STREAMING";

    /**
     * Device profile: Android Automotive Projection
     *
+14 −5
Original line number Diff line number Diff line
@@ -4395,7 +4395,7 @@
    <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_GLASSES"
        android:protectionLevel="normal" />

    <!-- Allows application to request to be associated with a virtual display capable of streaming
    <!-- Allows application to request to be associated with a virtual device capable of streaming
         Android applications
         ({@link android.companion.AssociationRequest#DEVICE_PROFILE_APP_STREAMING})
         by {@link android.companion.CompanionDeviceManager}.
@@ -4412,6 +4412,15 @@
    <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING"
        android:protectionLevel="signature|privileged" />

    <!-- Allows application to request to stream content from an Android host to a nearby device
         ({@link android.companion.AssociationRequest#DEVICE_PROFILE_SENSOR_DEVICE_STREAMING})
         by {@link android.companion.CompanionDeviceManager}.
         <p>Not for use by third-party applications.
         @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_ENABLE_LIMITED_VDM_ROLE)
    -->
    <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING"
        android:protectionLevel="signature|privileged" />

    <!-- Allows application to request to be associated with a vehicle head unit capable of
         automotive projection
         ({@link android.companion.AssociationRequest#DEVICE_PROFILE_AUTOMOTIVE_PROJECTION})
+1 −0
Original line number Diff line number Diff line
@@ -413,6 +413,7 @@ applications that come with the platform
        <permission name="android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING" />
        <permission name="android.permission.REQUEST_COMPANION_PROFILE_WATCH" />
        <permission name="android.permission.REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING" />
        <permission name="android.permission.REQUEST_COMPANION_PROFILE_SENSOR_DEVICE_STREAMING" />
        <permission name="android.permission.REQUEST_COMPANION_PROFILE_COMPUTER" />
        <permission name="android.permission.REQUEST_COMPANION_SELF_MANAGED" />
        <permission name="android.permission.REQUEST_OBSERVE_DEVICE_UUID_PRESENCE" />
+11 −0
Original line number Diff line number Diff line
@@ -88,6 +88,17 @@
    <!-- Description of the helper dialog for NEARBY_DEVICE_STREAMING profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_nearby_device_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> is requesting permission on behalf of <xliff:g id="device_name" example="Chromebook">%2$s</xliff:g> to stream apps from your <xliff:g id="device_type" example="phone">%3$s</xliff:g></string>

    <!-- ================= DEVICE_PROFILE_SENSOR_DEVICE_STREAMING ================= -->

    <!-- Confirmation for associating an application with a companion device of SENSOR_DEVICE_STREAMING profile (type) [CHAR LIMIT=NONE] -->
    <string name="title_sensor_device_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to stream audio and system features between your <xliff:g id="device_type" example="phone">%2$s</xliff:g> and &lt;strong&gt;<xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt;?</string>

    <!-- Summary for associating an application with a companion device of SENSOR_DEVICE_STREAMING profile [CHAR LIMIT=NONE] -->
    <string name="summary_sensor_device_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s played on your <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be able to stream audio to <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g> until you remove access to this permission.</string>

    <!-- Description of the helper dialog for SENSOR_DEVICE_STREAMING profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_sensor_device_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> is requesting permission on behalf of <xliff:g id="device_name" example="Chromebook">%2$s</xliff:g> to stream audio and system features between your devices.</string>

    <!-- ================= null profile ================= -->

    <!-- A noun for a companion device with unspecified profile (type) [CHAR LIMIT=30] -->
Loading