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

Commit 32c308a5 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "If media wants ASCII lowercasing, it needs to ask for it."

parents 20c911ba dcb1a58c
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@ import android.mtp.MtpConstants;
import java.util.HashMap;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Iterator;
import java.util.List;
import java.util.List;
import java.util.Locale;


/**
/**
 * MediaScanner helper class.
 * MediaScanner helper class.
@@ -276,10 +277,10 @@ public class MediaFile {
    }
    }


    public static MediaFileType getFileType(String path) {
    public static MediaFileType getFileType(String path) {
        int lastDot = path.lastIndexOf(".");
        int lastDot = path.lastIndexOf('.');
        if (lastDot < 0)
        if (lastDot < 0)
            return null;
            return null;
        return sFileTypeMap.get(path.substring(lastDot + 1).toUpperCase());
        return sFileTypeMap.get(path.substring(lastDot + 1).toUpperCase(Locale.ROOT));
    }
    }


    public static boolean isMimeTypeMedia(String mimeType) {
    public static boolean isMimeTypeMedia(String mimeType) {
@@ -325,7 +326,7 @@ public class MediaFile {
        }
        }
        int lastDot = fileName.lastIndexOf('.');
        int lastDot = fileName.lastIndexOf('.');
        if (lastDot > 0) {
        if (lastDot > 0) {
            String extension = fileName.substring(lastDot + 1).toUpperCase();
            String extension = fileName.substring(lastDot + 1).toUpperCase(Locale.ROOT);
            Integer value = sFileTypeToFormatMap.get(extension);
            Integer value = sFileTypeToFormatMap.get(extension);
            if (value != null) {
            if (value != null) {
                return value.intValue();
                return value.intValue();
+1 −1
Original line number Original line Diff line number Diff line
@@ -540,7 +540,7 @@ public class MediaScanner
                    if (noMedia) {
                    if (noMedia) {
                        result = endFile(entry, false, false, false, false, false);
                        result = endFile(entry, false, false, false, false, false);
                    } else {
                    } else {
                        String lowpath = path.toLowerCase();
                        String lowpath = path.toLowerCase(Locale.ROOT);
                        boolean ringtones = (lowpath.indexOf(RINGTONES_DIR) > 0);
                        boolean ringtones = (lowpath.indexOf(RINGTONES_DIR) > 0);
                        boolean notifications = (lowpath.indexOf(NOTIFICATIONS_DIR) > 0);
                        boolean notifications = (lowpath.indexOf(NOTIFICATIONS_DIR) > 0);
                        boolean alarms = (lowpath.indexOf(ALARMS_DIR) > 0);
                        boolean alarms = (lowpath.indexOf(ALARMS_DIR) > 0);
+3 −1
Original line number Original line Diff line number Diff line
@@ -23,6 +23,8 @@ import android.filterfw.core.Frame;
import android.filterfw.core.FrameFormat;
import android.filterfw.core.FrameFormat;
import android.filterfw.format.ObjectFormat;
import android.filterfw.format.ObjectFormat;


import java.util.Locale;

/**
/**
 * @hide
 * @hide
 */
 */
@@ -47,7 +49,7 @@ public class ToUpperCase extends Filter {
        String inputString = (String)input.getObjectValue();
        String inputString = (String)input.getObjectValue();


        Frame output = env.getFrameManager().newFrame(mOutputFormat);
        Frame output = env.getFrameManager().newFrame(mOutputFormat);
        output.setObjectValue(inputString.toUpperCase());
        output.setObjectValue(inputString.toUpperCase(Locale.getDefault()));


        pushOutput("uppercase", output);
        pushOutput("uppercase", output);
    }
    }
+2 −1
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@ import android.widget.Toast;


import java.io.File;
import java.io.File;
import java.util.Date;
import java.util.Date;
import java.util.Locale;


/**
/**
 * A view to display the properties of an object.
 * A view to display the properties of an object.
@@ -120,7 +121,7 @@ public class ObjectViewer extends Activity implements View.OnClickListener {
            mFileName = info.getName();
            mFileName = info.getName();
            view.setText(mFileName);
            view.setText(mFileName);
            view = (TextView)findViewById(R.id.format);
            view = (TextView)findViewById(R.id.format);
            view.setText(Integer.toHexString(info.getFormat()).toUpperCase());
            view.setText(Integer.toHexString(info.getFormat()).toUpperCase(Locale.ROOT));
            view = (TextView)findViewById(R.id.size);
            view = (TextView)findViewById(R.id.size);
            view.setText(Long.toString(info.getCompressedSize()));
            view.setText(Long.toString(info.getCompressedSize()));
            view = (TextView)findViewById(R.id.thumb_width);
            view = (TextView)findViewById(R.id.thumb_width);