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

Commit 60878c44 authored by Claudiu Ghioc's avatar Claudiu Ghioc Committed by Android (Google) Code Review
Browse files

Merge changes from topic "CDM_profiles_glasses"

* changes:
  Add CDM profile for "nearby_device_streaming"
  Add CDM profile for "glasses"
parents 38087fca c35acc23
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@ package android {
    field public static final String REQUEST_COMPANION_PROFILE_APP_STREAMING = "android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING";
    field public static final String REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION = "android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION";
    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 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";
@@ -9058,6 +9060,8 @@ package android.companion {
    field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING) public static final String DEVICE_PROFILE_APP_STREAMING = "android.app.role.COMPANION_DEVICE_APP_STREAMING";
    field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION) public static final String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION = "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION";
    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 public static final String DEVICE_PROFILE_WATCH = "android.app.role.COMPANION_DEVICE_WATCH";
  }
+31 −1
Original line number Diff line number Diff line
@@ -72,6 +72,21 @@ public final class AssociationRequest implements Parcelable {
     */
    public static final String DEVICE_PROFILE_WATCH = "android.app.role.COMPANION_DEVICE_WATCH";

    /**
     * Device profile: glasses.
     *
     * If specified, the current request may have a modified UI to highlight that the device being
     * set up is a glasses device, and some extra permissions may be granted to the app
     * as a result.
     *
     * Using it requires declaring uses-permission
     * {@link android.Manifest.permission#REQUEST_COMPANION_PROFILE_GLASSES} in the manifest.
     *
     * @see AssociationRequest.Builder#setDeviceProfile
     */
    @RequiresPermission(Manifest.permission.REQUEST_COMPANION_PROFILE_GLASSES)
    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
     * input events.
@@ -86,6 +101,20 @@ public final class AssociationRequest implements Parcelable {
    public static final String DEVICE_PROFILE_APP_STREAMING =
            "android.app.role.COMPANION_DEVICE_APP_STREAMING";

    /**
     * Device profile: a virtual device capable of rendering content from an Android host to a
     * nearby device.
     *
     * 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.
     *
     * @see AssociationRequest.Builder#setDeviceProfile
     */
    @RequiresPermission(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";

    /**
     * Device profile: Android Automotive Projection
     *
@@ -116,7 +145,8 @@ public final class AssociationRequest implements Parcelable {
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @StringDef(value = { DEVICE_PROFILE_WATCH, DEVICE_PROFILE_COMPUTER,
            DEVICE_PROFILE_AUTOMOTIVE_PROJECTION, DEVICE_PROFILE_APP_STREAMING })
            DEVICE_PROFILE_AUTOMOTIVE_PROJECTION, DEVICE_PROFILE_APP_STREAMING,
            DEVICE_PROFILE_GLASSES, DEVICE_PROFILE_NEARBY_DEVICE_STREAMING })
    public @interface DeviceProfile {}

    /**
+16 −0
Original line number Diff line number Diff line
@@ -3349,6 +3349,14 @@
                android:description="@string/permdesc_companionProfileWatch"
                android:protectionLevel="normal" />

    <!-- Allows app to request to be associated with a device via
         {@link android.companion.CompanionDeviceManager}
         as "glasses"
         <p>Protection level: normal
     -->
    <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
         Android applications
         ({@link android.companion.AssociationRequest#DEVICE_PROFILE_APP_STREAMING})
@@ -3358,6 +3366,14 @@
    <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_APP_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_NEARBY_DEVICE_STREAMING})
         by {@link android.companion.CompanionDeviceManager}.
        <p>Not for use by third-party applications.
    -->
    <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_NEARBY_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
@@ -387,6 +387,7 @@ applications that come with the platform
        <permission name="android.permission.MANAGE_COMPANION_DEVICES" />
        <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_COMPUTER" />
        <permission name="android.permission.REQUEST_COMPANION_SELF_MANAGED" />
        <!-- Permission required for testing registering pull atom callbacks. -->
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
  android:height="24dp"
  android:width="24dp"
  android:viewportHeight="160"
  android:viewportWidth="160" >
  <path android:fillAlpha="0" android:fillColor="#000000"
        android:pathData="M69.48,83.33A26.97,24.46 0,0 1,42.92 107.8,26.97 24.46,0 0,1 15.56,84.07 26.97,24.46 0,0 1,41.29 58.9,26.97 24.46,0 0,1 69.43,81.86"
        android:strokeColor="#000000" android:strokeWidth="2.265"/>
    <path android:fillAlpha="0" android:fillColor="#000000"
        android:pathData="m143.73,83.58a26.97,24.46 0,0 1,-26.56 24.46,26.97 24.46,0 0,1 -27.36,-23.72 26.97,24.46 0,0 1,25.73 -25.18,26.97 24.46,0 0,1 28.14,22.96"
        android:strokeColor="#000000" android:strokeWidth="2.265"/>
    <path android:fillAlpha="0" android:fillColor="#000000"
        android:pathData="m69.42,82.98c20.37,-0.25 20.37,-0.25 20.37,-0.25"
        android:strokeColor="#000000" android:strokeWidth="2.265"/>
    <path android:fillAlpha="0" android:fillColor="#000000"
        android:pathData="M15.37,83.78 L1.9,56.83"
        android:strokeColor="#000000" android:strokeWidth="2.265"/>
    <path android:fillAlpha="0" android:fillColor="#000000"
        android:pathData="M143.67,82.75C154.48,57.9 154.48,58.04 154.48,58.04"
        android:strokeColor="#000000" android:strokeWidth="2.265"/>
</vector>
Loading