Merge "Do not throw SecurityException from getPrimaryClip." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
757c109f32
@@ -379,7 +379,15 @@ public class ClipboardService extends SystemService {
|
||||
return null;
|
||||
}
|
||||
synchronized (mLock) {
|
||||
addActiveOwnerLocked(intendingUid, pkg);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user