Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8884eba authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Do not throw SecurityException from getPrimaryClip." into sc-dev am: 757c109f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14519404

Change-Id: I146891c1c68e0b4a9060d99839d4be3807cfcbab
parents 528f9bdd 757c109f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -379,7 +379,15 @@ public class ClipboardService extends SystemService {
                return null;
            }
            synchronized (mLock) {
                try {
                    addActiveOwnerLocked(intendingUid, pkg);
                } catch (SecurityException e) {
                    // Permission could not be granted - URI may be invalid
                    Slog.i(TAG, "Could not grant permission to primary clip. Clearing clipboard.");
                    setPrimaryClipInternalLocked(null, intendingUid, pkg);
                    return null;
                }

                PerUserClipboard clipboard = getClipboardLocked(intendingUserId);
                showAccessNotificationLocked(pkg, intendingUid, intendingUserId, clipboard);
                notifyTextClassifierLocked(clipboard, pkg, intendingUid);