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

Commit fd7460a0 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:...

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

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

Change-Id: I48aa792e568b5fffbfeaac2fe6f2a79ba2a1d6f0
parents 6f10cd5d d8884eba
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);