Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d573c7db authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski
Browse files

Fix crashing converted files warning dialog.

Test: Tested manually that the dialog works.
Bug: None
Change-Id: I8e708fbf889dec96ca4d9992581e92463704391a
parent d7ed947c
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -59,7 +59,7 @@ public class OperationDialogFragment extends DialogFragment {
            FragmentManager fm,
            FragmentManager fm,
            @DialogType int dialogType,
            @DialogType int dialogType,
            ArrayList<DocumentInfo> failedSrcList,
            ArrayList<DocumentInfo> failedSrcList,
            ArrayList<DocumentInfo> uriList,
            ArrayList<Uri> uriList,
            DocumentStack dstStack,
            DocumentStack dstStack,
            @OpType int operationType) {
            @OpType int operationType) {


@@ -127,9 +127,11 @@ public class OperationDialogFragment extends DialogFragment {
        for (DocumentInfo documentInfo : docList) {
        for (DocumentInfo documentInfo : docList) {
            list.append("&#8226; " + Html.escapeHtml(documentInfo.displayName) + "<br>");
            list.append("&#8226; " + Html.escapeHtml(documentInfo.displayName) + "<br>");
        }
        }
        if (uriList != null) {
            for (Uri uri : uriList) {
            for (Uri uri : uriList) {
                list.append("&#8226; " + uri.toSafeString() + "<br>");
                list.append("&#8226; " + uri.toSafeString() + "<br>");
            }
            }
        }
        list.append("</p>");
        list.append("</p>");


        builder.setMessage(Html.fromHtml(String.format(messageFormat, list.toString())));
        builder.setMessage(Html.fromHtml(String.format(messageFormat, list.toString())));
+1 −1
Original line number Original line Diff line number Diff line
@@ -156,7 +156,7 @@ public class FilesActivity extends BaseActivity implements ActionHandler.Addons
                    FileOperationService.OPERATION_COPY);
                    FileOperationService.OPERATION_COPY);
            final ArrayList<DocumentInfo> docList =
            final ArrayList<DocumentInfo> docList =
                    intent.getParcelableArrayListExtra(FileOperationService.EXTRA_FAILED_DOCS);
                    intent.getParcelableArrayListExtra(FileOperationService.EXTRA_FAILED_DOCS);
            final ArrayList<DocumentInfo> uriList =
            final ArrayList<Uri> uriList =
                    intent.getParcelableArrayListExtra(FileOperationService.EXTRA_FAILED_URIS);
                    intent.getParcelableArrayListExtra(FileOperationService.EXTRA_FAILED_URIS);
            OperationDialogFragment.show(
            OperationDialogFragment.show(
                    getFragmentManager(),
                    getFragmentManager(),
+2 −1
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@ import static com.android.documentsui.base.DocumentInfo.getCursorString;
import static com.android.documentsui.base.Shared.DEBUG;
import static com.android.documentsui.base.Shared.DEBUG;
import static com.android.documentsui.services.FileOperationService.EXTRA_DIALOG_TYPE;
import static com.android.documentsui.services.FileOperationService.EXTRA_DIALOG_TYPE;
import static com.android.documentsui.services.FileOperationService.EXTRA_OPERATION_TYPE;
import static com.android.documentsui.services.FileOperationService.EXTRA_OPERATION_TYPE;
import static com.android.documentsui.services.FileOperationService.EXTRA_FAILED_DOCS;
import static com.android.documentsui.services.FileOperationService.EXTRA_SRC_LIST;
import static com.android.documentsui.services.FileOperationService.EXTRA_SRC_LIST;
import static com.android.documentsui.services.FileOperationService.OPERATION_COPY;
import static com.android.documentsui.services.FileOperationService.OPERATION_COPY;


@@ -195,7 +196,7 @@ class CopyJob extends ResolvedResourcesJob {
        navigateIntent.putExtra(EXTRA_DIALOG_TYPE, DIALOG_TYPE_CONVERTED);
        navigateIntent.putExtra(EXTRA_DIALOG_TYPE, DIALOG_TYPE_CONVERTED);
        navigateIntent.putExtra(EXTRA_OPERATION_TYPE, operationType);
        navigateIntent.putExtra(EXTRA_OPERATION_TYPE, operationType);


        navigateIntent.putParcelableArrayListExtra(EXTRA_SRC_LIST, convertedFiles);
        navigateIntent.putParcelableArrayListExtra(EXTRA_FAILED_DOCS, convertedFiles);


        // TODO: Consider adding a dialog on tapping the notification with a list of
        // TODO: Consider adding a dialog on tapping the notification with a list of
        // converted files.
        // converted files.