Closed Bug 1050126 Opened 10 years ago Closed 10 years ago

[Bluetooth] Port bug 1038591 to bluetooth2

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tzimmermann, Assigned: tzimmermann)

References

Details

Attachments

(6 files, 1 obsolete file)

28.95 KB, patch
ben.tian
: review+
Details | Diff | Splinter Review
11.11 KB, patch
ben.tian
: review+
Details | Diff | Splinter Review
4.34 KB, patch
ben.tian
: review+
Details | Diff | Splinter Review
31.67 KB, patch
ben.tian
: review+
Details | Diff | Splinter Review
68.12 KB, patch
ben.tian
: review+
Details | Diff | Splinter Review
37.89 KB, patch
tzimmermann
: review+
Details | Diff | Splinter Review
      No description provided.
Assignee: nobody → tzimmermann
Depends on: 1038591
Blocks: 1019376
Hi Ben,

These patches are the same as for bug 1038591 plus the build fix from bug 1050299.
Comment on attachment 8472919 [details] [diff] [review]
[01] Bug 1050126: Convert Bluetooth data types in |BluetoothInterface| (under bluetooth2/)

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

LGTM
Attachment #8472919 - Flags: review?(btian) → review+
Comment on attachment 8472920 [details] [diff] [review]
[02] Bug 1050126: Convert Bluetooth Socket data types in |BluetoothSocketInterface| (under bluetooth2/)

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

LGTM
Attachment #8472920 - Flags: review?(btian) → review+
Comment on attachment 8472921 [details] [diff] [review]
[03] Bug 1050126: Convert Bluetooth Handsfree data types in |BluetoothHandsfreeInterface| (under bluetooth2/)

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

r=me with comment addressed.

Also please have a followup bug (as mentioned in bug 1038591 comment 13) to integrate |BluetoothHfpManager::ConvertToBluetoothHandsfreeCallState| into |BluetoothInterface::Convert|. The reason is that call state transition has become: telephony call state -> BluetoothHandsfreeCallState -> bthf_call_state_t. I think we can leverage telephony call state in Handsfree manager and do telephony call state -> bthf_call_state_t transition only.

::: dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp
@@ +1087,5 @@
>  
>    int service = (regState.EqualsLiteral("registered")) ? 1 : 0;
>    if (service != mService) {
>      // Notify BluetoothRilListener of service change
>      mListener->ServiceChanged(aClientId, service);

Declare |service| of type |BluetoothHandsfreeNetworkState| as well since we compare |service| and |mService|.

  BluetoothHandsfreeNetworkState service =
    regState.EqualsLiteral("registered") ? HFP_NETWORK_STATE_AVAILABLE :
                                           HFP_NETWORK_STATE_NOT_AVAILABLE;
  if (service != mService) {
    // Notify BluetoothRilListener of service change
    mListener->ServiceChanged(aClientId,
                              (service == HFP_NETWORK_STATE_AVAILABLE));
  }
  mService = service;
Attachment #8472921 - Flags: review?(btian) → review+
Comment on attachment 8472922 [details] [diff] [review]
[04] Bug 1050126: Convert Bluetooth A2DP data types in |BluetoothA2dpInterface| (under bluetooth2/)

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

LGTM
Attachment #8472922 - Flags: review?(btian) → review+
Comment on attachment 8472924 [details] [diff] [review]
[06] Bug 1050126: Convert Bluedroid status codes and error handlers (under bluetooth2/)

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

LGTM
Attachment #8472924 - Flags: review?(btian) → review+
Comment on attachment 8472923 [details] [diff] [review]
[05] Bug 1050126: Convert Bluetooth AVRCP data types in |BluetoothAvrcpInterface| (under bluetooth2/)

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

LGTM
Attachment #8472923 - Flags: review?(btian) → review+
Hi

> r=me with comment addressed.
> 
> Also please have a followup bug (as mentioned in bug 1038591 comment 13) to
> integrate |BluetoothHfpManager::ConvertToBluetoothHandsfreeCallState| into
> |BluetoothInterface::Convert|. The reason is that call state transition has
> become: telephony call state -> BluetoothHandsfreeCallState ->
> bthf_call_state_t. I think we can leverage telephony call state in Handsfree
> manager and do telephony call state -> bthf_call_state_t transition only.

That was the first approach I tried with the original patches, but it doesn't work for several reasons. First of all there's no 1-to-1 conversion from Telephony states to HFP states in the HFP manager. That means that we'd be moving policy from the HFP manager to the Bluetooth backend, where it doesn't belong. The other reason is that we're coupling the BT backend to the Telephony module, from which it should be independent for design reasons.
Got it. Thanks for clarification.

(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #14)
> That was the first approach I tried with the original patches, but it
> doesn't work for several reasons. First of all there's no 1-to-1 conversion
> from Telephony states to HFP states in the HFP manager. That means that we'd
> be moving policy from the HFP manager to the Bluetooth backend, where it
> doesn't belong. The other reason is that we're coupling the BT backend to
> the Telephony module, from which it should be independent for design reasons.
Changes since v1:

  - cleaned up type of |service|
Attachment #8472921 - Attachment is obsolete: true
Attachment #8473642 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: