am 350b99c0: am 483bd842: Merge "Only send EXTRA_STACK for private intent." into mnc-dev

* commit '350b99c0027902db22004ea037265349155d7c38':
  Only send EXTRA_STACK for private intent.
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
index c541bca..a57bcc6 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java
@@ -720,14 +720,15 @@
 
         if (mState.action == ACTION_GET_CONTENT) {
             intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
-        } else if (mState.action == ACTION_OPEN_TREE ||
-                   mState.action == ACTION_OPEN_COPY_DESTINATION) {
+        } else if (mState.action == ACTION_OPEN_TREE) {
             intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
                     | Intent.FLAG_GRANT_WRITE_URI_PERMISSION
                     | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION
                     | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
-            // TODO: Move passing the stack to the separate ACTION_COPY action once it's implemented.
-            intent.putExtra(CopyService.EXTRA_STACK, (Parcelable)mState.stack);
+        } else if (mState.action == ACTION_OPEN_COPY_DESTINATION) {
+            // Picking a copy destination is only used internally by us, so we
+            // don't need to extend permissions to the caller.
+            intent.putExtra(CopyService.EXTRA_STACK, (Parcelable) mState.stack);
         } else {
             intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
                     | Intent.FLAG_GRANT_WRITE_URI_PERMISSION