Fix BTHS is still in pairing list after BTHS is connected
This CL uses onProfileConnectionStateChanged() to handle the case that bonded device is connected in pairing list. 1. Finish BluetoothPairingDetail page if the bonded device is connected and selected. 2. Remove the devices in BluetoothPairingDetail page if the device is connected. Bug: 142519901 Test: make -j42 RunSettingsRoboTests Change-Id: I51a9f2ebc0b491edb8ea026ff62ec20ae91eee1d
This commit is contained in:
@@ -35,9 +35,10 @@ import com.android.settingslib.bluetooth.BluetoothDeviceFilter;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Parent class for settings fragments that contain a list of Bluetooth
|
||||
@@ -72,6 +73,7 @@ public abstract class DeviceListPreferenceFragment extends
|
||||
|
||||
final HashMap<CachedBluetoothDevice, BluetoothDevicePreference> mDevicePreferenceMap =
|
||||
new HashMap<>();
|
||||
final List<BluetoothDevice> mSelectedList = new ArrayList<>();
|
||||
|
||||
boolean mShowDevicesWithoutNames;
|
||||
|
||||
@@ -154,6 +156,7 @@ public abstract class DeviceListPreferenceFragment extends
|
||||
BluetoothDevicePreference btPreference = (BluetoothDevicePreference) preference;
|
||||
CachedBluetoothDevice device = btPreference.getCachedDevice();
|
||||
mSelectedDevice = device.getDevice();
|
||||
mSelectedList.add(mSelectedDevice);
|
||||
onDevicePreferenceClick(btPreference);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user