Device Discoverability not set properly when Bluetooth is toggled

Issue:
When BT is turned off/on staying in the same BT Settings
screen discoverability was not set again.

Fix:
Handle setting discoverability Bluetooth state change
intents also when BT state is  turned ON.

Bug: 21944289
Change-Id: Ic3c8d476c53673b21d40ea2bd9669758d89c2aee
This commit is contained in:
Avish Shah
2015-06-19 16:50:39 +05:30
committed by Andre Eisenbach
parent 56594c6d61
commit ad1f28cde0

View File

@@ -416,6 +416,10 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
@Override @Override
public void onBluetoothStateChanged(int bluetoothState) { public void onBluetoothStateChanged(int bluetoothState) {
super.onBluetoothStateChanged(bluetoothState); super.onBluetoothStateChanged(bluetoothState);
// If BT is turned off/on staying in the same BT Settings screen
// discoverability to be set again
if (BluetoothAdapter.STATE_ON == bluetoothState)
mInitiateDiscoverable = true;
updateContent(bluetoothState); updateContent(bluetoothState);
} }