Loading core/java/android/bluetooth/BluetoothClass.java +10 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,10 @@ public final class BluetoothClass implements Parcelable { public static final int PROFILE_OPP = 2; /** @hide */ public static final int PROFILE_HID = 3; /** @hide */ public static final int PROFILE_PANU = 4; /** @hide */ public static final int PROFILE_NAP = 5; /** * Check class bits for possible bluetooth profile support. Loading Loading @@ -328,6 +332,12 @@ public final class BluetoothClass implements Parcelable { } } else if (profile == PROFILE_HID) { return (getDeviceClass() & Device.Major.PERIPHERAL) == Device.Major.PERIPHERAL; } else if (profile == PROFILE_PANU || profile == PROFILE_NAP){ // No good way to distinguish between the two, based on class bits. if (hasService(Service.NETWORKING)) { return true; } return (getDeviceClass() & Device.Major.NETWORKING) == Device.Major.NETWORKING; } else { return false; } Loading Loading
core/java/android/bluetooth/BluetoothClass.java +10 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,10 @@ public final class BluetoothClass implements Parcelable { public static final int PROFILE_OPP = 2; /** @hide */ public static final int PROFILE_HID = 3; /** @hide */ public static final int PROFILE_PANU = 4; /** @hide */ public static final int PROFILE_NAP = 5; /** * Check class bits for possible bluetooth profile support. Loading Loading @@ -328,6 +332,12 @@ public final class BluetoothClass implements Parcelable { } } else if (profile == PROFILE_HID) { return (getDeviceClass() & Device.Major.PERIPHERAL) == Device.Major.PERIPHERAL; } else if (profile == PROFILE_PANU || profile == PROFILE_NAP){ // No good way to distinguish between the two, based on class bits. if (hasService(Service.NETWORKING)) { return true; } return (getDeviceClass() & Device.Major.NETWORKING) == Device.Major.NETWORKING; } else { return false; } Loading