Bug 950891: Don't run GetServiceChannel while turning Bluetooth on/off, r=echou

This patch adds a check to BluetoothDBusService::GetServiceChannel to
ensure that Bluetooth is ready. If the system is in a transition from
on to off, or vice versa, the method might operate on an undefined
state.
This commit is contained in:
Thomas Zimmermann 2014-01-07 13:46:20 +01:00
Родитель fd3fa728fe
Коммит d4a238ea67
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -2886,6 +2886,11 @@ BluetoothDBusService::GetServiceChannel(const nsAString& aDeviceAddress,
{
MOZ_ASSERT(NS_IsMainThread());
if (!IsReady()) {
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
return NS_OK;
}
MOZ_ASSERT(!sAdapterPath.IsEmpty());
nsString objectPath(GetObjectPathFromAddress(sAdapterPath, aDeviceAddress));