OSDN Git Service

Fix issue 4673378: switching from VoIP to GSM call
authorEric Laurent <elaurent@google.com>
Thu, 8 Sep 2011 22:04:23 +0000 (15:04 -0700)
committerEric Laurent <elaurent@google.com>
Fri, 9 Sep 2011 02:23:56 +0000 (19:23 -0700)
commit9f103de83f2d5d472960dcf1401e95b2ab57a477
treecf010908fb2dce19bfa8ab89b53468dc500bc2be
parent6a39c0201ca72d6ccbc63e5fec75949a08fcb043
Fix issue 4673378: switching from VoIP to GSM call

The problem is that any app can change the audio mode and override
a mode previously set by another app. If two apps (gTalk and Phone) compete
for audio mode ownership, there is no mechanism to maintain coherency
in the actual audio mode selected.

Added a mechanism in AudioService to manage an audio mode request stack.
Any app requesting a mode different from NORMAL enters at the top of the stack
and the requested mode is applied. When an app sets mode back to NORMAL, it exits
the stack and the new mode corresponding to the request at the top of the
stack (if any) is applied.

Change-Id: I68d1755d0922f680df4a19bfc5ab924f5a5d8ccd
media/java/android/media/AudioService.java