Check and try to recreate the handle if the handle is invalid
- Issue:
Sometimes, the handle creation for audio framework is failed, but the
stt framework try to use this invalid handle.
- Solution:
The AudioStream class did not set nullptr to audio handles. Because of
this behavior, if the handle was not created from the audio framework,
the AudioStream class tried to use garbage pointer as audio handle. This
caused some crashes. To solve this issue, this patch makes the
AudioStream class initialize the audio handle as nullptr. And also, this
patch adds new code for re-creating audio handles of AudioStream and
BackgroundVolume class. This new code is going to be invoked when some
audio handles are not valid.
Change-Id: I7c98473bf9ced056e4a6dfd579455e94db0b9993
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>