Bluetooth: remove unnecessary state tracking in BluetoothSummaryUpdater
* LocalBluetoothAdapter is already a cache of BluetoothAdapter and its methods should be used directly to obtain states instead of caching them in BluetoothSummaryUpdater - Use LocalBluetoothAdapter.isEnabled() to check whether Bluetooth is enabled - Use LocalBluetoothAdapter.getBondedDevices() to get list of bonded devices * BluetoothDevice is a stable Bluetooth API and its methods should not incur large latency. We should use API methods as much as possible to avoid intermediate wrappers - Use BluetoothDevice.isConnected() to check if a device is connected * Add more logging messages in error conditions * Show status as "Not Connected" when there is a state mismatch (i.e. adapter says it is connected, but no bonded device is connected) * Updated unit tests to reflect the latest behavior Bug: 65591907 Test: make, unit test, pair with Bluetooth devices, check Settings UI Change-Id: I0fa54959c8bed8ac67a935f150785ba8197d0411
Loading
Please register or sign in to comment