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

Commit 01d2f039 authored by Erik Jensen's avatar Erik Jensen
Browse files

Allow EPUB documents to be received via Bluetooth

Test: Tested sending various allowed and not allowed types from my laptop.

Change-Id: I1dab759fdf9a3c00bb4511d6338cd9fffe0c21b6
parent 92425eab
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class Constants {
            "text/plain",
            "text/html",
            "text/xml",
            "application/epub+zip",
            "application/zip",
            "application/vnd.ms-excel",
            "application/msword",
@@ -250,8 +251,8 @@ public class Constants {
    }

    private static boolean mimeTypeMatches(String mimeType, String matchAgainst) {
        Pattern p =
                Pattern.compile(matchAgainst.replaceAll("\\*", "\\.\\*"), Pattern.CASE_INSENSITIVE);
        String matchRegex = matchAgainst.replaceAll("\\+", "\\\\+").replaceAll("\\*", ".*");
        Pattern p = Pattern.compile(matchRegex, Pattern.CASE_INSENSITIVE);
        return p.matcher(mimeType).matches();
    }