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

Commit 6119be1a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [14551043, 14550658, 14550659, 14550660, 14550661,...

Merge cherrypicks of [14551043, 14550658, 14550659, 14550660, 14550661, 14552046, 14554284, 14554486, 14552047, 14554032, 14554033, 14554034, 14554035, 14554036, 14554037, 14554038, 14554039, 14550926, 14554040, 14554341, 14554662, 14554041] into security-aosp-rvc-release

Change-Id: I8721304df21695ec9625fc11cd733abd83a930b9
parents d052b8e9 f12ffa83
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.