Merge "Remove retry logic from DocumentsUI."
diff --git a/packages/DocumentsUI/res/values/strings.xml b/packages/DocumentsUI/res/values/strings.xml
index 8ac228e..5a9bc16 100644
--- a/packages/DocumentsUI/res/values/strings.xml
+++ b/packages/DocumentsUI/res/values/strings.xml
@@ -179,8 +179,8 @@
     </plurals>
     <!-- Second line for notifications saying that more information will be shown after touching [CHAR LIMIT=48] -->
     <string name="notification_touch_for_details">Tap to view details</string>
-    <!-- Label of a dialog button for retrying a failed operation [CHAR LIMIT=24] -->
-    <string name="retry">Retry</string>
+    <!-- Label of the close dialog button.[CHAR LIMIT=24] -->
+    <string name="close">Close</string>
     <!-- Contents of the copying failure alert dialog. [CHAR LIMIT=48] -->
     <string name="copy_failure_alert_content">These files weren\'t copied: <xliff:g id="list">%1$s</xliff:g></string>
     <!-- Contents of the moving failure alert dialog. [CHAR LIMIT=48] -->
diff --git a/packages/DocumentsUI/src/com/android/documentsui/FailureDialogFragment.java b/packages/DocumentsUI/src/com/android/documentsui/FailureDialogFragment.java
index 7f6f1c6..b8ef5ac 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/FailureDialogFragment.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/FailureDialogFragment.java
@@ -33,17 +33,14 @@
 import com.android.documentsui.services.FileOperations;
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Alert dialog for failed operations.
  */
-public class FailureDialogFragment extends DialogFragment
-        implements DialogInterface.OnClickListener {
+public class FailureDialogFragment extends DialogFragment {
     private static final String TAG = "FailureDialogFragment";
 
-    private int mOperationType;
-    private ArrayList<DocumentInfo> mFailedSrcList;
-
     public static void show(FragmentManager fm, int failure,
             ArrayList<DocumentInfo> failedSrcList, DocumentStack dstStack, int operationType) {
         // TODO: Add support for other failures than copy.
@@ -65,36 +62,25 @@
     }
 
     @Override
-    public void onClick(DialogInterface dialog, int whichButton) {
-        if (whichButton == DialogInterface.BUTTON_POSITIVE) {
-            FileOperations.start(
-                    getActivity(),
-                    mFailedSrcList,
-                    (DocumentStack) getActivity().getIntent().getParcelableExtra(
-                            Shared.EXTRA_STACK),
-                    mOperationType);
-        }
-    }
-
-    @Override
     public Dialog onCreateDialog(Bundle inState) {
         super.onCreate(inState);
 
-        mOperationType = getArguments().getInt(FileOperationService.EXTRA_OPERATION);
-        mFailedSrcList = getArguments().getParcelableArrayList(FileOperationService.EXTRA_SRC_LIST);
+        final int operationType = getArguments().getInt(FileOperationService.EXTRA_OPERATION);
+        final List<DocumentInfo> failedSrcList = getArguments().getParcelableArrayList(
+                FileOperationService.EXTRA_SRC_LIST);
 
         final StringBuilder list = new StringBuilder("<p>");
-        for (DocumentInfo documentInfo : mFailedSrcList) {
+        for (DocumentInfo documentInfo : failedSrcList) {
             list.append(String.format("&#8226; %s<br>", documentInfo.displayName));
         }
         list.append("</p>");
 
         // TODO: Add support for other file operations.
         checkArgument(
-                mOperationType == FileOperationService.OPERATION_COPY
-                || mOperationType == FileOperationService.OPERATION_MOVE);
+                operationType == FileOperationService.OPERATION_COPY
+                || operationType == FileOperationService.OPERATION_MOVE);
 
-        int messageId = mOperationType == FileOperationService.OPERATION_COPY
+        int messageId = operationType == FileOperationService.OPERATION_COPY
                 ? R.string.copy_failure_alert_content
                 : R.string.move_failure_alert_content;
 
@@ -105,8 +91,12 @@
 
         return new AlertDialog.Builder(getActivity())
                 .setMessage(Html.fromHtml(message))
-                .setPositiveButton(R.string.retry, this)
-                .setNegativeButton(android.R.string.cancel, this)
+                .setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int id) {
+                        dialog.dismiss();
+                    }
+                })
                 .create();
     }
 }