Show correct A2DP connection status in Bluetooth settings.
When BluetoothSettings is entered via QuickSettings while an A2DP device is connected, we aren't showing the device connection status in the UI, because the device list is created before we've connected to the A2DP and Headset profile services, and we weren't refreshing the device list UI after getting the callback for onServiceConnected() and retrieving the list of connected devices. Add a line to HeadsetServiceListener.onServiceConnected() to call device.refresh() after we call device.onProfileStateChanged() to refresh the device list UI. Also copy the logic into A2dpProfile's onServiceConnected() callback so it will refresh the UI for any connected A2DP devices. The reason this bug doesn't show up when entering BT settings from the main Settings screen is because the onServiceConnected() callbacks happen before the device list is initialized, so the UI items are created with the correct connection status. For the same reason, the bug doesn't occur if the Settings app is already running and we re-enter it via Bluetooth QuickSettings. Bug: 8724247 Change-Id: I1a993636ecab18dd6e980e3b4d2485bbed256d74
Loading
Please register or sign in to comment