diff options
author | Eric Laurent <elaurent@google.com> | 2013-07-18 14:38:44 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-08-19 17:45:42 -0700 |
commit | 46291616486979986cba3ab83e894728ef53063f (patch) | |
tree | 6e725226e68719d0c3c445dc5530bf0392204095 /media/libmedia | |
parent | cf2a123e7ad39700c6e5318006f9acccf69511fa (diff) | |
download | frameworks_av-46291616486979986cba3ab83e894728ef53063f.zip frameworks_av-46291616486979986cba3ab83e894728ef53063f.tar.gz frameworks_av-46291616486979986cba3ab83e894728ef53063f.tar.bz2 |
AudioSystem: new audioflinger restart detection
Add a specific method to AudioSystem for AudioService to poll
for AudioFlinger service restart instead of relying on current
callback mechanism which is flaky.
Bug: 9693068.
Change-Id: Ie88bc9d25033503bc5cd2fa9d8c754d0f8045b8f
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index a571fe4..8033c2c 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -76,6 +76,14 @@ const sp<IAudioFlinger>& AudioSystem::get_audio_flinger() return gAudioFlinger; } +/* static */ status_t AudioSystem::checkAudioFlinger() +{ + if (defaultServiceManager()->checkService(String16("media.audio_flinger")) != 0) { + return NO_ERROR; + } + return DEAD_OBJECT; +} + status_t AudioSystem::muteMicrophone(bool state) { const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == 0) return PERMISSION_DENIED; |