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
Родитель 09ebd52118
Коммит cbd95cfe18
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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