Loading services/java/com/android/server/ClipboardService.java +20 −15 Original line number Diff line number Diff line Loading @@ -154,15 +154,18 @@ public class ClipboardService extends IClipboard.Stub { if (clip != null && clip.getItemCount() <= 0) { throw new IllegalArgumentException("No items"); } if (mAppOps.noteOp(AppOpsManager.OP_WRITE_CLIPBOARD, Binder.getCallingUid(), final int callingUid = Binder.getCallingUid(); if (mAppOps.noteOp(AppOpsManager.OP_WRITE_CLIPBOARD, callingUid, callingPackage) != AppOpsManager.MODE_ALLOWED) { return; } checkDataOwnerLocked(clip, Binder.getCallingUid()); checkDataOwnerLocked(clip, callingUid); clearActiveOwnersLocked(); PerUserClipboard clipboard = getClipboard(); clipboard.primaryClip = clip; final long ident = Binder.clearCallingIdentity(); final int n = clipboard.primaryClipListeners.beginBroadcast(); try { for (int i = 0; i < n; i++) { try { ListenerInfo li = (ListenerInfo) Loading @@ -173,12 +176,14 @@ public class ClipboardService extends IClipboard.Stub { .dispatchPrimaryClipChanged(); } } catch (RemoteException e) { // The RemoteCallbackList will take care of removing // the dead object for us. } } } finally { clipboard.primaryClipListeners.finishBroadcast(); Binder.restoreCallingIdentity(ident); } } } Loading Loading
services/java/com/android/server/ClipboardService.java +20 −15 Original line number Diff line number Diff line Loading @@ -154,15 +154,18 @@ public class ClipboardService extends IClipboard.Stub { if (clip != null && clip.getItemCount() <= 0) { throw new IllegalArgumentException("No items"); } if (mAppOps.noteOp(AppOpsManager.OP_WRITE_CLIPBOARD, Binder.getCallingUid(), final int callingUid = Binder.getCallingUid(); if (mAppOps.noteOp(AppOpsManager.OP_WRITE_CLIPBOARD, callingUid, callingPackage) != AppOpsManager.MODE_ALLOWED) { return; } checkDataOwnerLocked(clip, Binder.getCallingUid()); checkDataOwnerLocked(clip, callingUid); clearActiveOwnersLocked(); PerUserClipboard clipboard = getClipboard(); clipboard.primaryClip = clip; final long ident = Binder.clearCallingIdentity(); final int n = clipboard.primaryClipListeners.beginBroadcast(); try { for (int i = 0; i < n; i++) { try { ListenerInfo li = (ListenerInfo) Loading @@ -173,12 +176,14 @@ public class ClipboardService extends IClipboard.Stub { .dispatchPrimaryClipChanged(); } } catch (RemoteException e) { // The RemoteCallbackList will take care of removing // the dead object for us. } } } finally { clipboard.primaryClipListeners.finishBroadcast(); Binder.restoreCallingIdentity(ident); } } } Loading