mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Use String8/16 c_str [camera]" into udc-dev-plus-aosp am: f9da01134b am: b2e932d474
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/24528988 Change-Id: I62537c37fa768e328f18c3ce2e64e0e760db0a43 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -258,7 +258,7 @@ status_t CameraMetadata::update(uint32_t tag, const String8& string) {
|
||||
return res;
|
||||
}
|
||||
// string.size() doesn't count the null termination character.
|
||||
return updateImpl(tag, (const void*)string.string(), string.size() + 1);
|
||||
return updateImpl(tag, (const void*)string.c_str(), string.size() + 1);
|
||||
}
|
||||
|
||||
status_t CameraMetadata::update(const camera_metadata_ro_entry& entry) {
|
||||
@@ -455,7 +455,7 @@ status_t CameraMetadata::getTagFromName(const char* name, const VendorTagDescrip
|
||||
for (size_t i = 0; i < totalSectionCount; ++i) {
|
||||
const char* str = (i < ANDROID_SECTION_COUNT)
|
||||
? camera_metadata_section_names[i]
|
||||
: (*vendorSections)[i - ANDROID_SECTION_COUNT].string();
|
||||
: (*vendorSections)[i - ANDROID_SECTION_COUNT].c_str();
|
||||
|
||||
ALOGV("%s: Trying to match against section '%s'", __FUNCTION__, str);
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ String8 CameraParameters::flatten() const {
|
||||
}
|
||||
|
||||
void CameraParameters::unflatten(const String8& params) {
|
||||
const char* a = params.string();
|
||||
const char* a = params.c_str();
|
||||
const char* b;
|
||||
|
||||
mMap.clear();
|
||||
@@ -263,7 +263,7 @@ void CameraParameters::setFloat(const char* key, float value) {
|
||||
const char* CameraParameters::get(const char* key) const {
|
||||
String8 v = mMap.valueFor(String8(key));
|
||||
if (v.length() == 0) return 0;
|
||||
return v.string();
|
||||
return v.c_str();
|
||||
}
|
||||
|
||||
int CameraParameters::getInt(const char* key) const {
|
||||
@@ -429,7 +429,7 @@ void CameraParameters::dump() const {
|
||||
String8 k, v;
|
||||
k = mMap.keyAt(i);
|
||||
v = mMap.valueAt(i);
|
||||
ALOGD("%s: %s\n", k.string(), v.string());
|
||||
ALOGD("%s: %s\n", k.c_str(), v.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,10 +443,10 @@ status_t CameraParameters::dump(int fd, const Vector<String16>& /*args*/) const
|
||||
String8 k, v;
|
||||
k = mMap.keyAt(i);
|
||||
v = mMap.valueAt(i);
|
||||
snprintf(buffer, 255, "\t%s: %s\n", k.string(), v.string());
|
||||
snprintf(buffer, 255, "\t%s: %s\n", k.c_str(), v.c_str());
|
||||
result.append(buffer);
|
||||
}
|
||||
write(fd, result.string(), result.size());
|
||||
write(fd, result.c_str(), result.size());
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ const char* VendorTagDescriptor::getSectionName(uint32_t tag) const {
|
||||
if (index < 0) {
|
||||
return VENDOR_SECTION_NAME_ERR;
|
||||
}
|
||||
return mSections[mTagToSectionMap.valueAt(index)].string();
|
||||
return mSections[mTagToSectionMap.valueAt(index)].c_str();
|
||||
}
|
||||
|
||||
ssize_t VendorTagDescriptor::getSectionIndex(uint32_t tag) const {
|
||||
@@ -109,7 +109,7 @@ const char* VendorTagDescriptor::getTagName(uint32_t tag) const {
|
||||
if (index < 0) {
|
||||
return VENDOR_TAG_NAME_ERR;
|
||||
}
|
||||
return mTagToNameMap.valueAt(index).string();
|
||||
return mTagToNameMap.valueAt(index).c_str();
|
||||
}
|
||||
|
||||
int VendorTagDescriptor::getTagType(uint32_t tag) const {
|
||||
@@ -128,13 +128,13 @@ status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& sect
|
||||
/*out*/ uint32_t* tag) const {
|
||||
ssize_t index = mReverseMapping.indexOfKey(section);
|
||||
if (index < 0) {
|
||||
ALOGE("%s: Section '%s' does not exist.", __FUNCTION__, section.string());
|
||||
ALOGE("%s: Section '%s' does not exist.", __FUNCTION__, section.c_str());
|
||||
return BAD_VALUE;
|
||||
}
|
||||
|
||||
ssize_t nameIndex = mReverseMapping[index]->indexOfKey(name);
|
||||
if (nameIndex < 0) {
|
||||
ALOGE("%s: Tag name '%s' does not exist.", __FUNCTION__, name.string());
|
||||
ALOGE("%s: Tag name '%s' does not exist.", __FUNCTION__, name.c_str());
|
||||
return BAD_VALUE;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ void VendorTagDescriptor::dump(int fd, int verbosity, int indentation) const {
|
||||
const char* typeName =
|
||||
(type >= 0 && type < NUM_TYPES) ? camera_metadata_type_names[type] : "UNKNOWN";
|
||||
dprintf(fd, "%*s0x%x (%s) with type %d (%s) defined in section %s\n", indentation + 2, "",
|
||||
tag, name.string(), type, typeName, sectionName.string());
|
||||
tag, name.c_str(), type, typeName, sectionName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ bool LegacyCameraProviderImpl_2_4::setUpVendorTags() {
|
||||
}
|
||||
mVendorTagSections.resize(numSections);
|
||||
for (size_t s = 0; s < numSections; s++) {
|
||||
mVendorTagSections[s].sectionName = (*sectionNames)[s].string();
|
||||
mVendorTagSections[s].sectionName = (*sectionNames)[s].c_str();
|
||||
mVendorTagSections[s].tags = tagsBySection[s];
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace {
|
||||
std::string* deviceVersion, std::string* cameraId) {
|
||||
::android::String8 pattern;
|
||||
pattern.appendFormat(kDeviceNameRE, providerType.c_str());
|
||||
std::regex e(pattern.string());
|
||||
std::regex e(pattern.c_str());
|
||||
std::string deviceNameStd(deviceName.c_str());
|
||||
std::smatch sm;
|
||||
if (std::regex_match(deviceNameStd, sm, e)) {
|
||||
@@ -8801,8 +8801,7 @@ void CameraHidlTest::getParameters(
|
||||
void CameraHidlTest::setParameters(
|
||||
const sp<::android::hardware::camera::device::V1_0::ICameraDevice> &device,
|
||||
const CameraParameters &cameraParams) {
|
||||
Return<Status> returnStatus = device->setParameters(
|
||||
cameraParams.flatten().string());
|
||||
Return<Status> returnStatus = device->setParameters(cameraParams.flatten().c_str());
|
||||
ASSERT_TRUE(returnStatus.isOk());
|
||||
ASSERT_EQ(Status::OK, returnStatus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user