diff --git a/dom/bluetooth/BluetoothHidManager.cpp b/dom/bluetooth/BluetoothHidManager.cpp index b5e9a1ad911..e945ce326bd 100644 --- a/dom/bluetooth/BluetoothHidManager.cpp +++ b/dom/bluetooth/BluetoothHidManager.cpp @@ -146,14 +146,16 @@ BluetoothHidManager::Disconnect(BluetoothProfileController* aController) BluetoothService* bs = BluetoothService::Get(); if (!bs) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); } return; } if (!mConnected) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); } return; } @@ -210,7 +212,8 @@ void BluetoothHidManager::HandleInputPropertyChanged(const BluetoothSignal& aSignal) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue); + MOZ_ASSERT(aSignal.value().type() == + BluetoothValue::TArrayOfBluetoothNamedValue); const InfallibleTArray& arr = aSignal.value().get_ArrayOfBluetoothNamedValue(); diff --git a/dom/bluetooth/BluetoothInterface.h b/dom/bluetooth/BluetoothInterface.h index acab86c1039..9e4a1b0d557 100644 --- a/dom/bluetooth/BluetoothInterface.h +++ b/dom/bluetooth/BluetoothInterface.h @@ -481,7 +481,8 @@ public: const BluetoothAvrcpNotificationParam& aParam, BluetoothAvrcpResultHandler* aRes) = 0; - virtual void SetVolume(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes) = 0; + virtual void SetVolume(uint8_t aVolume, + BluetoothAvrcpResultHandler* aRes) = 0; protected: BluetoothAvrcpInterface(); @@ -1073,7 +1074,8 @@ public: virtual void DiscoveryStateChangedNotification(bool aState) { } virtual void PinRequestNotification(const nsAString& aRemoteBdAddr, - const nsAString& aBdName, uint32_t aCod) { } + const nsAString& aBdName, + uint32_t aCod) { } virtual void SspRequestNotification(const nsAString& aRemoteBdAddr, const nsAString& aBdName, uint32_t aCod, diff --git a/dom/bluetooth/BluetoothProfileManagerBase.h b/dom/bluetooth/BluetoothProfileManagerBase.h index c90a51ee195..5f3ba92b465 100644 --- a/dom/bluetooth/BluetoothProfileManagerBase.h +++ b/dom/bluetooth/BluetoothProfileManagerBase.h @@ -50,12 +50,12 @@ public: virtual void OnUpdateSdpRecords(const nsAString& aDeviceAddress) = 0; /** - * Returns the address of the connected device. + * Return the address of the connected device. */ virtual void GetAddress(nsAString& aDeviceAddress) = 0; /** - * Returns true if the profile is connected. + * Return true if the profile is connected. */ virtual bool IsConnected() = 0; @@ -84,7 +84,7 @@ public: virtual void Reset() = 0; /** - * Returns string of profile name. + * Return string of profile name. */ virtual void GetName(nsACString& aName) = 0; }; @@ -103,7 +103,7 @@ public: \ BluetoothProfileController* aController) override; \ virtual void Disconnect(BluetoothProfileController* aController) override; \ virtual void OnConnect(const nsAString& aErrorStr) override; \ - virtual void OnDisconnect(const nsAString& AErrorStr) override; \ + virtual void OnDisconnect(const nsAString& aErrorStr) override; \ virtual void Reset() override; END_BLUETOOTH_NAMESPACE diff --git a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp index efd6a470f76..d0fb96b84f5 100644 --- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp @@ -561,14 +561,16 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController) BluetoothService* bs = BluetoothService::Get(); if (!bs) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); } return; } if (!mA2dpConnected) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); } return; } @@ -580,7 +582,8 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController) if (!sBtA2dpInterface) { BT_LOGR("sBluetoothA2dpInterface is null"); if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); } return; } @@ -1011,8 +1014,8 @@ BluetoothA2dpManager::GetArtist(nsAString& aArtist) */ void -BluetoothA2dpManager::ConnectionStateNotification(BluetoothA2dpConnectionState aState, - const nsAString& aBdAddr) +BluetoothA2dpManager::ConnectionStateNotification( + BluetoothA2dpConnectionState aState, const nsAString& aBdAddr) { MOZ_ASSERT(NS_IsMainThread()); diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp index 1505616a5e1..5b817169f77 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp @@ -2521,7 +2521,8 @@ BluetoothDaemonGattClientInterface::Listen( /* Clear the attribute cache for a given device*/ void BluetoothDaemonGattClientInterface::Refresh( - int aClientIf, const nsAString& aBdAddr, BluetoothGattClientResultHandler* aRes) + int aClientIf, const nsAString& aBdAddr, + BluetoothGattClientResultHandler* aRes) { MOZ_ASSERT(mModule); diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp index 42a97756437..4873147add3 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp +++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp @@ -40,8 +40,8 @@ BluetoothDaemonHandsfreeModule::Send(DaemonSocketPDU* aPDU, } void -BluetoothDaemonHandsfreeModule::HandleSvc(const DaemonSocketPDUHeader& aHeader, - DaemonSocketPDU& aPDU, void* aUserData) +BluetoothDaemonHandsfreeModule::HandleSvc( + const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU, void* aUserData) { static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])( const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = { diff --git a/dom/bluetooth/bluedroid/BluetoothGattManager.cpp b/dom/bluetooth/bluedroid/BluetoothGattManager.cpp index e1418029bed..eaf7d6af1fc 100644 --- a/dom/bluetooth/bluedroid/BluetoothGattManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothGattManager.cpp @@ -1173,7 +1173,8 @@ BluetoothGattManager::WriteCharacteristicValue( return; } - client->mWriteCharacteristicState.Assign(aWriteType, aValue, false, aRunnable); + client->mWriteCharacteristicState.Assign( + aWriteType, aValue, false, aRunnable); /** * First, write the characteristic value through an unauthenticated physical diff --git a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp index 921f5699746..b689c16c4ab 100644 --- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp +++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp @@ -1639,9 +1639,8 @@ BluetoothServiceBluedroid::DiscoveryStateChangedNotification(bool aState) } void -BluetoothServiceBluedroid::PinRequestNotification(const nsAString& aRemoteBdAddr, - const nsAString& aBdName, - uint32_t aCod) +BluetoothServiceBluedroid::PinRequestNotification( + const nsAString& aRemoteBdAddr, const nsAString& aBdName, uint32_t aCod) { MOZ_ASSERT(NS_IsMainThread()); diff --git a/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp b/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp index b7e893fa283..c940ae3f534 100644 --- a/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp @@ -794,7 +794,8 @@ BluetoothAdapter::GetConnectedDevices(uint16_t aServiceUuid, ErrorResult& aRv) } void -BluetoothAdapter::GetPairedDevices(nsTArray >& aDevices) +BluetoothAdapter::GetPairedDevices( + nsTArray >& aDevices) { for (uint32_t i = 0; i < mDevices.Length(); ++i) { if (mDevices[i]->Paired()) { @@ -1332,7 +1333,8 @@ BluetoothAdapter::SendFile(const nsAString& aDeviceAddress, } already_AddRefed -BluetoothAdapter::StopSendingFile(const nsAString& aDeviceAddress, ErrorResult& aRv) +BluetoothAdapter::StopSendingFile( + const nsAString& aDeviceAddress, ErrorResult& aRv) { nsCOMPtr win = GetOwner(); if (!win) { @@ -1532,7 +1534,8 @@ BluetoothAdapter::ToggleCalls(ErrorResult& aRv) } already_AddRefed -BluetoothAdapter::SendMediaMetaData(const MediaMetaData& aMediaMetaData, ErrorResult& aRv) +BluetoothAdapter::SendMediaMetaData( + const MediaMetaData& aMediaMetaData, ErrorResult& aRv) { nsCOMPtr win = GetOwner(); if (!win) { @@ -1561,7 +1564,8 @@ BluetoothAdapter::SendMediaMetaData(const MediaMetaData& aMediaMetaData, ErrorRe } already_AddRefed -BluetoothAdapter::SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv) +BluetoothAdapter::SendMediaPlayStatus( + const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv) { nsCOMPtr win = GetOwner(); if (!win) { diff --git a/dom/bluetooth/bluetooth2/BluetoothAdapter.h b/dom/bluetooth/bluetooth2/BluetoothAdapter.h index 4ccdda2c314..cb5db9ad1db 100644 --- a/dom/bluetooth/bluetooth2/BluetoothAdapter.h +++ b/dom/bluetooth/bluetooth2/BluetoothAdapter.h @@ -314,6 +314,8 @@ private: * Convert string to BluetoothAdapterAttribute. * * @param aString [in] String to convert + * + * @return the adapter attribute converted from |aString| */ BluetoothAdapterAttribute ConvertStringToAdapterAttribute(const nsAString& aString); @@ -323,14 +325,16 @@ private: * * @param aType [in] Adapter property to check * @param aValue [in] New value of the adapter property + * + * @return true if the adapter property has changed; false otherwise */ bool IsAdapterAttributeChanged(BluetoothAdapterAttribute aType, const BluetoothValue& aValue); /** - * Check whether this adapter is owned by Bluetooth certified app. + * Check whether this adapter belongs to Bluetooth certified app. * - * @return a boolean value to indicate whether it's owned by Bluetooth app. + * @return true if this adapter belongs to Bluetooth app; false otherwise */ bool IsBluetoothCertifiedApp(); diff --git a/dom/bluetooth/bluetooth2/BluetoothDevice.h b/dom/bluetooth/bluetooth2/BluetoothDevice.h index fd304972ded..914976923ca 100644 --- a/dom/bluetooth/bluetooth2/BluetoothDevice.h +++ b/dom/bluetooth/bluetooth2/BluetoothDevice.h @@ -126,6 +126,8 @@ private: * Convert uint32_t to BluetoothDeviceType. * * @param aValue [in] uint32_t to convert + * + * @return the device type converted from |aValue| */ BluetoothDeviceType ConvertUint32ToDeviceType(const uint32_t aValue); @@ -133,6 +135,8 @@ private: * Convert string to BluetoothDeviceAttribute. * * @param aString [in] String to convert + * + * @return the device attribute converted from |aString| */ BluetoothDeviceAttribute ConvertStringToDeviceAttribute(const nsAString& aString); @@ -142,6 +146,8 @@ private: * * @param aType [in] Device property to check * @param aValue [in] New value of the device property + * + * @return true is the device attribute has changed; false otherwise */ bool IsDeviceAttributeChanged(BluetoothDeviceAttribute aType, const BluetoothValue& aValue); @@ -152,7 +158,7 @@ private: * Parse 'Advertising Data Type' from an inquiry response and set name, UUIDs * and COD if they exist in ADV data. * - * @param aAdvData [in] advertising data which provided by the LeScan result. + * @param aAdvData [in] advertising data from LeScan result. */ void UpdatePropertiesFromAdvData(const nsTArray& aAdvData); diff --git a/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp b/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp index 9f0dc81bf9d..46f91d392ce 100644 --- a/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp @@ -95,7 +95,7 @@ BluetoothDiscoveryHandle::DispatchLeDeviceEvent(BluetoothDevice* aLeDevice, bool hasUuidsFilter = !mServiceUuids.IsEmpty(); bool noAdvertisingUuid = remoteUuids.IsEmpty(); - // If a LE device doesn't advertise its service UUIDs, it can't possibly pass + // If an LE device doesn't advertise its service UUIDs, it can't possibly pass // the UUIDs filter. if (hasUuidsFilter && noAdvertisingUuid) { return; @@ -104,7 +104,7 @@ BluetoothDiscoveryHandle::DispatchLeDeviceEvent(BluetoothDevice* aLeDevice, // The web API startLeScan() makes the device's adapter start seeking for // remote LE devices advertising given service UUIDs. // Since current Bluetooth stack can't filter the results of LeScan by UUIDs, - // gecko has to filter the results and dispach what API asked for. + // gecko has to filter the results and dispatch what API asked for. bool matched = false; for (size_t index = 0; index < remoteUuids.Length(); ++index) { if (mServiceUuids.Contains(remoteUuids[index])) { @@ -113,8 +113,8 @@ BluetoothDiscoveryHandle::DispatchLeDeviceEvent(BluetoothDevice* aLeDevice, } } - // Dispach 'devicefound 'event only if - // - the service UUIDs in the scan record matchs the given UUIDs. + // Dispatch 'devicefound' event only if + // - the service UUID in the scan record matches one of the given UUIDs. // - the given UUIDs is empty. if (matched || mServiceUuids.IsEmpty()) { nsRefPtr event = diff --git a/dom/bluetooth/bluetooth2/BluetoothGatt.cpp b/dom/bluetooth/bluetooth2/BluetoothGatt.cpp index 9f15f8c845c..ff86b8d578c 100644 --- a/dom/bluetooth/bluetooth2/BluetoothGatt.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothGatt.cpp @@ -302,7 +302,8 @@ BluetoothGatt::HandleCharacteristicsDiscovered(const BluetoothValue& aValue) aValue.get_ArrayOfBluetoothNamedValue(); MOZ_ASSERT(values.Length() == 2); // ServiceId, Characteristics MOZ_ASSERT(values[0].name().EqualsLiteral("serviceId")); - MOZ_ASSERT(values[0].value().type() == BluetoothValue::TBluetoothGattServiceId); + MOZ_ASSERT(values[0].value().type() == + BluetoothValue::TBluetoothGattServiceId); MOZ_ASSERT(values[1].name().EqualsLiteral("characteristics")); MOZ_ASSERT(values[1].value().type() == BluetoothValue::TArrayOfBluetoothGattCharAttribute); @@ -325,11 +326,13 @@ BluetoothGatt::HandleDescriptorsDiscovered(const BluetoothValue& aValue) aValue.get_ArrayOfBluetoothNamedValue(); MOZ_ASSERT(values.Length() == 3); // ServiceId, CharacteristicId, Descriptors MOZ_ASSERT(values[0].name().EqualsLiteral("serviceId")); - MOZ_ASSERT(values[0].value().type() == BluetoothValue::TBluetoothGattServiceId); + MOZ_ASSERT(values[0].value().type() == + BluetoothValue::TBluetoothGattServiceId); MOZ_ASSERT(values[1].name().EqualsLiteral("characteristicId")); MOZ_ASSERT(values[1].value().type() == BluetoothValue::TBluetoothGattId); MOZ_ASSERT(values[2].name().EqualsLiteral("descriptors")); - MOZ_ASSERT(values[2].value().type() == BluetoothValue::TArrayOfBluetoothGattId); + MOZ_ASSERT(values[2].value().type() == + BluetoothValue::TArrayOfBluetoothGattId); size_t index = mServices.IndexOf( values[0].value().get_BluetoothGattServiceId()); diff --git a/dom/bluetooth/bluetooth2/BluetoothGatt.h b/dom/bluetooth/bluetooth2/BluetoothGatt.h index 0085df06e73..ce6864aac26 100644 --- a/dom/bluetooth/bluetooth2/BluetoothGatt.h +++ b/dom/bluetooth/bluetooth2/BluetoothGatt.h @@ -142,7 +142,7 @@ private: /** * The value of a GATT characteristic has changed. In the mean time, the - * cached value of this GATT characteristic has already been updated. An + * cached value of this GATT characteristic has already been updated. A * 'characteristicchanged' event will be fired by this function. * * @param aValue [in] BluetoothValue which contains an array of diff --git a/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp b/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp index d9ff633bae6..bea2ab1274c 100644 --- a/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp @@ -188,12 +188,14 @@ BluetoothGattCharacteristic::GetProperties( { aProperties.mBroadcast = mProperties & GATT_CHAR_PROP_BIT_BROADCAST; aProperties.mRead = mProperties & GATT_CHAR_PROP_BIT_READ; - aProperties.mWriteNoResponse = mProperties & GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE; + aProperties.mWriteNoResponse = + mProperties & GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE; aProperties.mWrite = mProperties & GATT_CHAR_PROP_BIT_WRITE; aProperties.mNotify = mProperties & GATT_CHAR_PROP_BIT_NOTIFY; aProperties.mIndicate = mProperties & GATT_CHAR_PROP_BIT_INDICATE; aProperties.mSignedWrite = mProperties & GATT_CHAR_PROP_BIT_SIGNED_WRITE; - aProperties.mExtendedProps = mProperties & GATT_CHAR_PROP_BIT_EXTENDED_PROPERTIES; + aProperties.mExtendedProps = + mProperties & GATT_CHAR_PROP_BIT_EXTENDED_PROPERTIES; } class ReadValueTask final : public BluetoothReplyRunnable diff --git a/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp b/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp index fe4d95f1928..0adf8926804 100644 --- a/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp @@ -38,7 +38,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothLeDeviceEvent) NS_INTERFACE_MAP_END_INHERITING(Event) -BluetoothLeDeviceEvent::BluetoothLeDeviceEvent(mozilla::dom::EventTarget* aOwner) +BluetoothLeDeviceEvent::BluetoothLeDeviceEvent( + mozilla::dom::EventTarget* aOwner) : Event(aOwner, nullptr, nullptr) { mozilla::HoldJSObjects(this); diff --git a/dom/bluetooth/bluetooth2/BluetoothService.cpp b/dom/bluetooth/bluetooth2/BluetoothService.cpp index ea02ff4ab62..5c860ad9b22 100644 --- a/dom/bluetooth/bluetooth2/BluetoothService.cpp +++ b/dom/bluetooth/bluetooth2/BluetoothService.cpp @@ -301,7 +301,8 @@ RemoveAllSignalHandlers(const nsAString& aKey, nsAutoPtr& aData, void* aUserArg) { - BluetoothSignalObserver* handler = static_cast(aUserArg); + BluetoothSignalObserver* handler = + static_cast(aUserArg); aData->RemoveObserver(handler); // We shouldn't have duplicate instances in the ObserverList, but there's // no appropriate way to do duplication check while registering, so @@ -320,13 +321,15 @@ BluetoothService::UnregisterAllSignalHandlers(BluetoothSignalObserver* aHandler) } void -BluetoothService::DistributeSignal(const nsAString& aName, const nsAString& aPath) +BluetoothService::DistributeSignal(const nsAString& aName, + const nsAString& aPath) { DistributeSignal(aName, aPath, BluetoothValue(true)); } void -BluetoothService::DistributeSignal(const nsAString& aName, const nsAString& aPath, +BluetoothService::DistributeSignal(const nsAString& aName, + const nsAString& aPath, const BluetoothValue& aValue) { BluetoothSignal signal(nsString(aName), nsString(aPath), aValue); diff --git a/dom/bluetooth/bluez/BluetoothA2dpManager.cpp b/dom/bluetooth/bluez/BluetoothA2dpManager.cpp index 098fe7918eb..3e8f97af910 100644 --- a/dom/bluetooth/bluez/BluetoothA2dpManager.cpp +++ b/dom/bluetooth/bluez/BluetoothA2dpManager.cpp @@ -184,14 +184,16 @@ BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController) BluetoothService* bs = BluetoothService::Get(); if (!bs) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE)); } return; } if (!mA2dpConnected) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); } return; } @@ -262,7 +264,8 @@ void BluetoothA2dpManager::HandleSinkPropertyChanged(const BluetoothSignal& aSignal) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue); + MOZ_ASSERT(aSignal.value().type() == + BluetoothValue::TArrayOfBluetoothNamedValue); const nsString& address = aSignal.path(); /** diff --git a/dom/bluetooth/bluez/BluetoothDBusService.cpp b/dom/bluetooth/bluez/BluetoothDBusService.cpp index 11ebc844c4a..fcd0b236e58 100644 --- a/dom/bluetooth/bluez/BluetoothDBusService.cpp +++ b/dom/bluetooth/bluez/BluetoothDBusService.cpp @@ -378,7 +378,8 @@ static StaticAutoPtr sStopBluetoothMonitor; // Protects against bug 969447. static StaticAutoPtr sGetPropertyMonitor; -typedef void (*UnpackFunc)(DBusMessage*, DBusError*, BluetoothValue&, nsAString&); +typedef void (*UnpackFunc)(DBusMessage*, DBusError*, + BluetoothValue&, nsAString&); typedef bool (*FilterFunc)(const BluetoothValue&); static void @@ -400,9 +401,10 @@ DispatchToBtThread(nsIRunnable* aRunnable) MOZ_ASSERT(NS_IsMainThread()); if (!sBluetoothThread) { - sBluetoothThread = new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS, - NS_LITERAL_CSTRING("BluetoothDBusService"), - LazyIdleThread::ManualShutdown); + sBluetoothThread = + new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS, + NS_LITERAL_CSTRING("BluetoothDBusService"), + LazyIdleThread::ManualShutdown); ClearOnShutdown(&sBluetoothThread); } return sBluetoothThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL); @@ -589,7 +591,8 @@ public: { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mSignal.name().EqualsLiteral("PropertyChanged")); - MOZ_ASSERT(mSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue); + MOZ_ASSERT(mSignal.value().type() == + BluetoothValue::TArrayOfBluetoothNamedValue); // Replace object path with device address nsString address = GetAddressFromObjectPath(mSignal.path()); @@ -733,7 +736,7 @@ RunDBusCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable, MOZ_ASSERT(!NS_IsMainThread()); // I/O thread #endif nsRefPtr replyRunnable = - dont_AddRef(static_cast< BluetoothReplyRunnable* >(aBluetoothReplyRunnable)); + dont_AddRef(static_cast(aBluetoothReplyRunnable)); MOZ_ASSERT(replyRunnable, "Callback reply runnable is null!"); @@ -1472,7 +1475,8 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) // Do not send a notification to upper layer, too annoying. return DBUS_HANDLER_RESULT_HANDLED; - } else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE, "RequestPairingConsent")) { + } else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE, + "RequestPairingConsent")) { // Directly SetPairingconfirmation for RequestPairingConsent here if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_OBJECT_PATH, &objectPath, @@ -1481,7 +1485,8 @@ AgentEventFilter(DBusConnection *conn, DBusMessage *msg, void *data) goto handle_error; } - nsString address = GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath)); + nsString address = + GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath)); sPairingReqTable->Put(address, msg); Task* task = new SetPairingConfirmationTask(address, true, nullptr); DispatchToDBusThread(task); @@ -2093,12 +2098,13 @@ public: /* Normally we'll receive the signal 'AdapterAdded' with the adapter object * path from the DBus daemon during start up. So, there's no need to query * the object path of default adapter here. However, if we restart from a - * crash, the default adapter might already be available, so we ask the daemon - * explicitly here. + * crash, the default adapter might already be available, so we ask the + * daemon explicitly here. */ if (sAdapterPath.IsEmpty()) { - bool success = sDBusConnection->SendWithReply(OnDefaultAdapterReply, nullptr, - 1000, BLUEZ_DBUS_BASE_IFC, "/", + bool success = sDBusConnection->SendWithReply(OnDefaultAdapterReply, + nullptr, 1000, + BLUEZ_DBUS_BASE_IFC, "/", DBUS_MANAGER_IFACE, "DefaultAdapter", DBUS_TYPE_INVALID); @@ -2483,7 +2489,8 @@ OnSendDiscoveryMessageReply(DBusMessage *aReply, void *aData) } nsRefPtr runnable = - dont_AddRef(static_cast(aData)); + dont_AddRef( + static_cast(aData)); DispatchBluetoothReply(runnable.get(), BluetoothValue(true), errorStr); } @@ -2823,8 +2830,8 @@ private: }; nsresult -BluetoothDBusService::GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid, - BluetoothReplyRunnable* aRunnable) +BluetoothDBusService::GetConnectedDevicePropertiesInternal( + uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable) { MOZ_ASSERT(NS_IsMainThread()); @@ -3534,9 +3541,9 @@ private: class OnGetServiceChannelReplyHandler : public DBusReplyHandler { public: - OnGetServiceChannelReplyHandler(const nsAString& aDeviceAddress, - const nsAString& aServiceUUID, - BluetoothProfileManagerBase* aBluetoothProfileManager) + OnGetServiceChannelReplyHandler( + const nsAString& aDeviceAddress, const nsAString& aServiceUUID, + BluetoothProfileManagerBase* aBluetoothProfileManager) : mDeviceAddress(aDeviceAddress), mServiceUUID(aServiceUUID), mBluetoothProfileManager(aBluetoothProfileManager) @@ -3559,10 +3566,9 @@ public: channel = dbus_returns_int32(aReply); } - nsRefPtr r = new OnGetServiceChannelRunnable(mDeviceAddress, - mServiceUUID, - channel, - mBluetoothProfileManager); + nsRefPtr r = + new OnGetServiceChannelRunnable(mDeviceAddress, mServiceUUID, channel, + mBluetoothProfileManager); nsresult rv = NS_DispatchToMainThread(r); NS_ENSURE_SUCCESS_VOID(rv); } @@ -3877,8 +3883,8 @@ public: // We currently don't support genre field in music player. // In order to send media metadata through AVRCP, we set genre to an empty - // string to match the BlueZ method "UpdateMetaData" with signature "sssssss", - // which takes genre field as the last parameter. + // string to match the BlueZ method "UpdateMetaData" with signature + // "sssssss", which takes genre field as the last parameter. nsCString tempGenre = EmptyCString(); nsCString tempMediaNumber = EmptyCString(); nsCString tempTotalMediaCount = EmptyCString(); diff --git a/dom/bluetooth/bluez/BluetoothDBusService.h b/dom/bluetooth/bluez/BluetoothDBusService.h index 414c4b8b6b4..e3275845d3a 100644 --- a/dom/bluetooth/bluez/BluetoothDBusService.h +++ b/dom/bluetooth/bluez/BluetoothDBusService.h @@ -55,8 +55,8 @@ public: GetAdaptersInternal(BluetoothReplyRunnable* aRunnable) override; virtual nsresult - GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid, - BluetoothReplyRunnable* aRunnable) override; + GetConnectedDevicePropertiesInternal( + uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable) override; virtual nsresult GetPairedDevicePropertiesInternal(const nsTArray& aDeviceAddresses, @@ -66,9 +66,11 @@ public: FetchUuidsInternal(const nsAString& aDeviceAddress, BluetoothReplyRunnable* aRunnable) override; - virtual void StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override; + virtual void + StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override; - virtual void StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override; + virtual void + StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override; virtual nsresult SetProperty(BluetoothObjectType aType, diff --git a/dom/bluetooth/bluez/BluetoothHfpManager.cpp b/dom/bluetooth/bluez/BluetoothHfpManager.cpp index eb58686012e..54f1a5eed46 100644 --- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp +++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp @@ -590,7 +590,8 @@ BluetoothHfpManager::HandleVolumeChanged(nsISupports* aSubject) // {"key":"volumeup", "value":10} // {"key":"volumedown", "value":2} - RootedDictionary setting(nsContentUtils::RootingCx()); + RootedDictionary + setting(nsContentUtils::RootingCx()); if (!WrappedJSToDictionary(aSubject, setting)) { return; @@ -843,7 +844,8 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, if (!atCommandValues[0].EqualsLiteral("3") || !atCommandValues[1].EqualsLiteral("0")) { if (mCMEE) { - SendCommand(RESPONSE_CME_ERROR, BluetoothCmeError::OPERATION_NOT_SUPPORTED); + SendCommand(RESPONSE_CME_ERROR, + BluetoothCmeError::OPERATION_NOT_SUPPORTED); } else { SendLine("ERROR"); } @@ -1225,7 +1227,8 @@ BluetoothHfpManager::Disconnect(BluetoothProfileController* aController) if (!mSocket) { if (aController) { - aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); + aController->NotifyCompletion( + NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED)); } return; } @@ -1507,8 +1510,10 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex, case nsITelephonyService::CALL_STATE_HELD: switch (prevCallState) { case nsITelephonyService::CALL_STATE_CONNECTED: { - uint32_t numActive = GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED); - uint32_t numHeld = GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD); + uint32_t numActive = + GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED); + uint32_t numHeld = + GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD); uint32_t numConCalls = GetNumberOfConCalls(); /** @@ -1530,20 +1535,24 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex, if (!aIsConference) { if (numActive + numHeld == 1) { // A single active call is put on hold. - sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE; + sCINDItems[CINDType::CALLHELD].value = + CallHeldState::ONHOLD_NOACTIVE; } else { // An active call is placed on hold or active/held calls swapped. - sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE; + sCINDItems[CINDType::CALLHELD].value = + CallHeldState::ONHOLD_ACTIVE; } SendCommand(RESPONSE_CIEV, CINDType::CALLHELD); } else if (GetNumberOfConCalls(nsITelephonyService::CALL_STATE_HELD) == numConCalls) { if (numActive + numHeld == numConCalls) { // An active conference call is put on hold. - sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE; + sCINDItems[CINDType::CALLHELD].value = + CallHeldState::ONHOLD_NOACTIVE; } else { // Active calls are placed on hold or active/held calls swapped. - sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE; + sCINDItems[CINDType::CALLHELD].value = + CallHeldState::ONHOLD_ACTIVE; } SendCommand(RESPONSE_CIEV, CINDType::CALLHELD); }