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

Commit e15784bc authored by Bill Yi's avatar Bill Yi
Browse files

Merge RQ3A.210705.001 to aosp-master - DO NOT MERGE

Merged-In: If44b7cf697ce3d73c2e65639ab404a364e7a5672
Merged-In: I062a3988ad8f1d93c190b7e43b5346fcbe96fab5
Merged-In: I062a3988ad8f1d93c190b7e43b5346fcbe96fab5
Change-Id: I07344e92ef015fe7b3a48f73c18400f7c3d4c2ba
parents ea80be8b ad25333d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -110,6 +110,12 @@ public class BluetoothOppSendFileInfo {
        // This will allow more 3rd party applications to share files via
        // bluetooth
        if ("content".equals(scheme)) {
            if (fromExternal && BluetoothOppUtility.isForbiddenContent(uri)) {
                EventLog.writeEvent(0x534e4554, "179910660", -1, uri.toString());
                Log.e(TAG, "Content from forbidden URI is not allowed.");
                return SEND_FILE_INFO_ERROR;
            }

            contentType = contentResolver.getType(uri);
            Cursor metadataCursor;
            try {
+7 −0
Original line number Diff line number Diff line
@@ -448,6 +448,13 @@ public class BluetoothOppUtility {
        return isSameOrSubDirectory(Environment.getExternalStorageDirectory(), file);
    }

    static boolean isForbiddenContent(Uri uri) {
        if ("com.android.bluetooth.map.MmsFileProvider".equals(uri.getHost())) {
            return true;
        }
        return false;
    }

    /**
     * Checks, whether the child directory is the same as, or a sub-directory of the base
     * directory. Neither base nor child should be null.