Don't use String8::empty
With the current definition, it's an alias of default constructor. This
has very different meaning from std::string empty, especially that
static method String8::empty can still be called from instance context.
One of such bugs are present in in ConversionHelperAidl.
Bug: 295394788
Test: make checkbuild
Change-Id: Ic466986bdf850a44c30c919450fd8b92ac68758d
diff --git a/media/libaudiohal/impl/ConversionHelperAidl.cpp b/media/libaudiohal/impl/ConversionHelperAidl.cpp
index 7197bf2..46abfda 100644
--- a/media/libaudiohal/impl/ConversionHelperAidl.cpp
+++ b/media/libaudiohal/impl/ConversionHelperAidl.cpp
@@ -69,7 +69,7 @@
// Re-parse the vendor-provided string to ensure that it is correct.
AudioParameter reparse(String8(vendorParameters.c_str()));
if (reparse.size() != 0) {
- if (!values->empty()) {
+ if (values->length() > 0) {
values->append(";");
}
values->append(reparse.toString().c_str());