From 3f51caf412c9a87a884441d90825d25cc5bde205 Mon Sep 17 00:00:00 2001 From: Sergey Nikolaienkov Date: Wed, 15 Dec 2021 14:56:12 +0100 Subject: [PATCH 1/2] Enable APP_STREAMING and AUTO_PROJECTION CDM profiles Bug: 195590028 Bug: 203459457 Test: atest CtsCompanionDevicesTestCases:DeviceProfilesTest Test: atest CtsCompanionDevicesTestCases Change-Id: Iafeedd0a09128b93ea3dc00f2f1dbfcc0ca84ea6 --- .../android/server/companion/PermissionsUtils.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/services/companion/java/com/android/server/companion/PermissionsUtils.java b/services/companion/java/com/android/server/companion/PermissionsUtils.java index 3a8ee7398329d..b981ff1d43c96 100644 --- a/services/companion/java/com/android/server/companion/PermissionsUtils.java +++ b/services/companion/java/com/android/server/companion/PermissionsUtils.java @@ -84,18 +84,6 @@ final class PermissionsUtils { throw new IllegalArgumentException("Unsupported device profile: " + deviceProfile); } - if (DEVICE_PROFILE_APP_STREAMING.equals(deviceProfile)) { - // TODO: remove, when properly supporting this profile. - throw new UnsupportedOperationException( - "DEVICE_PROFILE_APP_STREAMING is not fully supported yet."); - } - - if (DEVICE_PROFILE_AUTOMOTIVE_PROJECTION.equals(deviceProfile)) { - // TODO: remove, when properly supporting this profile. - throw new UnsupportedOperationException( - "DEVICE_PROFILE_AUTOMOTIVE_PROJECTION is not fully supported yet."); - } - final String permission = DEVICE_PROFILE_TO_PERMISSION.get(deviceProfile); if (context.checkPermission(permission, getCallingPid(), packageUid) != PERMISSION_GRANTED) { From 8dbde9bfb006b869e1a2e8af46f37115820e1c23 Mon Sep 17 00:00:00 2001 From: Sergey Nikolaienkov Date: Thu, 16 Dec 2021 08:42:25 +0100 Subject: [PATCH 2/2] Remove CDM Auto permission from Shell's allowlist REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION permission is "internal|role", which means that allowlisting it does not have any effect. Bug: 195590028 Bug: 203459457 Test: atest CtsCompanionDevicesTestCases:DeviceProfilesTest Change-Id: Ie9f919938e0e4c57efa3dc8ae66ddfe319215392 --- data/etc/privapp-permissions-platform.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml index 624940bd38234..e61a665307f8c 100644 --- a/data/etc/privapp-permissions-platform.xml +++ b/data/etc/privapp-permissions-platform.xml @@ -427,7 +427,6 @@ applications that come with the platform -