Fixed a Bluetooth Scanning issue.

+ When refreshing Bluetooth devices, sometimes it took awhile for some
devices to come back up.  This is a fix.

Bug: 17049458
Change-Id: Id6233b38585e003e0432707663af4d06b0ce98c2
This commit is contained in:
PauloftheWest
2014-08-18 14:44:48 -07:00
parent f14fa7ed4e
commit 637f1b4e45

View File

@@ -230,10 +230,19 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
} }
private void startScanning() { private void startScanning() {
if (isUiRestricted()) return; if (isUiRestricted()) {
return;
}
if (!mAvailableDevicesCategoryIsPresent) { if (!mAvailableDevicesCategoryIsPresent) {
getPreferenceScreen().addPreference(mAvailableDevicesCategory); getPreferenceScreen().addPreference(mAvailableDevicesCategory);
} }
if (mAvailableDevicesCategory != null) {
setDeviceListGroup(mAvailableDevicesCategory);
removeAllDevices();
}
mLocalManager.getCachedDeviceManager().clearCachedDevices(); mLocalManager.getCachedDeviceManager().clearCachedDevices();
mAvailableDevicesCategory.removeAll(); mAvailableDevicesCategory.removeAll();
mLocalAdapter.startScanning(true); mLocalAdapter.startScanning(true);