0
0
mirror of https://github.com/thunderbird/thunderbird-android.git synced 2024-09-19 19:52:14 +02:00

Merge pull request #8129 from arissystem/Hotfix-8045

show the attachment name with an extension when sharing or opening from another app
This commit is contained in:
cketti 2024-09-10 11:07:01 +02:00 committed by GitHub
commit 80c2a363c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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) {