最近有个需求是蓝牙界面只显示耳机,不显示其他设备,所以看了一下蓝牙相关代码。
在BluetoothClass中定义了蓝牙设备的类型
frameworks/base/core/java/android/bluetooth/BluetoothClass.java
public static class Device {
private static final int BITMASK = 0x1FFC;
/**
* Defines all major device class constants.
* <p>See {@link BluetoothClass.Device} for minor classes.
*/
public static class Major {
private static final int BITMASK = 0x1F00;
public static final int MISC = 0x0000;
public static final int COMPUTER = 0x0100;
public static final int PHONE = 0x0200;
public static final int NETWORKING = 0x0300;
public static final int AUDIO_VIDEO = 0x0400;
public static final int PERIPHERAL = 0x0500;
public static final int IMAGING = 0x0600;
public static final int WEARABLE = 0x0700;
public static final int TOY = 0x0800;
public static final int HEALTH = 0x0900;
public static final int UNCATEGORIZED = 0x1F00;
}
// Devices in the COMPUTER major class
public static

最低0.47元/天 解锁文章
4612

被折叠的 条评论
为什么被折叠?



