From 887a9ed4446cb451181c392a0e51a69914e58fbf Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 31 Mar 2015 18:02:24 -0700 Subject: Updates to AudioPolicyManager refactor Use protected access in AudioPolicyManager class for - engine field - querying phone state - isStrategyActive Fix inclusion of AudioPolicyManagerInterface header. Use "APM_" prefix in audio policy conf parsing code to avoid naming conflicts with some HALs. DeviceDescriptor and its collection class are good friends now. Change-Id: I236d62a2b8a4b6bf68dd515932650b912577c145 --- .../audiopolicy/managerdefault/AudioPolicyManager.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'services/audiopolicy/managerdefault/AudioPolicyManager.h') diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h index dcd74f0..02b678a 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.h +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h @@ -27,6 +27,7 @@ #include #include "AudioPolicyInterface.h" +#include #include #include #include @@ -44,8 +45,6 @@ namespace android { -class AudioPolicyManagerInterface; - // ---------------------------------------------------------------------------- // Attenuation applied to STRATEGY_SONIFICATION streams when a headset is connected: 6dB @@ -284,6 +283,9 @@ protected: virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy, bool fromCache); + bool isStrategyActive(const sp outputDesc, routing_strategy strategy, + uint32_t inPastMs = 0, nsecs_t sysTime = 0) const; + // change the route of the specified output. Returns the number of ms we have slept to // allow new routing to take effect in certain cases. virtual uint32_t setOutputDevice(audio_io_handle_t output, @@ -337,6 +339,8 @@ protected: // a special tone in the device used for communication void handleIncallSonification(audio_stream_type_t stream, bool starting, bool stateChange); + audio_mode_t getPhoneState(); + // true if device is in a telephony or VoIP call virtual bool isInCall(); // true if given state represents a device in a telephony or VoIP call @@ -523,6 +527,9 @@ protected: #endif //AUDIO_POLICY_TEST uint32_t nextAudioPortGeneration(); + + // Audio Policy Engine Interface. + AudioPolicyManagerInterface *mEngine; private: // updates device caching and output for streams that can influence the // routing of notifications @@ -566,12 +573,6 @@ private: audio_policy_dev_state_t state, const char *device_address, const char *device_name); - - bool isStrategyActive(const sp outputDesc, routing_strategy strategy, - uint32_t inPastMs = 0, nsecs_t sysTime = 0) const; - - // Audio Policy Engine Interface. - AudioPolicyManagerInterface *mEngine; }; }; -- cgit v1.1