summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
authorWei Wang <weiwa@google.com>2014-09-25 19:05:03 -0700
committerWei Wang <weiwa@google.com>2014-10-09 18:01:39 +0000
commit35cd4c853f748e295352bda708b26ee39544d06d (patch)
treeec2c2221ef87f8a4b14fcc287bf7621547298aa8 /core/java/android/bluetooth/BluetoothAdapter.java
parentf91222327e71edccb5b5d34fde61abc54f580fab (diff)
Add support of advertising through standard instance.(1/4)
Use config overlay to check whether peripheral mode is supported. Bug: 17552672 Change-Id: I1081bc84da9fe033426f82ece2ec74c2d663e3aa
Diffstat (limited to 'core/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index f0b609aec1ea..210bbdf05486 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -464,7 +464,8 @@ public final class BluetoothAdapter {
if (getState() != STATE_ON) {
return null;
}
- if (!isMultipleAdvertisementSupported()) {
+ if (!isMultipleAdvertisementSupported() && !isPeripheralModeSupported()) {
+ Log.e(TAG, "bluetooth le advertising not supported");
return null;
}
synchronized(mLock) {
@@ -917,6 +918,21 @@ public final class BluetoothAdapter {
}
/**
+ * Returns whether peripheral mode is supported.
+ *
+ * @hide
+ */
+ public boolean isPeripheralModeSupported() {
+ if (getState() != STATE_ON) return false;
+ try {
+ return mService.isPeripheralModeSupported();
+ } catch (RemoteException e) {
+ Log.e(TAG, "failed to get peripheral mode capability: ", e);
+ }
+ return false;
+ }
+
+ /**
* Return true if offloaded filters are supported
*
* @return true if chipset supports on-chip filtering