AudioParameter: add functions for working with parameter keys
Added functions that are helpful for building parameter query
strings to be used with HAL's 'get_parameter' methods.
Test: make
Change-Id: I66a4e94d65660b04ded4abb59a89d8288056a920
diff --git a/include/media/AudioParameter.h b/include/media/AudioParameter.h
index 63c4d6c..9719efa 100644
--- a/include/media/AudioParameter.h
+++ b/include/media/AudioParameter.h
@@ -75,10 +75,12 @@
static const char * const valueListSeparator;
- String8 toString() const;
+ String8 toString() const { return toStringImpl(true); }
+ String8 keysToString() const { return toStringImpl(false); }
status_t add(const String8& key, const String8& value);
status_t addInt(const String8& key, const int value);
+ status_t addKey(const String8& key);
status_t addFloat(const String8& key, const float value);
status_t remove(const String8& key);
@@ -93,6 +95,8 @@
private:
String8 mKeyValuePairs;
KeyedVector <String8, String8> mParameters;
+
+ String8 toStringImpl(bool useValues) const;
};
}; // namespace android