Loading core/java/android/content/ClipboardManager.java +0 −6 Original line number Diff line number Diff line Loading @@ -95,9 +95,6 @@ public class ClipboardManager extends android.text.ClipboardManager { * Sets the current primary clip on the clipboard. This is the clip that * is involved in normal cut and paste operations. * * <em>If the application is not the default IME or does not have input focus this will have * no effect.</em> * * @param clip The clipped data item to set. * @see #getPrimaryClip() * @see #clearPrimaryClip() Loading @@ -115,9 +112,6 @@ public class ClipboardManager extends android.text.ClipboardManager { /** * Clears any current primary clip on the clipboard. * * <em>If the application is not the default IME or does not have input focus this will have * no effect.</em> * * @see #setPrimaryClip(ClipData) */ public void clearPrimaryClip() { Loading services/core/java/com/android/server/clipboard/ClipboardService.java +14 −6 Original line number Diff line number Diff line Loading @@ -639,12 +639,20 @@ public class ClipboardService extends SystemService { } } // Otherwise only focused applications can access the clipboard. switch (op) { case AppOpsManager.OP_READ_CLIPBOARD: // Clipboard can only be read by applications with focus. boolean uidFocused = mWm.isUidFocused(callingUid); if (!uidFocused) { Slog.e(TAG, "Denying clipboard access to " + callingPackage + ", application is not in focus."); } return uidFocused; case AppOpsManager.OP_WRITE_CLIPBOARD: // Writing is allowed without focus. return true; default: throw new IllegalArgumentException("Unknown clipboard appop " + op); } } } Loading
core/java/android/content/ClipboardManager.java +0 −6 Original line number Diff line number Diff line Loading @@ -95,9 +95,6 @@ public class ClipboardManager extends android.text.ClipboardManager { * Sets the current primary clip on the clipboard. This is the clip that * is involved in normal cut and paste operations. * * <em>If the application is not the default IME or does not have input focus this will have * no effect.</em> * * @param clip The clipped data item to set. * @see #getPrimaryClip() * @see #clearPrimaryClip() Loading @@ -115,9 +112,6 @@ public class ClipboardManager extends android.text.ClipboardManager { /** * Clears any current primary clip on the clipboard. * * <em>If the application is not the default IME or does not have input focus this will have * no effect.</em> * * @see #setPrimaryClip(ClipData) */ public void clearPrimaryClip() { Loading
services/core/java/com/android/server/clipboard/ClipboardService.java +14 −6 Original line number Diff line number Diff line Loading @@ -639,12 +639,20 @@ public class ClipboardService extends SystemService { } } // Otherwise only focused applications can access the clipboard. switch (op) { case AppOpsManager.OP_READ_CLIPBOARD: // Clipboard can only be read by applications with focus. boolean uidFocused = mWm.isUidFocused(callingUid); if (!uidFocused) { Slog.e(TAG, "Denying clipboard access to " + callingPackage + ", application is not in focus."); } return uidFocused; case AppOpsManager.OP_WRITE_CLIPBOARD: // Writing is allowed without focus. return true; default: throw new IllegalArgumentException("Unknown clipboard appop " + op); } } }