From 20f4a2b17b3efe9ff0f5ede44a14ff5ca14e13ee Mon Sep 17 00:00:00 2001 From: Vladimir Komsiyski Date: Tue, 4 Mar 2025 14:50:04 +0100 Subject: 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 --- .../companiondevicemanager/CompanionAssociationActivity.java | 6 ++++-- .../companiondevicemanager/CompanionDeviceResources.java | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'packages/CompanionDeviceManager/src') 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 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 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 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); -- cgit v1.2.3-59-g8ed1b