refactor(PhotoViewer): use getFileProviderUri

This commit is contained in:
FineFindus 2024-05-25 11:11:41 +02:00
parent 5d3afc1b0e
commit 965f7c6d1d
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.model.Attachment; import org.joinmastodon.android.model.Attachment;
import org.joinmastodon.android.model.Status; import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.ui.M3AlertDialogBuilder; 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.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -647,7 +647,7 @@ public class PhotoViewer implements ZoomPanView.Listener{
private void shareFile(@NonNull File file) { private void shareFile(@NonNull File file) {
Intent intent = new Intent(Intent.ACTION_SEND); 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.setDataAndType(outputUri, mimeTypeForFileName(outputUri.getLastPathSegment()));
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, outputUri); intent.putExtra(Intent.EXTRA_STREAM, outputUri);