Loading android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java +3 −21 Original line number Diff line number Diff line Loading @@ -220,9 +220,6 @@ class ActiveDeviceManager { case BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED: mHandler.post(() -> handleLeAudioActiveDeviceChanged(device)); break; case BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE: mHandler.post(() -> handleHapActiveDeviceChanged(device)); break; default: Log.e(TAG, "Received unexpected intent, action=" + action); break; Loading Loading @@ -509,26 +506,12 @@ class ActiveDeviceManager { setHfpActiveDevice(null); setHearingAidActiveDevice(null); } mLeAudioActiveDevice = device; } } private void handleHapActiveDeviceChanged(BluetoothDevice device) { synchronized (mLock) { if (DBG) { Log.d(TAG, "handleHapActiveDeviceChanged: " + device); } if (device != null && !mLeHearingAidConnectedDevices.contains(device)) { mLeHearingAidConnectedDevices.add(device); } // Just assign locally the new value if (device != null && !Objects.equals(mLeHearingAidActiveDevice, device)) { setA2dpActiveDevice(null, true); setHfpActiveDevice(null); setHearingAidActiveDevice(null); if (mLeHearingAidConnectedDevices.contains(device)) { mLeHearingAidActiveDevice = device; } mLeAudioActiveDevice = device; mLeHearingAidActiveDevice = device; } } Loading Loading @@ -600,7 +583,6 @@ class ActiveDeviceManager { filter.addAction(BluetoothLeAudio.ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED); filter.addAction(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE); mAdapterService.registerReceiver(mReceiver, filter, Context.RECEIVER_EXPORTED); mAudioManager.registerAudioDeviceCallback(mAudioManagerAudioDeviceCallback, mHandler); Loading Loading
android/app/src/com/android/bluetooth/btservice/ActiveDeviceManager.java +3 −21 Original line number Diff line number Diff line Loading @@ -220,9 +220,6 @@ class ActiveDeviceManager { case BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED: mHandler.post(() -> handleLeAudioActiveDeviceChanged(device)); break; case BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE: mHandler.post(() -> handleHapActiveDeviceChanged(device)); break; default: Log.e(TAG, "Received unexpected intent, action=" + action); break; Loading Loading @@ -509,26 +506,12 @@ class ActiveDeviceManager { setHfpActiveDevice(null); setHearingAidActiveDevice(null); } mLeAudioActiveDevice = device; } } private void handleHapActiveDeviceChanged(BluetoothDevice device) { synchronized (mLock) { if (DBG) { Log.d(TAG, "handleHapActiveDeviceChanged: " + device); } if (device != null && !mLeHearingAidConnectedDevices.contains(device)) { mLeHearingAidConnectedDevices.add(device); } // Just assign locally the new value if (device != null && !Objects.equals(mLeHearingAidActiveDevice, device)) { setA2dpActiveDevice(null, true); setHfpActiveDevice(null); setHearingAidActiveDevice(null); if (mLeHearingAidConnectedDevices.contains(device)) { mLeHearingAidActiveDevice = device; } mLeAudioActiveDevice = device; mLeHearingAidActiveDevice = device; } } Loading Loading @@ -600,7 +583,6 @@ class ActiveDeviceManager { filter.addAction(BluetoothLeAudio.ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED); filter.addAction(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED); filter.addAction(BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE); mAdapterService.registerReceiver(mReceiver, filter, Context.RECEIVER_EXPORTED); mAudioManager.registerAudioDeviceCallback(mAudioManagerAudioDeviceCallback, mHandler); Loading