summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
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