summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-09-26 23:08:07 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-26 23:08:07 +0000
commit0d5653fa4e66f884ec9f036abe3b9dbdf6ed3084 (patch)
tree68f731dfa0e27b08620fd0e962e3a4c7b1d19e68 /services
parenteaab20484de47a3ac8f69636496c371c0ec09fb3 (diff)
parent504de531a08facd130fa00f64fdc00521a975175 (diff)
downloadframeworks_av-0d5653fa4e66f884ec9f036abe3b9dbdf6ed3084.zip
frameworks_av-0d5653fa4e66f884ec9f036abe3b9dbdf6ed3084.tar.gz
frameworks_av-0d5653fa4e66f884ec9f036abe3b9dbdf6ed3084.tar.bz2
am 504de531: Merge "audio: fix stream type for accessibility usage" into lmp-dev
* commit '504de531a08facd130fa00f64fdc00521a975175': audio: fix stream type for accessibility usage
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyInterfaceImpl.cpp7
-rw-r--r--services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp7
-rw-r--r--services/audiopolicy/AudioPolicyService.cpp2
-rw-r--r--services/audiopolicy/AudioPolicyService.h3
4 files changed, 18 insertions, 1 deletions
diff --git a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
index 2c51e25..b212ca6 100644
--- a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
@@ -80,9 +80,16 @@ status_t AudioPolicyService::setPhoneState(audio_mode_t state)
Mutex::Autolock _l(mLock);
mAudioPolicyManager->setPhoneState(state);
+ mPhoneState = state;
return NO_ERROR;
}
+audio_mode_t AudioPolicyService::getPhoneState()
+{
+ Mutex::Autolock _l(mLock);
+ return mPhoneState;
+}
+
status_t AudioPolicyService::setForceUse(audio_policy_force_use_t usage,
audio_policy_forced_cfg_t config)
{
diff --git a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp b/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp
index f20c070..1e40bc3 100644
--- a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp
+++ b/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp
@@ -84,9 +84,16 @@ status_t AudioPolicyService::setPhoneState(audio_mode_t state)
Mutex::Autolock _l(mLock);
mpAudioPolicy->set_phone_state(mpAudioPolicy, state);
+ mPhoneState = state;
return NO_ERROR;
}
+audio_mode_t AudioPolicyService::getPhoneState()
+{
+ Mutex::Autolock _l(mLock);
+ return mPhoneState;
+}
+
status_t AudioPolicyService::setForceUse(audio_policy_force_use_t usage,
audio_policy_forced_cfg_t config)
{
diff --git a/services/audiopolicy/AudioPolicyService.cpp b/services/audiopolicy/AudioPolicyService.cpp
index 50bb8c7..647cda4 100644
--- a/services/audiopolicy/AudioPolicyService.cpp
+++ b/services/audiopolicy/AudioPolicyService.cpp
@@ -59,7 +59,7 @@ namespace {
AudioPolicyService::AudioPolicyService()
: BnAudioPolicyService(), mpAudioPolicyDev(NULL), mpAudioPolicy(NULL),
- mAudioPolicyManager(NULL), mAudioPolicyClient(NULL)
+ mAudioPolicyManager(NULL), mAudioPolicyClient(NULL), mPhoneState(AUDIO_MODE_INVALID)
{
char value[PROPERTY_VALUE_MAX];
const struct hw_module_t *module;
diff --git a/services/audiopolicy/AudioPolicyService.h b/services/audiopolicy/AudioPolicyService.h
index 0044e7a..2cea40b 100644
--- a/services/audiopolicy/AudioPolicyService.h
+++ b/services/audiopolicy/AudioPolicyService.h
@@ -174,6 +174,8 @@ public:
virtual status_t releaseSoundTriggerSession(audio_session_t session);
+ virtual audio_mode_t getPhoneState();
+
status_t doStopOutput(audio_io_handle_t output,
audio_stream_type_t stream,
int session = 0);
@@ -493,6 +495,7 @@ private:
// Manage all effects configured in audio_effects.conf
sp<AudioPolicyEffects> mAudioPolicyEffects;
+ audio_mode_t mPhoneState;
};
}; // namespace android