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

Commit 4f04fd35 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Fix the logic to add suffix when copying.

Previously the logic add '.' even if the extension is empty.

BUG=27729309

Change-Id: I3fa4b09fea977b5c716ec5cbbbc7d9f4ab96db08
parent f9845b4e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -360,8 +360,12 @@ public class MtpDocumentsProvider extends DocumentsProvider {
                    if (i == 0) {
                        infoUniqueName = info;
                    } else {
                        infoUniqueName = new MtpObjectInfo.Builder(info).setName(
                                baseName + " (" + i + ")." + extension).build();
                        String suffixedName = baseName + " (" + i + " )";
                        if (!extension.isEmpty()) {
                            suffixedName += "." + extension;
                        }
                        infoUniqueName =
                                new MtpObjectInfo.Builder(info).setName(suffixedName).build();
                    }
                    try {
                        objectHandle = mMtpManager.createDocument(