diff options
| author | Pavlin Radoslavov <pavlin@google.com> | 2018-01-17 02:09:53 -0800 |
|---|---|---|
| committer | Pavlin Radoslavov <pavlin@google.com> | 2018-01-17 02:09:53 -0800 |
| commit | cc816bb0a93e42e6ffa4ec1447a2bf69a23b50d1 (patch) | |
| tree | 40b123295935e7d0ed7b07bcdecbf7d6a2217e99 /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | a3fb7fd95e3814371411c60fc4fc966c62417725 (diff) | |
Added internal API getMaxConnectedAudioDevices()
The API can be used to obtain the maximum number of connected
devices for A2DP or HFP.
Test: Manual
Bug: 64767509
Change-Id: I80b8a1c85e33ae0b23fdc4812f8991a4202d9abc
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index c7be0f36ec..cdc881a25a 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -1671,6 +1671,27 @@ public final class BluetoothAdapter { } /** + * Get the maximum number of connected audio devices. + * + * @return the maximum number of connected audio devices + * @hide + */ + @RequiresPermission(Manifest.permission.BLUETOOTH) + public int getMaxConnectedAudioDevices() { + try { + mServiceLock.readLock().lock(); + if (mService != null) { + return mService.getMaxConnectedAudioDevices(); + } + } catch (RemoteException e) { + Log.e(TAG, "failed to get getMaxConnectedAudioDevices, error: ", e); + } finally { + mServiceLock.readLock().unlock(); + } + return 1; + } + + /** * Return true if hardware has entries available for matching beacons * * @return true if there are hw entries available for matching beacons |
