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
This commit is contained in:
Pavlin Radoslavov
2018-01-17 02:09:53 -08:00
parent 3cff120fcb
commit a513792e9e

View File

@@ -1670,6 +1670,27 @@ public final class BluetoothAdapter {
return 0;
}
/**
* 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
*