OSDN Git Service

Add Settings support for Bluetooth Multi-A2DP and Multi-HFP
authorPavlin Radoslavov <pavlin@google.com>
Sun, 21 Jan 2018 10:59:15 +0000 (02:59 -0800)
committerPavlin Radoslavov <pavlin@google.com>
Mon, 22 Jan 2018 19:44:03 +0000 (19:44 +0000)
commit1af33a192614bb490701ab2e8e21866690b3b4fa
treea0fcf14f79da8c214c0cb9dec89960c3489877af
parentc2293328b2a7b714cca8dcbac1c87ad626791286
Add Settings support for Bluetooth Multi-A2DP and Multi-HFP

When there are multiple connected A2DP/HFP devices, if a connected
device's name is clicked on, that device will be chosen as
Active - i.e., it will be the device chosen for audio out / phone call.

Also:
 * Listen to the BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED
   and BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intents
   and update the the status of the current active device.
 * When connecting a new device, and Multi-A2DP is enabled, don't
   disconnect the currently connected device.
 * Update the implementation of isA2dpPlaying() so it correctly checks
   all connected devices, not only the first one.

Test: Manual: multiple connected A2DP devices, and selecting each as
      the Active Device.
Bug: 64767509

Change-Id: I69f3c85ebf5a7f07f6deed484c6dd65705460ae4
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothCallback.java
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
packages/SettingsLib/src/com/android/settingslib/bluetooth/HeadsetProfile.java
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java
packages/SystemUI/src/com/android/systemui/keyboard/KeyboardUI.java
packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java