Use String8/16 c_str (mainline modules)
Bug: 295394788
Test: make checkbuild
Change-Id: Ia266bccfc9100da25d8605d93c1298a341d2b11a
diff --git a/media/module/foundation/ALooperRoster.cpp b/media/module/foundation/ALooperRoster.cpp
index 4334f1e..451725d 100644
--- a/media/module/foundation/ALooperRoster.cpp
+++ b/media/module/foundation/ALooperRoster.cpp
@@ -168,7 +168,7 @@
}
s.append("\n");
}
- (void)write(fd, s.string(), s.size());
+ (void)write(fd, s.c_str(), s.size());
}
} // namespace android
diff --git a/media/module/foundation/AString.cpp b/media/module/foundation/AString.cpp
index a5e0ff8..2f8011d 100644
--- a/media/module/foundation/AString.cpp
+++ b/media/module/foundation/AString.cpp
@@ -70,7 +70,7 @@
: mData(NULL),
mSize(0),
mAllocSize(1) {
- setTo(from.string(), from.length());
+ setTo(from.c_str(), from.length());
}
AString::AString(const AString &from)
diff --git a/media/module/foundation/MetaDataBase.cpp b/media/module/foundation/MetaDataBase.cpp
index 3370748..da383fa 100644
--- a/media/module/foundation/MetaDataBase.cpp
+++ b/media/module/foundation/MetaDataBase.cpp
@@ -434,7 +434,7 @@
char cc[5];
MakeFourCCString(key, cc);
const typed_data &item = mInternalData->mItems.valueAt(i);
- s.appendFormat("%s: %s", cc, item.asString(false).string());
+ s.appendFormat("%s: %s", cc, item.asString(false).c_str());
if (i != 0) {
s.append(", ");
}
@@ -448,7 +448,7 @@
char cc[5];
MakeFourCCString(key, cc);
const typed_data &item = mInternalData->mItems.valueAt(i);
- ALOGI("%s: %s", cc, item.asString(true /* verbose */).string());
+ ALOGI("%s: %s", cc, item.asString(true /* verbose */).c_str());
}
}
diff --git a/media/module/foundation/tests/Base64_test.cpp b/media/module/foundation/tests/Base64_test.cpp
index 7a4289e..a3f93d9 100644
--- a/media/module/foundation/tests/Base64_test.cpp
+++ b/media/module/foundation/tests/Base64_test.cpp
@@ -49,7 +49,7 @@
paddedText.append(kBase64Padding);
}
}
- sp<ABuffer> result = decodeBase64(AString(paddedText.string()));
+ sp<ABuffer> result = decodeBase64(AString(paddedText.c_str()));
ASSERT_EQ(AStringUtils::Compare(expected[i].c_str(),
reinterpret_cast<char*>(result->data()),