Closed Bug 1147735 Opened 9 years ago Closed 9 years ago

Deprecate TelephonyCall.onerror, TelephonyCall.error

Categories

(Firefox OS Graveyard :: Gaia::Dialer, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aknow, Assigned: gsvelto)

References

Details

Attachments

(1 file)

See
https://bugzilla.mozilla.org/show_bug.cgi?id=1043165#c0
for the reason why we'd like to refine the API and deprecate |TelephonyCall.onerror|, |TelephonyCall.error|.

After bug 1043165, we could retrieve the disconnected reason from |TelephonyCall.disconnectedReason| when a call changes its state to 'disconnected'.  All the possible values are listed in TelephonyCall.webidl.
Blocks: 1181779
Blocks: 1193563
Blocks: 1197136
First WIP, this removes TelephonyCall.error from the dialer, I haven't checked all corner cases yet and how errors via the promise are handled. callscreen and emergency-call haven't been modified either yet.
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Second WIP, now properly handling the |disconnectedReason| in both the dialer (to display error messages) and the callscreen (to play the busy tone).
Third WIP fixing a small issue and covering the emergency-call app. Things look in good shape, now to fix the unit-tests...
Comment on attachment 8659804 [details] [review]
[gaia] gabrielesvelto:bug-1147735-deprecate-telephonycall-error > mozilla-b2g:master

Here's a version of the patch in good shape, to summarize the changes:

- a small method was added to the TelephonyMessages helper to display message related to |disconnectedReason|. Note that the |disconnectedReason| field holds the same strings as the old error description minus the 'Error' suffix. So a call that gets rejected because the other side is busy will have |disconnectedReason| set to 'Busy' vs the old 'BusyError' error name that was returned by the onerror event.

- in the dialer the |onerror| event handler is replaced by using the call promise rejection to detect failure and by looking at |disconnectedReason| to figure out why a call ended (or failed to connect)

- likewise in the emergency call app

- in the dialer we use the |ondisconnected| event instead of the |onerror| to detect a busy line and play the busy tone

- all unit tests and mocks have been adjusted accordingly
Attachment #8659804 - Flags: review?(drs)
Attachment #8659804 - Flags: review?(drs)
Comment on attachment 8659804 [details] [review]
[gaia] gabrielesvelto:bug-1147735-deprecate-telephonycall-error > mozilla-b2g:master

Updated the PR, I've pushed a patch on top that merges the ondisconnected handlers into one and adjusts the unit-tests accordingly.
Attachment #8659804 - Flags: review?(drs)
I've added another small patch that always rejects the call promise if we can't make a call. Previously we didn't return anything which is obviously wrong.
Comment on attachment 8659804 [details] [review]
[gaia] gabrielesvelto:bug-1147735-deprecate-telephonycall-error > mozilla-b2g:master

Looks good, thanks.
Attachment #8659804 - Flags: review?(drs) → review+
Addressed the final nits and merged to gaia/master 4bf8e171a7ea3397901191a25765432594aaff2c

https://github.com/mozilla-b2g/gaia/commit/4bf8e171a7ea3397901191a25765432594aaff2c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: