Bug 1069868 - Set Bluetooth property |discoverable| to |false| after Bluetooth enabled. r=shuang

Bluetooth scan mode is BT_SCAN_MODE_CONNECTABLE by default, it means it
should be connectable and non-discoverable.
This commit is contained in:
Jamin Liu 2014-10-21 01:27:00 -04:00
parent 8cbf6b957f
commit 5b97ce2989
2 changed files with 6 additions and 4 deletions

View File

@ -92,10 +92,11 @@ public:
sSetPropertyRunnableArray.Clear();
sUnbondingRunnableArray.Clear();
// Bluetooth scan mode is NONE by default
// Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., It should
// be connectable and non-discoverable.
NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
sBtInterface->SetAdapterProperty(
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), true),
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), false),
new SetAdapterPropertyResultHandler());
// Try to fire event 'AdapterAdded' to fit the original behaviour when

View File

@ -107,10 +107,11 @@ public:
sBondingRunnableArray.Clear();
sUnbondingRunnableArray.Clear();
// Bluetooth scan mode is NONE by default
// Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., It should
// be connectable and non-discoverable.
NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
sBtInterface->SetAdapterProperty(
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), true),
BluetoothNamedValue(NS_ConvertUTF8toUTF16("Discoverable"), false),
new SetAdapterPropertyResultHandler());
// Trigger BluetoothOppManager to listen