зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
fd3fa728fe
Коммит
d4a238ea67
|
@ -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));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче