From 965f7c6d1dc5c68761de5e79f599ba667e307353 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sat, 25 May 2024 11:11:41 +0200 Subject: [PATCH] refactor(PhotoViewer): use getFileProviderUri --- .../org/joinmastodon/android/ui/photoviewer/PhotoViewer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java index abd203967..27fdc7825 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java @@ -59,7 +59,7 @@ import org.joinmastodon.android.api.session.AccountSessionManager; import org.joinmastodon.android.model.Attachment; import org.joinmastodon.android.model.Status; import org.joinmastodon.android.ui.M3AlertDialogBuilder; -import org.joinmastodon.android.utils.FileProvider; +import org.joinmastodon.android.ui.utils.UiUtils; import java.io.File; import java.io.FileOutputStream; @@ -647,7 +647,7 @@ public class PhotoViewer implements ZoomPanView.Listener{ private void shareFile(@NonNull File file) { Intent intent = new Intent(Intent.ACTION_SEND); - Uri outputUri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".fileprovider", file); + Uri outputUri = UiUtils.getFileProviderUri(activity, file); intent.setDataAndType(outputUri, mimeTypeForFileName(outputUri.getLastPathSegment())); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.putExtra(Intent.EXTRA_STREAM, outputUri);