From 56904d05878fe8698cb3336fdfd954c23878d24d Mon Sep 17 00:00:00 2001 From: Feng Cao Date: Fri, 24 May 2019 14:45:57 -0700 Subject: [PATCH] Fix clipboard permission issue for AugmentedAutofillService provider. Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.ClipboardAccessTest Fixes: 133324239 Change-Id: I3b46f022e1c65b28c397544851c4b402b5066cdc --- .../java/com/android/server/clipboard/ClipboardService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java index af25ad56a2a79..b279b370c611f 100644 --- a/services/core/java/com/android/server/clipboard/ClipboardService.java +++ b/services/core/java/com/android/server/clipboard/ClipboardService.java @@ -775,8 +775,7 @@ public class ClipboardService extends SystemService { // if the application has the permission, let it to access user's clipboard. // To passed synthesized uid user#10_app#systemui may not tell the real uid. // userId must pass intending userId. i.e. user#10. - allowed = mContentCaptureInternal.isContentCaptureServiceForUser( - Binder.getCallingUid(), userId); + allowed = mContentCaptureInternal.isContentCaptureServiceForUser(uid, userId); } if (!allowed && mAutofillInternal != null) { // ...or the Augmented Autofill Service @@ -785,8 +784,7 @@ public class ClipboardService extends SystemService { // if the application has the permission, let it to access user's clipboard. // To passed synthesized uid user#10_app#systemui may not tell the real uid. // userId must pass intending userId. i.e. user#10. - allowed = mAutofillInternal.isAugmentedAutofillServiceForUser( - Binder.getCallingUid(), userId); + allowed = mAutofillInternal.isAugmentedAutofillServiceForUser(uid, userId); } if (!allowed) { Slog.e(TAG, "Denying clipboard access to " + callingPackage