ToneGenerator: fix truncated tones

The first DTMF tone after a silent period is truncated.
This is because the phone app starts and stops the tone
when the user presses and releases the key.
This combined to the fact that the tones use the low latency path
and that when the output stream exists standby there is a period
of several milliseconds during which no audio is mixed until the
stream is "warmed up".
The result is that much less audio is generated than the actual
key press duration.

The fix consists in storing the tone start time and making sure that
the number of samples generated corresponds at least to the time difference
between the tone start and stop commands.

Bug 6607077

Change-Id: I070d20dd8600c25a9e5d5a60c1d3313b7917b00d
2 files changed