diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2011-01-26 14:05:25 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-26 14:05:25 -0800 |
commit | ef6b8ea3f664254958491f48fbe38c502d1129df (patch) | |
tree | 06231f05a310f6ed83255a0af051d429c36d672e | |
parent | 14e362617ceb67f1ae3dd09e0f7744860b5ee066 (diff) | |
parent | 17f1ff8c99dada2cca93f68d434cf64a6dc692c2 (diff) | |
download | hardware_libhardware_legacy-ef6b8ea3f664254958491f48fbe38c502d1129df.zip hardware_libhardware_legacy-ef6b8ea3f664254958491f48fbe38c502d1129df.tar.gz hardware_libhardware_legacy-ef6b8ea3f664254958491f48fbe38c502d1129df.tar.bz2 |
am 17f1ff8c: do not merge bug 3370834 Cherrypick from master CL 79894
* commit '17f1ff8c99dada2cca93f68d434cf64a6dc692c2':
do not merge bug 3370834 Cherrypick from master CL 79894
-rw-r--r-- | include/hardware_legacy/AudioHardwareBase.h | 22 | ||||
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 4 |
2 files changed, 18 insertions, 8 deletions
diff --git a/include/hardware_legacy/AudioHardwareBase.h b/include/hardware_legacy/AudioHardwareBase.h index ae2e3ef..c34135f 100644 --- a/include/hardware_legacy/AudioHardwareBase.h +++ b/include/hardware_legacy/AudioHardwareBase.h @@ -24,8 +24,8 @@ namespace android { // ---------------------------------------------------------------------------- -/** - * AudioHardwareBase is a convenient base class used for implementing the +/** + * AudioHardwareBase is a convenient base class used for implementing the * AudioHardwareInterface interface. */ class AudioHardwareBase : public AudioHardwareInterface @@ -33,24 +33,30 @@ class AudioHardwareBase : public AudioHardwareInterface public: AudioHardwareBase(); virtual ~AudioHardwareBase() { } - + /** * setMode is called when the audio mode changes. NORMAL mode is for - * standard audio playback, RINGTONE when a ringtone is playing, and IN_CALL - * when a call is in progress. + * standard audio playback, RINGTONE when a ringtone is playing, IN_CALL + * when a telephony call is in progress, IN_COMMUNICATION when a VoIP call is in progress. */ virtual status_t setMode(int mode); virtual status_t setParameters(const String8& keyValuePairs); virtual String8 getParameters(const String8& keys); - + virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount); - + /**This method dumps the state of the audio hardware */ virtual status_t dumpState(int fd, const Vector<String16>& args); protected: - int mMode; + /** returns true if the given mode maps to a telephony or VoIP call is in progress */ + virtual bool isModeInCall(int mode) + { return ((mode == AudioSystem::MODE_IN_CALL) + || (mode == AudioSystem::MODE_IN_COMMUNICATION)); }; + /** returns true if a telephony or VoIP call is in progress */ + virtual bool isInCall() { return isModeInCall(mMode); }; + int mMode; }; }; // namespace android diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index 8ffaad9..28b3b07 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -236,6 +236,10 @@ protected: void handleIncallSonification(int stream, bool starting, bool stateChange); // true is current platform implements a back microphone virtual bool hasBackMicrophone() const { return false; } + // 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 + virtual bool isStateInCall(int state); #ifdef WITH_A2DP // true is current platform supports suplication of notifications and ringtones over A2DP output |