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

Unverified Commit 80c2a363 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #8129 from arissystem/Hotfix-8045

show the attachment name with an extension when sharing or opening from another app
parents 512a57a8 b118e353
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -43,12 +43,12 @@ public class AttachmentTempFileProvider extends FileProvider {
    }

    @WorkerThread
    public static Uri createTempUriForContentUri(Context context, Uri uri) throws IOException {
    public static Uri createTempUriForContentUri(Context context, Uri uri, String displayName) throws IOException {
        Context applicationContext = context.getApplicationContext();

        File tempFile = getTempFileForUri(uri, applicationContext);
        writeUriContentToTempFileIfNotExists(context, uri, tempFile);
        Uri tempFileUri = FileProvider.getUriForFile(context, AUTHORITY, tempFile);
        Uri tempFileUri = FileProvider.getUriForFile(context, AUTHORITY, tempFile, displayName);

        registerFileCleanupReceiver(applicationContext);

+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ public class AttachmentController {
    @WorkerThread
    private Intent getBestViewIntent() {
        try {
            Uri intentDataUri = AttachmentTempFileProvider.createTempUriForContentUri(context, attachment.internalUri);
            Uri intentDataUri = AttachmentTempFileProvider.createTempUriForContentUri(context, attachment.internalUri, attachment.displayName);

            return viewIntentFinder.getBestViewIntent(intentDataUri, attachment.displayName, attachment.mimeType);
        } catch (IOException e) {