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

this helps DownloadService to avoid invoking MediaScanner on
pdf or other non-mediatype files.

Change-Id: I92514e1a11f5119229c0c7292e410e352a9dbcdd
This commit is contained in:
Vasu Nori
2010-10-26 16:12:27 -07:00
parent b73cf1cc39
commit 45b43622e3

View File

@@ -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