Fix a bug that when user pastes a doc, the breadcrumb adds a doc to it.
Change-Id: Icf5c182b8388bd7320669d55a9ae9be8786dbc3b
diff --git a/src/com/android/documentsui/base/DocumentStack.java b/src/com/android/documentsui/base/DocumentStack.java
index 9e0c580..34728a7 100644
--- a/src/com/android/documentsui/base/DocumentStack.java
+++ b/src/com/android/documentsui/base/DocumentStack.java
@@ -78,11 +78,11 @@
}
/**
- * Makes a new shallow copy, and pushes all docs to the new copy in the same order as they're
+ * Makes a new copy, and pushes all docs to the new copy in the same order as they're
* passed as parameters, i.e. the last document will be at the top of the stack.
*/
public DocumentStack(DocumentStack src, DocumentInfo... docs) {
- mList = src.mList;
+ mList = new LinkedList<>(src.mList);
for (DocumentInfo doc : docs) {
mList.addLast(doc);
}