Closed Bug 914175 Opened 11 years ago Closed 11 years ago

[B2G] [Bluetooth] Reply error when no profile is connected

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+, firefox26 fixed)

RESOLVED FIXED
1.2 FC (16sep)
blocking-b2g koi+
Tracking Status
firefox26 --- fixed

People

(Reporter: gyeh, Assigned: gyeh)

References

Details

Attachments

(1 file, 2 obsolete files)

There's a bit API changes in Bug 906305.

For BluetoothAdpater.connect(device), BluetoothProfileController would try to connect multiple profiles based on the class of device (CoD). The DOMRequest is returned once all processes has been done.

However, if none of the profiles is successfully connected, we should reply the DOM request with an error.
Eric, please review this patch. Thanks.
Assignee: nobody → gyeh
Attachment #801616 - Flags: review?(echou)
blocking-b2g: --- → koi?
Blocks: 910140
In the final patch, I'd like to add comments in BluetoothAdapter.webidl to describe how to use our API.
blocking-b2g: koi? → koi+
Comment on attachment 801616 [details] [diff] [review]
Patch 1(v1): Reply error when no profile is connected

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

r- because the logic of setting mSuccess doesn't cover the "one profile link established, but the other one failed" scenario.

::: dom/bluetooth/BluetoothProfileController.cpp
@@ +30,5 @@
>    MOZ_ASSERT(aCallback);
>  
>    mProfilesIndex = -1;
>    mProfiles.Clear();
> +  mSuccess = true;

nit: using field initialization should be fine.

::: dom/bluetooth/BluetoothProfileManagerBase.h
@@ +14,5 @@
>   */
>  #define ERR_ALREADY_CONNECTED           "AlreadyConnectedError"
>  #define ERR_ALREADY_DISCONNECTED        "AlreadyDisconnectedError"
> +#define ERR_CONNECTION_FAILED           "ConnectionFailed"
> +#define ERR_DISCONNECTION_FAILED        "DisconnectionFailed"

nit: please append 'Error' to both strings for consistency
Attachment #801616 - Flags: review?(echou) → review-
Eric, the patch has been updated. Please take a look, thanks.
Attachment #801616 - Attachment is obsolete: true
Attachment #802245 - Flags: review?(echou)
Comment on attachment 802245 [details] [diff] [review]
Patch 1(v2): Reply error when no profile is connected

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

Looks good. Thanks :)
Attachment #802245 - Flags: review?(echou) → review+
Thanks.
https://hg.mozilla.org/mozilla-central/rev/8ca9a823fc2c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.2 FC (16sep)
Depends on: 915812
This needs to be backed out. This caused bug 915812, which breaks a daily smoketest for bluetooth.
Flags: needinfo?(ryanvm)
This doesn't seem to be the reason why bug 915812 occurs. It could also be a Gaia problem since we've done some changes both in Gecko and Gaia recently. I'll do a quick investigation and see if this patch is a problem.
No longer depends on: 915812
Flags: needinfo?(ryanvm)
You need to log in before you can comment on or make changes to this bug.