Merge "Don't append userIds for the current user's clipData uris." into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e723ed8b51
@@ -191,6 +191,14 @@ public class ClipData implements Parcelable {
|
|||||||
final Intent mIntent;
|
final Intent mIntent;
|
||||||
Uri mUri;
|
Uri mUri;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
public Item(Item other) {
|
||||||
|
mText = other.mText;
|
||||||
|
mHtmlText = other.mHtmlText;
|
||||||
|
mIntent = other.mIntent;
|
||||||
|
mUri = other.mUri;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an Item consisting of a single block of (possibly styled) text.
|
* Create an Item consisting of a single block of (possibly styled) text.
|
||||||
*/
|
*/
|
||||||
@@ -816,6 +824,11 @@ public class ClipData implements Parcelable {
|
|||||||
return mItems.get(index);
|
return mItems.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
public void setItemAt(int index, Item item) {
|
||||||
|
mItems.set(index, item);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare this {@link ClipData} to leave an app process.
|
* Prepare this {@link ClipData} to leave an app process.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -188,6 +188,14 @@ public class ClipboardService extends IClipboard.Stub {
|
|||||||
if (!canCopy) {
|
if (!canCopy) {
|
||||||
clip = null;
|
clip = null;
|
||||||
} else {
|
} else {
|
||||||
|
// We want to fix the uris of the related user's clip without changing the
|
||||||
|
// uris of the current user's clip.
|
||||||
|
// So, copy the ClipData, and then copy all the items, so that nothing
|
||||||
|
// is shared in memmory.
|
||||||
|
clip = new ClipData(clip);
|
||||||
|
for (int i = clip.getItemCount() - 1; i >= 0; i--) {
|
||||||
|
clip.setItemAt(i, new ClipData.Item(clip.getItemAt(i)));
|
||||||
|
}
|
||||||
clip.fixUrisLight(userId);
|
clip.fixUrisLight(userId);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user