From 637f1b4e45c5cddd2f4fb6061ccac45e2f1c9664 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Mon, 18 Aug 2014 14:44:48 -0700 Subject: [PATCH] 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 --- .../android/settings/bluetooth/BluetoothSettings.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index 3c62ba9110e..8ea680f018b 100755 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -230,10 +230,19 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem } private void startScanning() { - if (isUiRestricted()) return; + if (isUiRestricted()) { + return; + } + if (!mAvailableDevicesCategoryIsPresent) { getPreferenceScreen().addPreference(mAvailableDevicesCategory); } + + if (mAvailableDevicesCategory != null) { + setDeviceListGroup(mAvailableDevicesCategory); + removeAllDevices(); + } + mLocalManager.getCachedDeviceManager().clearCachedDevices(); mAvailableDevicesCategory.removeAll(); mLocalAdapter.startScanning(true);