Closed Bug 891746 Opened 12 years ago Closed 12 years ago

[Gaia] Let user select DTMF tone type in CDMA network.

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+)

RESOLVED FIXED
blocking-b2g koi+

People

(Reporter: kchang, Assigned: gsvelto)

References

Details

(Whiteboard: [UX ETA:9/6], [FT:RIL], [Sprint:4])

Attachments

(2 files, 2 obsolete files)

User story said that user should be able to select DTMF tone type (normal vs long), which means that Gecko should provide this kind of interface and Gaia should also provide a interface for user selecting DTMF tone type.
Blocks: 890816
Depends on: 869772
Assignee: nobody → gsvelto
blocking-b2g: --- → koi+
Gecko part is ready. So, Gaia app should be able to control it now.
Whiteboard: [UX ETA:9/6]
Whiteboard: [UX ETA:9/6] → [UX ETA:9/6], [FT:RIL], [Sprint:4]
According to the comment 7 of bug 869772, we should be able to close this bug.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Resolution: FIXED → WONTFIX
We still need to have an UI for this bug. Reopen this bug.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
The idea here is to implement tones as described in bug 869772 comment 3: the user can select between two modes, a long mode in which the tone is played as long as a dialer key is pressed and a short mode in which the tone is played for only 120ms irrespective of how long the key is pressed. The only thing I'm missing here is where to put the option for choosing between the two. Would the "Call Settings" panel in the settings app do? I assume that the option should be visible only when a CDMA network is detected and hidden otherwise (and its value ignored by the dialer).
Depends on: 914152
Gabriele, the setting name is "phone.dtmf.type". In the end I use explicit strings as the value as you suggested. The values are `short` and `long`. The patch that adds the setting is ready for review. Let me know if you encounter any problem, thanks!
(In reply to Arthur Chen [:arthurcc] from comment #6) > Gabriele, the setting name is "phone.dtmf.type". In the end I use explicit > strings as the value as you suggested. The values are `short` and `long`. > The patch that adds the setting is ready for review. Let me know if you > encounter any problem, thanks! Great, thanks!
This is a tentative patch to support short dialtones when the relevant preference is enabled. The approach I've taken is to adjust all timers so that they stop playing the dialtone after 120ms instead of the specified length. Unfortunately I'm not sure how to test this and verify that it's working properly :-( Writing unit-tests for this seems similarly challenging considering we don't seem to have the DTMF functionality covered already.
Attachment #803040 - Flags: feedback?(etienne)
Pointer to Github pull-request
Attachment #803041 - Attachment description: Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/12122 → [PULL REQUEST] Support short DTMF tones
Comment on attachment 803040 [details] [diff] [review] [PATCH WIP] Support short DTMF tones Review of attachment 803040 [details] [diff] [review]: ----------------------------------------------------------------- I'm not sure about the UX here. Should we override the duration of the key press altogether in CDMA mode and just do the standardized short or long duration? (we might want to store the standard durations directly in the settings) Should we honor the key press duration if it's higher than a certain threshold and to the standard otherwise? Should we just use the standardized long or short duration as a minimum duration? as a maximum? ::: apps/communications/dialer/js/keypad.js @@ +178,5 @@ > + > + settings.addObserver(this._DTMF_TONE_LENGTH_KEY, (function(v) { > + this._dtmfShortTone = v.settingValue == 'short'; > + }).bind(this)); > + } you're going to love the SettingsListener helper :) https://github.com/mozilla-b2g/gaia/blob/master/shared/js/settings_listener.js
Attachment #803040 - Flags: feedback?(etienne)
Also the final patch here will probably need the settings UI too.
Flags: needinfo?(kchang)
(In reply to Etienne Segonzac (:etienne) from comment #10) > Comment on attachment 803040 [details] [diff] [review] > [PATCH WIP] Support short DTMF tones > > Review of attachment 803040 [details] [diff] [review]: > ----------------------------------------------------------------- > > I'm not sure about the UX here. Here is the UX. If user selects short DTMF, that means that no matter how long user presses the key, there is only a DTMF with 120ms. If user selects long DTMF, that means the DTMF will keep generating until user releases the key.
Flags: needinfo?(kchang)
(In reply to Etienne Segonzac (:etienne) from comment #11) > Also the final patch here will probably need the settings UI too. Settings are being handled in bug 914152. (In reply to Ken Chang from comment #13) > If user selects short DTMF, that means that no matter how long user presses > the key, there is only a DTMF with 120ms. > If user selects long DTMF, that means the DTMF will keep generating until > user releases the key. OK, my changes should do then. What I did is to leave the current behavior unchanged in long mode and switch to 120ms bursts in short mode for all tones. Updated patch coming soon.
Attached patch [PATCH] Support short DTMF tones (obsolete) — Splinter Review
This uses the SettingsListener and blends in better with the existing code. I still don't know how to test this though, Ken do you know if somebody in Taiwan could check if this is working properly? BTW I've changed only the actual DTMF tones, not the audible ones. Ken should the audible tones be changed too?
Attachment #803040 - Attachment is obsolete: true
Flags: needinfo?(kchang)
(In reply to Gabriele Svelto [:gsvelto] from comment #15) > Created attachment 803578 [details] [diff] [review] > [PATCH] Support short DTMF tones > > This uses the SettingsListener and blends in better with the existing code. > I still don't know how to test this though, Ken do you know if somebody in > Taiwan could check if this is working properly? Oops! I don't think carrier will help us to check the duration of the DTMF. I suggest verifying it in GSM emulator. > > BTW I've changed only the actual DTMF tones, not the audible ones. Ken > should the audible tones be changed too? Yes.....
Flags: needinfo?(kchang)
(In reply to Ken Chang from comment #16) > (In reply to Gabriele Svelto [:gsvelto] from comment #15) > > Created attachment 803578 [details] [diff] [review] > > [PATCH] Support short DTMF tones > > > > This uses the SettingsListener and blends in better with the existing code. > > I still don't know how to test this though, Ken do you know if somebody in > > Taiwan could check if this is working properly? > Oops! I don't think carrier will help us to check the duration of the DTMF. > I suggest verifying it in GSM emulator. I don't think we have a good method for integration verification now. We will verify this when we have CDMA partner. So just make sure your app works as you want for now.
This is an updated patch and I can confirm it works correctly as I've managed to test it. What I did was enable unconditionally the tones and added timers around them to measure for how long they would play. In long mode the tones play as before and in short mode I can measure ~120ms bursts so everything should be working alright. I think a similar approach might be used to cover this functionality with unit-tests; not by measuring the time of the various events but by intercepting the values passed in the stop-timeouts and comparing them with what we excpect.
Attachment #803578 - Attachment is obsolete: true
Attachment #803742 - Flags: review?(etienne)
So don't we need some changes in the settings app too to fix this bug?
(In reply to Etienne Segonzac (:etienne) from comment #19) > So don't we need some changes in the settings app too to fix this bug? Yup, they already landed in bug 914152.
Comment on attachment 803742 [details] [diff] [review] [PATCH v2] Support short DTMF tones Review of attachment 803742 [details] [diff] [review]: ----------------------------------------------------------------- r=me Not pushing for unit tests since we know this is going to be re-written with WebAudio in the near future.
Attachment #803742 - Flags: review?(etienne) → review+
Status: REOPENED → RESOLVED
Closed: 12 years ago12 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: