STD: 0. Our device name: A, Remote device name B. 1. Go Settings::Bluetooth panel and turn Bluetooth on. 2. Click remote device B to pair with it. 3. Reject/Cancel the pairing request on remote device B. Expected Result: * Will show an error dialog. * The description of the remote device B should be back to 'Tap to connect'. Actual Result: * No error dialog display. * The description of the remote device B is still showing 'Pairing with device...'
Since Bluetooth API v2 exposed pair() promise function call, we can reach the failed reason via parameter of Promise.reject(). We have to show the error dialog with corrected message according to the definition of reason. Ref: https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothAdapter#pair.28DOMString_aDeviceAddress.29
Created attachment 8573839 [details] [review] [gaia] ian-liu:bluetooth/bug1140299_show_error_dialog_for_pairing_failed > mozilla-b2g:master
Since the error code is not defined completely in API v2, I use the default message first as v1. And the default message is usually displayed in pair failed case in v1, I have seen. Let's don't block the pairing flow for QA test.
Comment on attachment 8573839 [details] [review] [gaia] ian-liu:bluetooth/bug1140299_show_error_dialog_for_pairing_failed > mozilla-b2g:master Arthur, could you please help to review my pull request? Thanks. The other error messages will be displaying normally while platform response the error code as v1. The other error code in v1: 'Repeated Attempts' 'Authentication Failed'
Attachment #8573839 - Flags: review?(arthur.chen)
Per comment 1 and offline discussion, need info Jamin and Jocelyn for the definition of error code.
Attachment #8573839 - Flags: review?(arthur.chen) → review+
Thanks for Arthur's reviewing effort. Since the pull request is landed, we can close the issue now. Gaia/master: https://github.com/mozilla-b2g/gaia/commit/373c9ddb916631facbae3d6f70fb82f3ff501411
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(In reply to Ian Liu [:ianliu] from comment #5) > Per comment 1 and offline discussion, need info Jamin and Jocelyn for the > definition of error code. Since the error messages from Bluetooth stack are implementation dependent, it's a little controversial if we put the error code of BlueDroid to our API site. Gecko Blutooth team will revise the wiki after we figure out how to define a general error code for different back-ends. However, the definition of error code for the current implementation can be found here. https://dxr.mozilla.org/mozilla-central/source/dom/base/domerr.msg?from=domerr.msg#105 Please refer to the "Non-standard Bluetooth DOM errors" section. Thanks.
You need to log in before you can comment on or make changes to this bug.