diff options
| author | Jaikumar Ganesh <jaikumar@google.com> | 2010-08-23 11:49:36 -0700 |
|---|---|---|
| committer | Jaikumar Ganesh <jaikumar@google.com> | 2010-08-23 11:50:32 -0700 |
| commit | 332058050a42e0f8b8735caa5693aa59d520f220 (patch) | |
| tree | 8553e46247e0730a01e1fada76e784e8c252cc4e /core/java/android/bluetooth/BluetoothClass.java | |
| parent | 5989f4edc5ba74d59412a1966a8e977cfebe79df (diff) | |
Add Tethering class bit check.
Change-Id: Iaa87c91c4b3db3b77c2e6c4f559fa2e438c9c247
Diffstat (limited to 'core/java/android/bluetooth/BluetoothClass.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothClass.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java index 0c9bab24965d..c8381c96a39a 100644 --- a/core/java/android/bluetooth/BluetoothClass.java +++ b/core/java/android/bluetooth/BluetoothClass.java @@ -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. @@ -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; } |
