OSDN Git Service

Update the A2DP Codec Config API
authorPavlin Radoslavov <pavlin@google.com>
Thu, 26 Jan 2017 00:54:07 +0000 (16:54 -0800)
committerPavlin Radoslavov <pavlin@google.com>
Tue, 31 Jan 2017 18:58:27 +0000 (18:58 +0000)
commitb37f181c9853bd0d55d360db95d3bf1bba0b5a6f
treee0278cd8f64e28b062bcd7b8ebb152ad0f5f565b
parent161ac8b0064b4084dae7576b62897906ae4357b4
Update the A2DP Codec Config API

Previously, the JNI upcall would contain only the current codec config.
In the new API, the upcall contains:
 1. The current codec config
 2. The list of codecs containing the local codecs capabilities
 3. The list of codecs containing the selectable codecs capabilities.
    This list is the intersection of the local codecs capabilities
    and the capabilities of the paired device.

Also, refactored the Java internals to accomodate the extra information:
 * Added new class BluetoothCodecStatus that contains the extra info:
   current codec config, local codecs capabilities and selectable
   codecs capabilities
 * Renamed method getCodecConfig() to getCodecStatus() and return the
   corresponding BluetoothCodecStatus object.
 * Updates to class BluetoothCodecConfig:
   new methods isValid(), getCodecName(), and updated toString()
   so it is more user friendly
 * Removed BluetoothCodecConfig.EXTRA_CODEC_CONFIG and
   EXTRA_PREVIOUS_CODEC_CONFIG.
   The former is superseded by BluetoothCodecStatus.EXTRA_CODEC_STATUS;
   the latter is not really used.

Test: A2DP streaming with headsets and switching the codecs
Change-Id: Ia1af2c22e521e863e28a360610aca49f7e62d31b
compiled-classes-phone
core/java/android/bluetooth/BluetoothA2dp.java
core/java/android/bluetooth/BluetoothCodecConfig.java
core/java/android/bluetooth/BluetoothCodecStatus.aidl [new file with mode: 0644]
core/java/android/bluetooth/BluetoothCodecStatus.java [new file with mode: 0644]
core/java/android/bluetooth/IBluetoothA2dp.aidl