summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/AudioHardwareBase.h
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2010-11-15 16:02:06 -0800
committerJean-Michel Trivi <jmtrivi@google.com>2010-11-15 16:45:36 -0800
commit3e480fa067136253ae05faaba77f814f42cd56f0 (patch)
treebf59fea9dee704e999b5d1be8e6ba624b4d15075 /include/hardware_legacy/AudioHardwareBase.h
parent7314fe03b6cc7c16d49aacbe59840d8724f6852e (diff)
downloadhardware_libhardware_legacy-3e480fa067136253ae05faaba77f814f42cd56f0.zip
hardware_libhardware_legacy-3e480fa067136253ae05faaba77f814f42cd56f0.tar.gz
hardware_libhardware_legacy-3e480fa067136253ae05faaba77f814f42cd56f0.tar.bz2
Support new audio mode for audio communication other than telephony.
Change-Id: I965cbeee67f72e31240e3e8cd2630bf22a03b9ea
Diffstat (limited to 'include/hardware_legacy/AudioHardwareBase.h')
-rw-r--r--include/hardware_legacy/AudioHardwareBase.h22
1 files changed, 14 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