diff options
author | Eric Laurent <elaurent@google.com> | 2009-08-04 06:17:43 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2009-08-04 06:17:43 -0700 |
commit | ab19b21f3c98b259b1f18933f503016965ef779d (patch) | |
tree | 7d0d62d68d80e1fc4a309f2dc69295a38bd43083 | |
parent | cd9e8d49071d10ad2d64530070a5c82fe2f49902 (diff) | |
download | frameworks_base-ab19b21f3c98b259b1f18933f503016965ef779d.zip frameworks_base-ab19b21f3c98b259b1f18933f503016965ef779d.tar.gz frameworks_base-ab19b21f3c98b259b1f18933f503016965ef779d.tar.bz2 |
Fix getParameters() default implementation.
Do not return empty string but key value pairs with empty values.
-rw-r--r-- | libs/audioflinger/AudioHardwareInterface.cpp | 4 | ||||
-rw-r--r-- | libs/audioflinger/AudioHardwareStub.cpp | 12 | ||||
-rw-r--r-- | libs/audioflinger/AudioHardwareStub.h | 4 |
3 files changed, 16 insertions, 4 deletions
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<String16>& 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<String16>& 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<String16>& 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<String16>& 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 |