// Path: belvedere-core/src/main/java/zendesk/belvedere/MediaResult.java
// public static final long UNKNOWN_VALUE = -1L;


import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.MimeTypeMap;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import static zendesk.belvedere.MediaResult.UNKNOWN_VALUE;
     */
    private static String getFileNameFromUri(Context context, Uri uri) {
        final String schema = uri.getScheme();
        String path = "";

        if (ContentResolver.SCHEME_CONTENT.equals(schema)) {
            final String[] projection = {MediaStore.MediaColumns.DISPLAY_NAME};
            final ContentResolver contentResolver = context.getContentResolver();
            final Cursor cursor = contentResolver.query(uri, projection, null, null, null);

            if (cursor != null) {
                try {
                    if (cursor.moveToFirst()) {
                        path = cursor.getString(0);
                    }
                } finally {
                    cursor.close();
                }
            }

        } else if (ContentResolver.SCHEME_FILE.equals(schema)) {
            path = uri.getLastPathSegment();

        }

        return path;
    }

    static MediaResult getMediaResultForUri(Context context, Uri uri) {
        final String schema = uri.getScheme();
// Path: belvedere-core/src/main/java/zendesk/belvedere/MediaResult.java
// public static final long UNKNOWN_VALUE = -1L;


// Path: belvedere-core/src/main/java/zendesk/belvedere/Storage.java
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.MimeTypeMap;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import static zendesk.belvedere.MediaResult.UNKNOWN_VALUE;

     */
    private static String getFileNameFromUri(Context context, Uri uri) {
        final String schema = uri.getScheme();
        String path = "";

        if (ContentResolver.SCHEME_CONTENT.equals(schema)) {
            final String[] projection = {MediaStore.MediaColumns.DISPLAY_NAME};
            final ContentResolver contentResolver = context.getContentResolver();
            final Cursor cursor = contentResolver.query(uri, projection, null, null, null);

            if (cursor != null) {
                try {
                    if (cursor.moveToFirst()) {
                        path = cursor.getString(0);
                    }
                } finally {
                    cursor.close();
                }
            }

        } else if (ContentResolver.SCHEME_FILE.equals(schema)) {
            path = uri.getLastPathSegment();

        }

        return path;
    }

    static MediaResult getMediaResultForUri(Context context, Uri uri) {
        final String schema = uri.getScheme();
        long size = UNKNOWN_VALUE;