Fix bluetooth settings force close
This CL include following change:
- Add null check of cacedBluetoothDevice, cachedBluetooth could be null
if the input BluetoothDevice can't found in
CachedBluetoothDeviceManager.
- Move addPreference() and removePreference() to update() method,
because update() will be called to update UI when recevice Bluetooth
device change event.
- Add test case to test CachedBluetoothDevice null check.
Bug: 149068434
Test: make -j42 RunSettingsRoboTests
Change-Id: I90016bf1175925821b0d9b634c62cf796289a734
2 files changed