Loading android/app/src/com/android/bluetooth/hfp/HeadsetNativeInterface.java +5 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.util.Log; import com.android.bluetooth.Utils; import com.android.bluetooth.btservice.AdapterService; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -490,6 +491,10 @@ public class HeadsetNativeInterface { */ @VisibleForTesting public boolean setActiveDevice(BluetoothDevice device) { // Set bt_stack's active device to default if java layer set active device to null if (device == null) { return setActiveDeviceNative(Utils.getBytesFromAddress("00:00:00:00:00:00")); } return setActiveDeviceNative(getByteAddress(device)); } Loading android/app/src/com/android/bluetooth/hfp/HeadsetService.java +1 −0 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,7 @@ public class HeadsetService extends ProfileService { } } mActiveDevice = null; mNativeInterface.setActiveDevice(null); broadcastActiveDevice(null); } } Loading system/bta/ag/bta_ag_api.cc +6 −2 Original line number Diff line number Diff line Loading @@ -243,6 +243,10 @@ void BTA_AgSetScoAllowed(bool value) { } void BTA_AgSetActiveDevice(const RawAddress& active_device_addr) { if (active_device_addr.IsEmpty()) { do_in_main_thread(FROM_HERE, base::BindOnce(&bta_clear_active_device)); } else { do_in_main_thread(FROM_HERE, base::BindOnce(&bta_ag_api_set_active_device, active_device_addr)); } } system/bta/ag/bta_ag_sco.cc +4 −1 Original line number Diff line number Diff line Loading @@ -1456,7 +1456,10 @@ void bta_ag_set_sco_allowed(bool value) { const RawAddress& bta_ag_get_active_device() { return active_device_addr; } void bta_clear_active_device() { active_device_addr = RawAddress::kEmpty; } void bta_clear_active_device() { LOG_DEBUG("Set bta active device to null"); active_device_addr = RawAddress::kEmpty; } void bta_ag_api_set_active_device(const RawAddress& new_active_device) { if (new_active_device.IsEmpty()) { Loading Loading
android/app/src/com/android/bluetooth/hfp/HeadsetNativeInterface.java +5 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.util.Log; import com.android.bluetooth.Utils; import com.android.bluetooth.btservice.AdapterService; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -490,6 +491,10 @@ public class HeadsetNativeInterface { */ @VisibleForTesting public boolean setActiveDevice(BluetoothDevice device) { // Set bt_stack's active device to default if java layer set active device to null if (device == null) { return setActiveDeviceNative(Utils.getBytesFromAddress("00:00:00:00:00:00")); } return setActiveDeviceNative(getByteAddress(device)); } Loading
android/app/src/com/android/bluetooth/hfp/HeadsetService.java +1 −0 Original line number Diff line number Diff line Loading @@ -1378,6 +1378,7 @@ public class HeadsetService extends ProfileService { } } mActiveDevice = null; mNativeInterface.setActiveDevice(null); broadcastActiveDevice(null); } } Loading
system/bta/ag/bta_ag_api.cc +6 −2 Original line number Diff line number Diff line Loading @@ -243,6 +243,10 @@ void BTA_AgSetScoAllowed(bool value) { } void BTA_AgSetActiveDevice(const RawAddress& active_device_addr) { if (active_device_addr.IsEmpty()) { do_in_main_thread(FROM_HERE, base::BindOnce(&bta_clear_active_device)); } else { do_in_main_thread(FROM_HERE, base::BindOnce(&bta_ag_api_set_active_device, active_device_addr)); } }
system/bta/ag/bta_ag_sco.cc +4 −1 Original line number Diff line number Diff line Loading @@ -1456,7 +1456,10 @@ void bta_ag_set_sco_allowed(bool value) { const RawAddress& bta_ag_get_active_device() { return active_device_addr; } void bta_clear_active_device() { active_device_addr = RawAddress::kEmpty; } void bta_clear_active_device() { LOG_DEBUG("Set bta active device to null"); active_device_addr = RawAddress::kEmpty; } void bta_ag_api_set_active_device(const RawAddress& new_active_device) { if (new_active_device.IsEmpty()) { Loading