Closed Bug 1083708 Opened 10 years ago Closed 10 years ago

[Bluetooth] Handle non-available profiles in Bluetooth profile managers

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S7 (24Oct)

People

(Reporter: tzimmermann, Assigned: tzimmermann)

References

Details

Attachments

(1 file, 1 obsolete file)

While working on the BT daemon, I found that some of the BT managers don't work correctly if some profile interfaces are not available. The initialization and cleanup gets stuck in this case.
This patch makes sure that BT make progress, even if individual profile managers fail to initialize or clean up.
Attachment #8506062 - Flags: review?(shuang)
Comment on attachment 8506062 [details] [diff] [review]
[01] Bug 1083708: Handle non-existant Bluetooth profile interfaces correctly

Review of attachment 8506062 [details] [diff] [review]:
-----------------------------------------------------------------

Only nits had been addressed.

::: dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
@@ +226,5 @@
>  BluetoothA2dpManager::InitA2dpInterface(BluetoothProfileResultHandler* aRes)
>  {
>    BluetoothInterface* btInf = BluetoothInterface::GetInstance();
> +  if (NS_WARN_IF(!btInf)) {
> +    // If there's no HFP interface, we dispatch a runnable

nit: /HFP/HAL/

@@ +239,4 @@
>  
>    sBtA2dpInterface = btInf->GetBluetoothA2dpInterface();
> +  if (NS_WARN_IF(!sBtA2dpInterface)) {
> +    // If there's no HFP interface, we dispatch a runnable

nit:/HFP/A2DP

::: dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ +356,5 @@
>  BluetoothHfpManager::InitHfpInterface(BluetoothProfileResultHandler* aRes)
>  {
>    BluetoothInterface* btInf = BluetoothInterface::GetInstance();
> +  if (NS_WARN_IF(!btInf)) {
> +    // If there's no HFP interface, we dispatch a runnable

nit:s/HFP/HAL

::: dom/bluetooth2/bluedroid/BluetoothA2dpManager.cpp
@@ +230,5 @@
>  BluetoothA2dpManager::InitA2dpInterface(BluetoothProfileResultHandler* aRes)
>  {
>    BluetoothInterface* btInf = BluetoothInterface::GetInstance();
> +  if (NS_WARN_IF(!btInf)) {
> +    // If there's no HFP interface, we dispatch a runnable

nit: s/HFP/HAL/

@@ +242,5 @@
>    }
>  
>    sBtA2dpInterface = btInf->GetBluetoothA2dpInterface();
> +  if (NS_WARN_IF(!sBtA2dpInterface)) {
> +    // If there's no HFP interface, we dispatch a runnable

nit:s/HFP/A2DP/

::: dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp
@@ +347,5 @@
>  BluetoothHfpManager::InitHfpInterface(BluetoothProfileResultHandler* aRes)
>  {
>    BluetoothInterface* btInf = BluetoothInterface::GetInstance();
> +  if (NS_WARN_IF(!btInf)) {
> +    // If there's no HFP interface, we dispatch a runnable

nit:s/HFP/HAL
Attachment #8506062 - Flags: review?(shuang) → review+
Changes since v1:

  - fixed comments
Attachment #8506062 - Attachment is obsolete: true
Attachment #8506163 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/3dba8eb39239
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S7 (24Oct)
You need to log in before you can comment on or make changes to this bug.