Show bonded devices in "Pair new device"(2/2)

Some users forgot they had paired devices and couldn't see their BT device
when they search device in "Pair new device". (b/80382940, b/80133137).
Need to change the behavior to let paired devices can be shown on "Available devices".

Bug: 111738593
Test: Bluetooth Pairing Test
Change-Id: Ib499785abaa8e4efc1875be113ac87bdbe0c89ba
This commit is contained in:
Ash_Chen
2018-08-17 22:31:41 +08:00
parent af643d3690
commit 8f7092a15e
3 changed files with 41 additions and 10 deletions

View File

@@ -192,6 +192,8 @@ public abstract class DeviceListPreferenceFragment extends
preference = new BluetoothDevicePreference(getPrefContext(), cachedDevice,
mShowDevicesWithoutNames);
preference.setKey(key);
//Set hideSecondTarget is true if it's bonded device.
preference.hideSecondTarget(true);
mDeviceListGroup.addPreference(preference);
} else {
// Tell the preference it is being re-used in case there is new info in the