diff options
| author | Nicolas Prevot <nprevot@google.com> | 2014-06-25 09:29:02 +0100 |
|---|---|---|
| committer | Nicolas Prévot <nprevot@google.com> | 2014-07-24 10:25:57 +0000 |
| commit | f1939901d2ed0480069f0b23be64f122fce93995 (patch) | |
| tree | cebc40b9a7c15cd56cff7154da2a5b3f19888061 /core/java/android/content/ClipData.java | |
| parent | 3ea4310a2245763de1ba29b8ce0a21e99a702746 (diff) | |
Making the clipboard work across users.
When copying from the parent: the ClipData can be pasted in the managed profile.
When copying from a managed profile: it can be pasted in the parent,
unless the policies says it's disabled. In which case, the clipboard of the parent becomes empty.
Supporting content uris.
BUG: 15186236
Change-Id: I522564a7c07ff21df137adcda980bb52e5739964
Diffstat (limited to 'core/java/android/content/ClipData.java')
| -rw-r--r-- | core/java/android/content/ClipData.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java index b44abf93eca2..7a16ef8aefd7 100644 --- a/core/java/android/content/ClipData.java +++ b/core/java/android/content/ClipData.java @@ -828,6 +828,26 @@ public class ClipData implements Parcelable { } } + /** + * Only fixing the data field of the intents + * @hide + */ + public void fixUrisLight(int contentUserHint) { + final int size = mItems.size(); + for (int i = 0; i < size; i++) { + final Item item = mItems.get(i); + if (item.mIntent != null) { + Uri data = item.mIntent.getData(); + if (data != null) { + item.mIntent.setData(maybeAddUserId(data, contentUserHint)); + } + } + if (item.mUri != null) { + item.mUri = maybeAddUserId(item.mUri, contentUserHint); + } + } + } + @Override public String toString() { StringBuilder b = new StringBuilder(128); |
