Added internal API to get/set the A2DP Active Device
1. Call BluetoothA2dp.setActiveDevice(BluetoothDevice device) to set
a connected A2DP device as active.
The value of "device" could be null to clear the active device
and stop streaming audio to a Bluetooth device.
2. Listen for BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intent
that will contain the latest active device (in EXTRA_DEVICE field).
If the active device could not be changed, the EXTRA_DEVICE
field could be null.
3. If setActiveDevice() is NOT in-progress, BluetoothA2dp.getActiveDevice()
can be used. If setActiveDevice() is in-progress, the result is undefined.
4. BluetoothA2dp.setActiveDevice() could be called by some other parts of
the system, so interested parties should always listen for
BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared
for active device updates.
Bug: 71555243
Test: Manual
Change-Id: I661b6882e8e6b437db50210aec1dd12a10199969
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 9072960..e33c822 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -173,6 +173,8 @@
<protected-broadcast
android:name="android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED" />
<protected-broadcast
+ android:name="android.bluetooth.a2dp.profile.action.ACTIVE_DEVICE_CHANGED" />
+ <protected-broadcast
android:name="android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED" />
<protected-broadcast
android:name="android.bluetooth.a2dp.profile.action.CODEC_CONFIG_CHANGED" />