Merge "Show bonded devices in "Pair new device"(2/2)"
This commit is contained in:
committed by
Android (Google) Code Review
commit
064af9a48e
@@ -152,7 +152,7 @@ public class BluetoothPairingDetail extends DeviceListPreferenceFragment impleme
|
||||
|
||||
addDeviceCategory(mAvailableDevicesCategory,
|
||||
R.string.bluetooth_preference_found_media_devices,
|
||||
BluetoothDeviceFilter.UNBONDED_DEVICE_FILTER, mInitialScanStarted);
|
||||
BluetoothDeviceFilter.ALL_FILTER, mInitialScanStarted);
|
||||
updateFooterPreference(mFooterPreference);
|
||||
mAlwaysDiscoverable.start();
|
||||
enableScanning();
|
||||
@@ -190,6 +190,17 @@ public class BluetoothPairingDetail extends DeviceListPreferenceFragment impleme
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {
|
||||
if (mSelectedDevice != null) {
|
||||
BluetoothDevice device = cachedDevice.getDevice();
|
||||
if (device != null && mSelectedDevice.equals(device)
|
||||
&& state == BluetoothAdapter.STATE_CONNECTED) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHelpResource() {
|
||||
return R.string.help_url_bluetooth;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user