diff options
| author | 2023-04-07 22:44:37 +0000 | |
|---|---|---|
| committer | 2023-04-07 22:44:37 +0000 | |
| commit | fd64019fcb1a0e08ef46b852ef6829f1a6853cf4 (patch) | |
| tree | 84f0e5e6bf9a9297ea8d7c0eb018d4314990a36f | |
| parent | 333bb7814f8a6ac28425cdd88813e720f49af322 (diff) | |
| parent | 078de472720781ddd92fcc215b085f4ae4be2a72 (diff) | |
Merge "Dont remove system role when disassociate" into udc-dev
| -rw-r--r-- | services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java index 542cc2f0a0a6..5b320a87d113 100644 --- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java +++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java @@ -19,6 +19,7 @@ package com.android.server.companion; import static android.Manifest.permission.MANAGE_COMPANION_DEVICES; import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE; +import static android.companion.AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION; import static android.content.pm.PackageManager.CERT_INPUT_SHA256; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.os.Process.SYSTEM_UID; @@ -1066,6 +1067,10 @@ public class CompanionDeviceManagerService extends SystemService { // No role was granted to for this association, there is nothing else we need to here. return true; } + // Do not need to remove the system role since it was pre-granted by the system. + if (deviceProfile.equals(DEVICE_PROFILE_AUTOMOTIVE_PROJECTION)) { + return true; + } // Check if the applications is associated with another devices with the profile. If so, // it should remain the role holder. |