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

Commit 97fa6df5 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge branch '8008-main-pdf_fix' into 'main'

show the attachment name with an extension when sharing or opening from another app

See merge request !177
parents 45bc00b5 36ee0b10
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -42,12 +42,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
@@ -133,7 +133,7 @@ public class AttachmentController {
    private Intent getBestViewIntent() {
        Uri intentDataUri;
        try {
            intentDataUri = AttachmentTempFileProvider.createTempUriForContentUri(context, attachment.internalUri);
            intentDataUri = AttachmentTempFileProvider.createTempUriForContentUri(context, attachment.internalUri, attachment.displayName);
        } catch (IOException e) {
            Timber.e(e, "Error creating temp file for attachment!");
            return null;