diff --git a/camera/common/1.0/default/CameraMetadata.cpp b/camera/common/1.0/default/CameraMetadata.cpp index eb1bd1c149..1da88ec6e4 100644 --- a/camera/common/1.0/default/CameraMetadata.cpp +++ b/camera/common/1.0/default/CameraMetadata.cpp @@ -275,7 +275,7 @@ status_t CameraMetadata::update(uint32_t tag, 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) { @@ -483,9 +483,9 @@ status_t CameraMetadata::getTagFromName(const char *name, size_t sectionLength = 0; size_t totalSectionCount = ANDROID_SECTION_COUNT + vendorSectionCount; 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(); + const char* str = (i < ANDROID_SECTION_COUNT) + ? camera_metadata_section_names[i] + : (*vendorSections)[i - ANDROID_SECTION_COUNT].c_str(); ALOGV("%s: Trying to match against section '%s'", __FUNCTION__, str); diff --git a/camera/common/1.0/default/CameraParameters.cpp b/camera/common/1.0/default/CameraParameters.cpp index e707b0855a..a31b80742e 100644 --- a/camera/common/1.0/default/CameraParameters.cpp +++ b/camera/common/1.0/default/CameraParameters.cpp @@ -211,7 +211,7 @@ String8 CameraParameters::flatten() const void CameraParameters::unflatten(const String8 ¶ms) { - const char *a = params.string(); + const char* a = params.c_str(); const char *b; mMap.clear(); @@ -277,7 +277,7 @@ 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 @@ -469,7 +469,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()); } } @@ -484,10 +484,10 @@ status_t CameraParameters::dump(int fd, const Vector& /*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; } diff --git a/camera/common/1.0/default/VendorTagDescriptor.cpp b/camera/common/1.0/default/VendorTagDescriptor.cpp index d2bee85daf..ba3fe39df5 100644 --- a/camera/common/1.0/default/VendorTagDescriptor.cpp +++ b/camera/common/1.0/default/VendorTagDescriptor.cpp @@ -100,7 +100,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 { @@ -112,7 +112,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 { @@ -130,13 +130,13 @@ const SortedVector* VendorTagDescriptor::getAllSectionNames() const { status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& section, /*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; } @@ -170,8 +170,8 @@ void VendorTagDescriptor::dump(int fd, int verbosity, int indentation) const { int type = mTagToTypeMap.at(tag); 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()); + dprintf(fd, "%*s0x%x (%s) with type %d (%s) defined in section %s\n", indentation + 2, "", + tag, name.c_str(), type, typeName, sectionName.c_str()); } } diff --git a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp index 7c3b982931..69318c7368 100644 --- a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp +++ b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp @@ -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; diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 339a142251..c8e683c290 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -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 returnStatus = device->setParameters( - cameraParams.flatten().string()); + Return returnStatus = device->setParameters(cameraParams.flatten().c_str()); ASSERT_TRUE(returnStatus.isOk()); ASSERT_EQ(Status::OK, returnStatus); }