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

Commit 686a671d authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

Issue 6743: CM FileManager can't recognize file types if named with capital suffix

Issue: http://code.google.com/p/cyanogenmod/issues/detail?id=6743

Added case compare to extension and mime/types.

Change-Id: I394472e03b5a92590088fdebbb75dd13ee4bade2
parent fe6aaa76
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
# Mime type list
#
# Format:
#    <extension> = <category> | <mime type> | <drawable>
#    (extension) = (category) | (mime type) | (drawable)
#

# Binary
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ public class UncompressCommand extends AsyncResultProgram implements UncompressE
        int cc = modes.length;
        for (int i = 0; i < cc; i++) {
            Mode mode = modes[i];
            if (mode.mMode.mExtension.compareTo(extension) == 0) {
            if (mode.mMode.mExtension.compareToIgnoreCase(extension) == 0) {
                return mode;
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@ public final class CompressActionPolicy extends ActionsPolicy {
        // the system and is need a security alert that the user can confirm prior to
        // make the extraction
        String ext = FileHelper.getExtension(fso);
        if (ConsoleBuilder.isPrivileged() && ext.compareTo("zip") == 0) { //$NON-NLS-1$
        if (ConsoleBuilder.isPrivileged() && ext.compareToIgnoreCase("zip") == 0) { //$NON-NLS-1$
            AlertDialog dialog = DialogHelper.createYesNoDialog(
                ctx,
                R.string.confirm_overwrite,
+1 −1
Original line number Diff line number Diff line
@@ -827,7 +827,7 @@ public final class FileHelper {
        if (ext != null) {
            int cc = VALID.length;
            for (int i = 0; i < cc; i++) {
                if (VALID[i].compareTo(ext) == 0) {
                if (VALID[i].compareToIgnoreCase(ext) == 0) {
                    return true;
                }
            }
+5 −5
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ public final class MimeTypeHelper {
        //Get the extension and delivery
        String ext = FileHelper.getExtension(fso);
        if (ext != null) {
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext.toLowerCase());
            if (mimeTypeInfo != null) {
                // Create a new drawable
                if (!TextUtils.isEmpty(mimeTypeInfo.mDrawable)) {
@@ -263,7 +263,7 @@ public final class MimeTypeHelper {
        String ext = FileHelper.getExtension(fso);
        if (ext != null) {
            //Load from the database of mime types
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext.toLowerCase());
            if (mimeTypeInfo != null) {
                return mimeTypeInfo.mMimeType;
            }
@@ -312,7 +312,7 @@ public final class MimeTypeHelper {
        String ext = FileHelper.getExtension(fso);
        if (ext != null) {
            //Load from the database of mime types
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext.toLowerCase());
            if (mimeTypeInfo != null) {
                return mimeTypeInfo.mMimeType;
            }
@@ -347,7 +347,7 @@ public final class MimeTypeHelper {
        String ext = FileHelper.getExtension(file.getName());
        if (ext != null) {
            //Load from the database of mime types
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext.toLowerCase());
            if (mimeTypeInfo != null) {
                return mimeTypeInfo.mCategory;
            }
@@ -387,7 +387,7 @@ public final class MimeTypeHelper {
        String ext = FileHelper.getExtension(fso);
        if (ext != null) {
            //Load from the database of mime types
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext);
            MimeTypeInfo mimeTypeInfo = sMimeTypes.get(ext.toLowerCase());
            if (mimeTypeInfo != null) {
                return mimeTypeInfo.mCategory;
            }