HFP: Add APIs for set and get active device (1/3)
1. Call BluetoothHeadset.setActiveDevice(BluetoothDevice device) to set a connected HFP/HSP device as active. 2. Listen for BluetoothHeadset.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. BluetoothHeadset.setActiveDevice() could be called by some other parts of the system, so interested parties should always listen for BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared for active device updates. Bug: 68951996 Test: manual Change-Id: I22ca639a04fed7bf17df59c405ddeda90dafb8ff (cherry picked from commit 05f4bc40)
Loading
Please register or sign in to comment