问候stackoverflow.
最近,我正在跟踪Android框架中的蓝牙操作机制.我注意到这个补丁在通过OPP接收文件时会产生一些文件类型限制.
在包中com.android.bluetooth.opp,Constants.java中有一个固定的白名单
/**
* The MIME type(s) of we could accept from other device.
* This is in essence a "white list" of acceptable types.
* Today, restricted to images, audio, video and certain text types.
*/
public static final String[] ACCEPTABLE_SHARE_INBOUND_TYPES = new String[] {
/* ... some types such as images and music ... */
};
Run Code Online (Sandbox Code Playgroud)
这限制了BluetoothOppObexServerSession.java中可接受的文件类型
// Reject policy: anything outside the "white list" plus unspecified
// MIME Types.
if (!pre_reject
&& …Run Code Online (Sandbox Code Playgroud)