Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,9 @@ <!-- Text shown on button to open an application --> <string name="open_app">Open <xliff:g id="name" example="Cloud Storage">%1$s</xliff:g></string> <!-- File name of an archive file created when compressing files, without the file extension (.zip). --> <string name="new_archive_file_name">archive<xliff:g id="extension" example=".zip">%s</xliff:g></string> <!-- Dialog text shown when confirming if they want to overwrite a file --> <string name="overwrite_file_confirmation_message">Overwrite <xliff:g id="name" example="foobar.txt">%1$s</xliff:g>?</string> </resources> src/com/android/documentsui/services/CompressJob.java +10 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import javax.annotation.Nullable; final class CompressJob extends CopyJob { private static final String TAG = "CompressJob"; private static final String NEW_ARCHIVE_EXTENSION = ".zip"; /** * Moves files to a destination identified by {@code destination}. Loading Loading @@ -92,9 +93,16 @@ final class CompressJob extends CopyJob { final ContentResolver resolver = appContext.getContentResolver(); // TODO: Move this to DocumentsProvider. // TODO: Choose better dispaly name. String displayName; if (mResolvedDocs.size() == 1) { displayName = mResolvedDocs.get(0).displayName + NEW_ARCHIVE_EXTENSION; } else { displayName = service.getString(R.string.new_archive_file_name, NEW_ARCHIVE_EXTENSION); } final Uri archiveUri = DocumentsContract.createDocument( resolver, mDstInfo.derivedUri, "application/zip", "archive.zip"); resolver, mDstInfo.derivedUri, "application/zip", displayName); try { mDstInfo = DocumentInfo.fromUri(resolver, ArchivesProvider.buildUriForArchive( Loading Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,9 @@ <!-- Text shown on button to open an application --> <string name="open_app">Open <xliff:g id="name" example="Cloud Storage">%1$s</xliff:g></string> <!-- File name of an archive file created when compressing files, without the file extension (.zip). --> <string name="new_archive_file_name">archive<xliff:g id="extension" example=".zip">%s</xliff:g></string> <!-- Dialog text shown when confirming if they want to overwrite a file --> <string name="overwrite_file_confirmation_message">Overwrite <xliff:g id="name" example="foobar.txt">%1$s</xliff:g>?</string> </resources>
src/com/android/documentsui/services/CompressJob.java +10 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import javax.annotation.Nullable; final class CompressJob extends CopyJob { private static final String TAG = "CompressJob"; private static final String NEW_ARCHIVE_EXTENSION = ".zip"; /** * Moves files to a destination identified by {@code destination}. Loading Loading @@ -92,9 +93,16 @@ final class CompressJob extends CopyJob { final ContentResolver resolver = appContext.getContentResolver(); // TODO: Move this to DocumentsProvider. // TODO: Choose better dispaly name. String displayName; if (mResolvedDocs.size() == 1) { displayName = mResolvedDocs.get(0).displayName + NEW_ARCHIVE_EXTENSION; } else { displayName = service.getString(R.string.new_archive_file_name, NEW_ARCHIVE_EXTENSION); } final Uri archiveUri = DocumentsContract.createDocument( resolver, mDstInfo.derivedUri, "application/zip", "archive.zip"); resolver, mDstInfo.derivedUri, "application/zip", displayName); try { mDstInfo = DocumentInfo.fromUri(resolver, ArchivesProvider.buildUriForArchive( Loading