* 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
* No device is connected when Bluetooth adapter is OFF
* BluetoothSummaryUpdater should reset its connection state tracker in
order to display the correct summary message on ConnectedDevice
preference
* Otherwise, "Connected to null" will be shown because no device is
connected while BluetoothSummaryUpdater is still in CONNECTED state
* Removed unused imports from BluetoothSummaryUpdater
* Write additional unit test to verify the above behaviour
* Add additional logging when deviceName is null in CONNECTED state
Bug: 62492716
Test: Pair and connect to Bluetooth device, turning Bluetooth ON/OFF,
unit tests
Change-Id: I30726636f5678d61d6052f5b8d211aa20f26f409
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.
Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
When there are more than one connected device, show
a general summary.
Bug: 37365660
Test: RunSettingsRoboTests
Change-Id: I0eed734e82750969bef97a61dd59167e679c0203
- update Bluetooth summary text "Connected to" and "Not connected"
- update USB summary text "Charging" and "Supplying"
- update Printing summary to "... on" or "off
Change-Id: I39a809b560a5c6cc6a0e217315dfabb2c4d1a129
Fix: 36234108
Test: builds
- Add a preference controller for Network & internet->Wi-Fi to control
the preference toggling and summary update.
- Refactor WifiSettings and WifiEnabler to share code between the new
wifi preference controller and the wifi setting.
- Refactor BluetoothSummaryHelper to have a common base class with the
WifiSummaryHelper.
- Rename the summary helper to summary updater.
Bug: 34280769
Test: make RunSettingsRoboTests
Change-Id: I00ebfc161bcef89331bb41ba405ed8cb8232d248