diff options
| author | 2022-05-14 06:06:55 +0000 | |
|---|---|---|
| committer | 2022-05-14 06:06:55 +0000 | |
| commit | 5f7154db85bfa13586ed8d3cc690b92cda79a042 (patch) | |
| tree | 0554b8cac3ed88882f62ab5259b19dd6e65bbb25 | |
| parent | f505fefdd6e17ac1eeae938245c1655c8249ae27 (diff) | |
| parent | f9dded9434277127a03fe80a6cc896c85c8b5e30 (diff) | |
Merge "Remove role checker for non-selfManaged association" into tm-dev
| -rw-r--r-- | services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java b/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java index 7a5fa628f645..570e4e6fdc3d 100644 --- a/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java +++ b/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java @@ -182,7 +182,7 @@ class AssociationRequestsProcessor { // 2b.1. Populate the request with required info. request.setPackageName(packageName); request.setUserId(userId); - request.setSkipPrompt(mayAssociateWithoutPrompt(request, packageName, userId)); + request.setSkipPrompt(mayAssociateWithoutPrompt(packageName, userId)); // 2b.2. Prepare extras and create an Intent. final Bundle extras = new Bundle(); @@ -321,18 +321,7 @@ class AssociationRequestsProcessor { } }; - private boolean mayAssociateWithoutPrompt(@NonNull AssociationRequest request, - @NonNull String packageName, @UserIdInt int userId) { - final String deviceProfile = request.getDeviceProfile(); - if (deviceProfile != null) { - final boolean isRoleHolder = Binder.withCleanCallingIdentity( - () -> isRoleHolder(mContext, userId, packageName, deviceProfile)); - if (isRoleHolder) { - // Don't need to collect user's consent since app already holds the role. - return true; - } - } - + private boolean mayAssociateWithoutPrompt(@NonNull String packageName, @UserIdInt int userId) { // Below we check if the requesting package is allowlisted (usually by the OEM) for creating // CDM associations without user confirmation (prompt). // For this we'll check to config arrays: |