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

Commit 8fbedbbf authored by Christine Franks's avatar Christine Franks
Browse files

Allow ogg files to be selected as ringtones

Bug: 37891455
Test: manual - open custom phone ringtone picker in settings, navigate
to an .ogg file, and it should be selectable; select it and it should
add itself to the list of available ringtones, and play its sample
correctly.

Change-Id: I33b1ff07d0b43646c807ba0994efa4f6d8d95cae
parent 1c38d294
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -943,7 +943,8 @@ public class RingtoneManager {

        // Sanity-check: are we actually being asked to install an audio file?
        final String mimeType = mContext.getContentResolver().getType(fileUri);
        if(mimeType == null || !mimeType.startsWith("audio/")) {
        if(mimeType == null ||
                !(mimeType.startsWith("audio/") || mimeType.equals("application/ogg"))) {
            throw new IllegalArgumentException("Ringtone file must have MIME type \"audio/*\"."
                    + " Given file has MIME type \"" + mimeType + "\"");
        }