Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aebc966 authored by Vasu Nori's avatar Vasu Nori Committed by Android (Google) Code Review
Browse files

Merge "add method in MediaFile to determine if a file is a mediatype of not"

parents 5da5438e 45b43622
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -229,6 +229,12 @@ public class MediaFile {
        return sFileTypeMap.get(path.substring(lastDot + 1).toUpperCase());
    }

    public static boolean isMimeTypeMedia(String mimeType) {
        int fileType = getFileTypeForMimeType(mimeType);
        return isAudioFileType(fileType) || isVideoFileType(fileType)
                || isImageFileType(fileType) || isPlayListFileType(fileType);
    }

    // generates a title based on file name
    public static String getFileTitle(String path) {
        // extract file name after last slash