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

Commit 9e3486b5 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Itemized CDM dialog permissions for VDM roles

with a static list of permissions.

Removing the always unlocked display item and combining it with
the trusted display one because they're always granted together.

Bug: 402786380
Test: manual and CTS
Flag: android.companion.virtualdevice.flags.itemized_vdm_permissions

Change-Id: I940d0025b7fea54b95f0a92f4c756784200ebcdf
parent 7805d8ff
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ public final class CompanionResources {
    public static final int PERMISSION_CREATE_VIRTUAL_DEVICE = 12;
    public static final int PERMISSION_ADD_MIRROR_DISPLAY = 13;
    public static final int PERMISSION_ADD_TRUSTED_DISPLAY = 14;
    public static final int PERMISSION_ADD_ALWAYS_UNLOCKED_DISPLAY = 15;

    // Constants used by AssociationRequestProcessor and CompanionAssociationActivity
    public static final String EXTRA_APPLICATION_CALLBACK = "application_callback";
+10 −0
Original line number Diff line number Diff line
@@ -103,6 +103,16 @@ flag {
    is_exported: true
}

flag {
    name: "itemized_vdm_permissions"
    namespace: "virtual_devices"
    description: "Itemized permissions in CDM dialog for VDM roles"
    bug: "419169396"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "virtual_devices"
    name: "notifications_for_device_streaming"
+0 −26
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2025 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:width="24dp"
    android:height="24dp"
    android:viewportWidth="960"
    android:viewportHeight="960"
    android:tint="@android:color/system_accent1_200">
    <path
        android:pathData="M800,686L720,606L720,400Q720,400 720,400Q720,400 720,400L514,400L434,320L600,320L600,240Q600,190 565.5,155Q531,120 481,120Q431,120 397,154.5Q363,189 363,240L363,249L290,176Q312,115 365,77.5Q418,40 481,40Q564,40 622,98.5Q680,157 680,240L680,320L720,320Q753,320 776.5,343.5Q800,367 800,400L800,686ZM820,932L758,870Q747,875 738,877.5Q729,880 720,880L240,880Q207,880 183.5,856.5Q160,833 160,800L160,400Q160,375 174.5,354Q189,333 212,324L28,140L84,84L876,876L820,932ZM686,800L539,651Q528,662 513.5,668Q499,674 482,674Q449,674 425.5,650.5Q402,627 402,594Q402,577 408,562.5Q414,548 425,537L286,400L240,400Q240,400 240,400Q240,400 240,400L240,800Q240,800 240,800Q240,800 240,800L686,800ZM486,600L486,600L486,600Q486,600 486,600Q486,600 486,600L486,600Q486,600 486,600Q486,600 486,600ZM617,503L617,503L617,503Q617,503 617,503Q617,503 617,503Z"
        android:fillColor="#3C4043"
        android:fillType="evenOdd"/>
</vector>
+0 −26
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2025 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:width="24dp"
    android:height="24dp"
    android:viewportWidth="960"
    android:viewportHeight="960"
    android:tint="@android:color/system_accent1_600">
    <path
        android:pathData="M800,686L720,606L720,400Q720,400 720,400Q720,400 720,400L514,400L434,320L600,320L600,240Q600,190 565.5,155Q531,120 481,120Q431,120 397,154.5Q363,189 363,240L363,249L290,176Q312,115 365,77.5Q418,40 481,40Q564,40 622,98.5Q680,157 680,240L680,320L720,320Q753,320 776.5,343.5Q800,367 800,400L800,686ZM820,932L758,870Q747,875 738,877.5Q729,880 720,880L240,880Q207,880 183.5,856.5Q160,833 160,800L160,400Q160,375 174.5,354Q189,333 212,324L28,140L84,84L876,876L820,932ZM686,800L539,651Q528,662 513.5,668Q499,674 482,674Q449,674 425.5,650.5Q402,627 402,594Q402,577 408,562.5Q414,548 425,537L286,400L240,400Q240,400 240,400Q240,400 240,400L240,800Q240,800 240,800Q240,800 240,800L686,800ZM486,600L486,600L486,600Q486,600 486,600Q486,600 486,600L486,600Q486,600 486,600Q486,600 486,600ZM617,503L617,503L617,503Q617,503 617,503Q617,503 617,503Z"
        android:fillColor="#3C4043"
        android:fillType="evenOdd"/>
</vector>
+12 −12
Original line number Diff line number Diff line
@@ -68,13 +68,16 @@
    <!-- ================= DEVICE_PROFILE_APP_STREAMING ================= -->

    <!-- Confirmation for associating an application with a companion device of APP_STREAMING profile (type) [CHAR LIMIT=NONE] -->
    <string name="title_app_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to stream your <xliff:g id="device_type" example="phone">%2$s</xliff:g>\u2019s apps and system features to &lt;strong&gt;<xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt;?</string>
    <string name="title_app_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to stream apps 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 APP_STREAMING profile [CHAR LIMIT=NONE] -->
    <string name="summary_app_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on your <xliff:g id="device_type" example="phone">%2$s</xliff:g>, including audio, photos, payment info, passwords, and messages.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be able to stream apps to <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g> until you remove access to this permission.</string>
    <string name="summary_app_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be granted the following permissions:</string>

    <!-- Legacy Summary for associating an application with a companion device of APP_STREAMING profile [CHAR LIMIT=NONE] -->
    <string name="summary_app_streaming_legacy"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on your <xliff:g id="device_type" example="phone">%2$s</xliff:g>, including audio, photos, payment info, passwords, and messages.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be able to stream apps 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 APP_STREAMING profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_app_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 and system features from your <xliff:g id="device_type" example="phone">%3$s</xliff:g></string>
    <string name="helper_summary_app_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 and system features between your devices</string>

    <!-- ================= DEVICE_PROFILE_AUTOMOTIVE_PROJECTION ================= -->

@@ -95,10 +98,13 @@
    <!-- ================= DEVICE_PROFILE_NEARBY_DEVICE_STREAMING ================= -->

    <!-- Confirmation for associating an application with a companion device of NEARBY_DEVICE_STREAMING profile (type) [CHAR LIMIT=NONE] -->
    <string name="title_nearby_device_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to stream your <xliff:g id="device_type" example="phone">%2$s</xliff:g>\u2019s apps to &lt;strong&gt;<xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt;?</string>
    <string name="title_nearby_device_streaming">Allow &lt;strong&gt;<xliff:g id="app_name" example="Exo">%1$s</xliff:g>&lt;/strong&gt; to stream apps 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 NEARBY_DEVICE_STREAMING profile [CHAR LIMIT=NONE] -->
    <string name="summary_nearby_device_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>, including audio, photos, payment info, passwords, and messages.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be able to stream apps to <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g> until you remove access to this permission.</string>
    <string name="summary_nearby_device_streaming"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be granted the following permissions:</string>

    <!-- Legacy Summary for associating an application with a companion device of NEARBY_DEVICE_STREAMING profile [CHAR LIMIT=NONE] -->
    <string name="summary_nearby_device_streaming_legacy"><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>, including audio, photos, payment info, passwords, and messages.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will be able to stream apps 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 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>
@@ -196,9 +202,6 @@
    <!-- Trusted display permission will be granted of corresponding profile [CHAR LIMIT=30] -->
    <string name="permission_add_trusted_display">Stream apps</string>

    <!-- Always unlocked display permission will be granted of corresponding profile [CHAR LIMIT=30] -->
    <string name="permission_add_always_unlocked_display">Stream while locked</string>

    <!-- Description of phone permission of corresponding profile [CHAR LIMIT=NONE] -->
    <string name="permission_phone_summary">Make and manage phone calls</string>

@@ -239,10 +242,7 @@
    <string name="permission_add_mirror_display_summary">Record, cast or share your <xliff:g id="device_type" example="phone">%2$s</xliff:g>\u2019s screen to &lt;strong&gt;<xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt;.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on your <xliff:g id="device_type" example="phone">%2$s</xliff:g>, including audio, photos, payment info, passwords and messages.</string>

    <!-- Description of trusted permission to be granted to the corresponding profile [CHAR LIMIT=NONE] -->
    <string name="permission_add_trusted_display_summary">Stream your <xliff:g id="device_type" example="phone">%2$s</xliff:g>\u2019s apps to &lt;strong&gt;<xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt;.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>, including audio, photos, payment info, passwords and messages.</string>

    <!-- Description of always unlocked permission to be granted to the corresponding profile [CHAR LIMIT=NONE] -->
    <string name="permission_add_always_unlocked_display_summary">Stream your <xliff:g id="device_type" example="phone">%2$s</xliff:g>\u2019s apps even if it is locked.</string>
    <string name="permission_add_trusted_display_summary">Stream your <xliff:g id="device_type" example="phone">%2$s</xliff:g>\u2019s apps to &lt;strong&gt;<xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt;.&lt;br/>&lt;br/><xliff:g id="app_name" example="Exo">%1$s</xliff:g> will have access to anything that’s visible or played on <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>, including audio, photos, payment info, passwords and messages, even when your <xliff:g id="device_type" example="phone">%2$s</xliff:g> is locked.</string>

    <!-- Description of change media output permission to be granted to the corresponding profile [CHAR LIMIT=NONE] -->
    <string name="permission_media_routing_control_summary">Access a list of available devices and control which one streams or casts audio or video from other apps</string>
Loading