mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 19:15:16 +00:00
4cb2ac7b27
Fixes #7237
22 lines
656 B
Java
22 lines
656 B
Java
package org.thoughtcrime.securesms.util;
|
|
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import android.os.Build;
|
|
import android.support.annotation.NonNull;
|
|
import android.support.v4.content.FileProvider;
|
|
|
|
import java.io.File;
|
|
|
|
public class FileProviderUtil {
|
|
|
|
private static final String AUTHORITY = "org.thoughtcrime.securesms.fileprovider";
|
|
|
|
public static Uri getUriFor(@NonNull Context context, @NonNull File file) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) return FileProvider.getUriForFile(context, AUTHORITY, file);
|
|
else return Uri.fromFile(file);
|
|
}
|
|
|
|
}
|