diff options
author | 2025-03-04 14:50:04 +0100 | |
---|---|---|
committer | 2025-03-04 18:00:49 +0100 | |
commit | 20f4a2b17b3efe9ff0f5ede44a14ff5ca14e13ee (patch) | |
tree | d34660e4503fb8510cb6c66952f1c6fc2940e1f8 /packages/CompanionDeviceManager | |
parent | a4ce9e926e36bd2bde789b2da3c8c5ac14597c92 (diff) |
Rename the new limited VDM role.
A more generic name is much better as it could still be used for
creating trusted displays and input injection in the future, not only
for sensors.
And make it non-self-managed.
Bug: 368633836
Test: presubmit
Flag: android.companion.virtualdevice.flags.enable_limited_vdm_role
Change-Id: Iaa73b23231aa8a0faba6605edb9a87abb8799475
Diffstat (limited to 'packages/CompanionDeviceManager')
3 files changed, 15 insertions, 16 deletions
diff --git a/packages/CompanionDeviceManager/res/values/strings.xml b/packages/CompanionDeviceManager/res/values/strings.xml index 20ede5ff91d3..e1475486cebc 100644 --- a/packages/CompanionDeviceManager/res/values/strings.xml +++ b/packages/CompanionDeviceManager/res/values/strings.xml @@ -106,16 +106,13 @@ <!-- 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 ================= --> + <!-- ================= DEVICE_PROFILE_VIRTUAL_DEVICE ================= --> - <!-- 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 <strong><xliff:g id="app_name" example="Exo">%1$s</xliff:g></strong> to stream audio and system features between your <xliff:g id="device_type" example="phone">%2$s</xliff:g> and <strong><xliff:g id="device_name" example="Chromebook">%3$s</xliff:g></strong>?</string> + <!-- Confirmation for associating an application with a companion device of VIRTUAL_DEVICE profile (type) [CHAR LIMIT=NONE] --> + <string name="title_virtual_device">Allow <strong><xliff:g id="app_name" example="Exo">%1$s</xliff:g></strong> to stream audio and system features between your <xliff:g id="device_type" example="phone">%3$s</xliff:g> and <strong><xliff:g id="device_name" example="Chromebook">%2$s</xliff:g></strong>?</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>.<br/><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> + <!-- Summary for associating an application with a companion device of VIRTUAL_DEVICE profile [CHAR LIMIT=NONE] --> + <string name="summary_virtual_device"><xliff:g id="app_name" example="Exo">%2$s</xliff:g> will have access to anything that’s played on <xliff:g id="device_name" example="Chromebook">%3$s</xliff:g>.<br/><br/><xliff:g id="app_name" example="Exo">%2$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> <!-- ================= null profile ================= --> diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java index ea40e13fdcc9..293ffb9dce93 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java @@ -648,7 +648,8 @@ public class CompanionAssociationActivity extends FragmentActivity implements final int summaryResourceId = PROFILE_SUMMARIES.get(deviceProfile); final String remoteDeviceName = mSelectedDevice.getDisplayName(); final Spanned title = getHtmlFromResources( - this, PROFILE_TITLES.get(deviceProfile), mAppLabel, remoteDeviceName); + this, PROFILE_TITLES.get(deviceProfile), mAppLabel, remoteDeviceName, + getString(R.string.device_type)); final Spanned summary; if (deviceProfile == null && mRequest.isSingleDevice()) { @@ -656,7 +657,8 @@ public class CompanionAssociationActivity extends FragmentActivity implements mConstraintList.setVisibility(View.GONE); } else { summary = getHtmlFromResources( - this, summaryResourceId, getString(R.string.device_type)); + this, summaryResourceId, getString(R.string.device_type), mAppLabel, + remoteDeviceName); setupPermissionList(deviceProfile); } diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java index f756a6235c14..f6e680207530 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java @@ -21,7 +21,7 @@ import static android.companion.AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PRO import static android.companion.AssociationRequest.DEVICE_PROFILE_COMPUTER; import static android.companion.AssociationRequest.DEVICE_PROFILE_GLASSES; import static android.companion.AssociationRequest.DEVICE_PROFILE_NEARBY_DEVICE_STREAMING; -import static android.companion.AssociationRequest.DEVICE_PROFILE_SENSOR_DEVICE_STREAMING; +import static android.companion.AssociationRequest.DEVICE_PROFILE_VIRTUAL_DEVICE; import static android.companion.AssociationRequest.DEVICE_PROFILE_WATCH; import static android.companion.AssociationRequest.DEVICE_PROFILE_WEARABLE_SENSING; import static android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE; @@ -118,7 +118,7 @@ final class CompanionDeviceResources { map.put(DEVICE_PROFILE_AUTOMOTIVE_PROJECTION, R.string.title_automotive_projection); map.put(DEVICE_PROFILE_COMPUTER, R.string.title_computer); map.put(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING, R.string.title_nearby_device_streaming); - map.put(DEVICE_PROFILE_SENSOR_DEVICE_STREAMING, R.string.title_sensor_device_streaming); + map.put(DEVICE_PROFILE_VIRTUAL_DEVICE, R.string.title_virtual_device); map.put(DEVICE_PROFILE_WATCH, R.string.confirmation_title); map.put(DEVICE_PROFILE_GLASSES, R.string.confirmation_title_glasses); map.put(null, R.string.confirmation_title); @@ -133,7 +133,7 @@ final class CompanionDeviceResources { map.put(DEVICE_PROFILE_GLASSES, R.string.summary_glasses); map.put(DEVICE_PROFILE_APP_STREAMING, R.string.summary_app_streaming); map.put(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING, R.string.summary_nearby_device_streaming); - map.put(DEVICE_PROFILE_SENSOR_DEVICE_STREAMING, R.string.summary_sensor_device_streaming); + map.put(DEVICE_PROFILE_VIRTUAL_DEVICE, R.string.summary_virtual_device); map.put(null, R.string.summary_generic); PROFILE_SUMMARIES = unmodifiableMap(map); @@ -145,8 +145,6 @@ final class CompanionDeviceResources { map.put(DEVICE_PROFILE_APP_STREAMING, R.string.helper_summary_app_streaming); map.put(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING, R.string.helper_summary_nearby_device_streaming); - map.put(DEVICE_PROFILE_SENSOR_DEVICE_STREAMING, - R.string.helper_summary_sensor_device_streaming); map.put(DEVICE_PROFILE_COMPUTER, R.string.helper_summary_computer); PROFILE_HELPER_SUMMARIES = unmodifiableMap(map); @@ -178,6 +176,7 @@ final class CompanionDeviceResources { final Map<String, Integer> map = new ArrayMap<>(); map.put(DEVICE_PROFILE_WATCH, R.string.profile_name_watch); map.put(DEVICE_PROFILE_GLASSES, R.string.profile_name_glasses); + map.put(DEVICE_PROFILE_VIRTUAL_DEVICE, R.string.profile_name_generic); map.put(null, R.string.profile_name_generic); PROFILE_NAMES = unmodifiableMap(map); @@ -188,6 +187,7 @@ final class CompanionDeviceResources { final Map<String, Integer> map = new ArrayMap<>(); map.put(DEVICE_PROFILE_WATCH, R.drawable.ic_watch); map.put(DEVICE_PROFILE_GLASSES, R.drawable.ic_glasses); + map.put(DEVICE_PROFILE_VIRTUAL_DEVICE, R.drawable.ic_device_other); map.put(null, R.drawable.ic_device_other); PROFILE_ICONS = unmodifiableMap(map); @@ -198,6 +198,7 @@ final class CompanionDeviceResources { final Set<String> set = new ArraySet<>(); set.add(DEVICE_PROFILE_WATCH); set.add(DEVICE_PROFILE_GLASSES); + set.add(DEVICE_PROFILE_VIRTUAL_DEVICE); set.add(null); SUPPORTED_PROFILES = unmodifiableSet(set); @@ -210,7 +211,6 @@ final class CompanionDeviceResources { set.add(DEVICE_PROFILE_COMPUTER); set.add(DEVICE_PROFILE_AUTOMOTIVE_PROJECTION); set.add(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING); - set.add(DEVICE_PROFILE_SENSOR_DEVICE_STREAMING); set.add(DEVICE_PROFILE_WEARABLE_SENSING); set.add(null); |