diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-12-08 05:55:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-12-08 05:55:22 +0000 |
commit | 7582c3fed86aacc0335c9219019da630778ee1e3 (patch) | |
tree | 30f694fdfab306342367ba0b64786a76debf7003 | |
parent | 65953636f94c92c032b2bc8f1249b189fbd14cd6 (diff) | |
parent | 7fc064fc659aa98fe10fa741f28df33e6ea24df1 (diff) | |
download | TvSettings-7582c3fed86aacc0335c9219019da630778ee1e3.tar.gz |
Merge "Fix sub title for connected Bluetooth device" into main
-rw-r--r-- | Settings/src/com/android/tv/settings/accessories/BluetoothDevicesService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Settings/src/com/android/tv/settings/accessories/BluetoothDevicesService.java b/Settings/src/com/android/tv/settings/accessories/BluetoothDevicesService.java index abc3bb027..c8ca4fca6 100644 --- a/Settings/src/com/android/tv/settings/accessories/BluetoothDevicesService.java +++ b/Settings/src/com/android/tv/settings/accessories/BluetoothDevicesService.java @@ -138,8 +138,14 @@ public class BluetoothDevicesService extends Service { } break; case BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED: - int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1); - mHandler.post(() -> onA2dpConnectionStateChanged(device.getName(), state)); + final int state = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, -1); + mHandler.post(() -> { + onA2dpConnectionStateChanged(device.getName(), state); + if (state == BluetoothProfile.STATE_CONNECTED + || state == BluetoothProfile.STATE_DISCONNECTED) { + onDeviceUpdated(device); + } + }); break; case BluetoothDevice.ACTION_ACL_CONNECTED: Log.i(TAG, "acl connected " + device); |