From 764db963fa36b4a272e8c4a77cbe9610404a3b11 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 4 Aug 2009 06:17:43 -0700 Subject: Fix getParameters() default implementation. Do not return empty string but key value pairs with empty values. --- libs/audioflinger/AudioHardwareInterface.cpp | 4 ++-- libs/audioflinger/AudioHardwareStub.cpp | 12 ++++++++++++ libs/audioflinger/AudioHardwareStub.h | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'libs/audioflinger') diff --git a/libs/audioflinger/AudioHardwareInterface.cpp b/libs/audioflinger/AudioHardwareInterface.cpp index 37be329..9a4a7f9 100644 --- a/libs/audioflinger/AudioHardwareInterface.cpp +++ b/libs/audioflinger/AudioHardwareInterface.cpp @@ -140,8 +140,8 @@ status_t AudioHardwareBase::setParameters(const String8& keyValuePairs) // default implementation String8 AudioHardwareBase::getParameters(const String8& keys) { - String8 result = String8(""); - return result; + AudioParameter param = AudioParameter(keys); + return param.toString(); } // default implementation diff --git a/libs/audioflinger/AudioHardwareStub.cpp b/libs/audioflinger/AudioHardwareStub.cpp index 1a03059..ae391ee 100644 --- a/libs/audioflinger/AudioHardwareStub.cpp +++ b/libs/audioflinger/AudioHardwareStub.cpp @@ -152,6 +152,12 @@ status_t AudioStreamOutStub::dump(int fd, const Vector& args) return NO_ERROR; } +String8 AudioStreamOutStub::getParameters(const String8& keys) +{ + AudioParameter param = AudioParameter(keys); + return param.toString(); +} + // ---------------------------------------------------------------------------- status_t AudioStreamInStub::set(int *pFormat, uint32_t *pChannels, uint32_t *pRate, @@ -187,6 +193,12 @@ status_t AudioStreamInStub::dump(int fd, const Vector& args) return NO_ERROR; } +String8 AudioStreamInStub::getParameters(const String8& keys) +{ + AudioParameter param = AudioParameter(keys); + return param.toString(); +} + // ---------------------------------------------------------------------------- }; // namespace android diff --git a/libs/audioflinger/AudioHardwareStub.h b/libs/audioflinger/AudioHardwareStub.h index 8f43259..583f852 100644 --- a/libs/audioflinger/AudioHardwareStub.h +++ b/libs/audioflinger/AudioHardwareStub.h @@ -40,7 +40,7 @@ public: virtual status_t standby(); virtual status_t dump(int fd, const Vector& args); virtual status_t setParameters(const String8& keyValuePairs) { return NO_ERROR;} - virtual String8 getParameters(const String8& keys) {String8 result = String8(""); return result;} + virtual String8 getParameters(const String8& keys); }; class AudioStreamInStub : public AudioStreamIn { @@ -55,7 +55,7 @@ public: virtual status_t dump(int fd, const Vector& args); virtual status_t standby() { return NO_ERROR; } virtual status_t setParameters(const String8& keyValuePairs) { return NO_ERROR;} - virtual String8 getParameters(const String8& keys) {String8 result = String8(""); return result;} + virtual String8 getParameters(const String8& keys); }; class AudioHardwareStub : public AudioHardwareBase -- cgit v1.1