summaryrefslogtreecommitdiffstats
path: root/camera/VendorTagDescriptor.cpp
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-05-12 10:33:51 -0700
committerZhijun He <zhijunhe@google.com>2014-05-12 12:06:50 -0700
commit9181b9f4bb53af203c090eff6d1af67d1f7c8770 (patch)
tree52880a0efb8608a9ceb7649bc281e14b9a510a4f /camera/VendorTagDescriptor.cpp
parent5e4c4f12337ff4d7ceb105bcd441bb7aea6ab070 (diff)
downloadframeworks_av-9181b9f4bb53af203c090eff6d1af67d1f7c8770.zip
frameworks_av-9181b9f4bb53af203c090eff6d1af67d1f7c8770.tar.gz
frameworks_av-9181b9f4bb53af203c090eff6d1af67d1f7c8770.tar.bz2
Camera: Don't enable log spew by default for eng build
Also replace assert with LOG_ALWAYS_FATAL_IF. Change-Id: I528b97d9bc7a93dc3575ded28f6bf7e294d0a1e6
Diffstat (limited to 'camera/VendorTagDescriptor.cpp')
-rw-r--r--camera/VendorTagDescriptor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp
index ba24fcb..59dce91 100644
--- a/camera/VendorTagDescriptor.cpp
+++ b/camera/VendorTagDescriptor.cpp
@@ -120,7 +120,7 @@ status_t VendorTagDescriptor::createDescriptorFromOps(const vendor_tag_ops_t* vO
// Set up tag to section index map
ssize_t index = sections.indexOf(sectionString);
- assert(index >= 0);
+ LOG_ALWAYS_FATAL_IF(index < 0, "index %zd must be non-negative", index);
desc->mTagToSectionMap.add(tag, static_cast<uint32_t>(index));
// Set up reverse mapping
@@ -217,7 +217,8 @@ status_t VendorTagDescriptor::createFromParcel(const Parcel* parcel,
__FUNCTION__, sectionCount, (maxSectionIndex + 1));
return BAD_VALUE;
}
- assert(desc->mSections.setCapacity(sectionCount) > 0);
+ LOG_ALWAYS_FATAL_IF(desc->mSections.setCapacity(sectionCount) <= 0,
+ "Vector capacity must be positive");
for (size_t i = 0; i < sectionCount; ++i) {
String8 sectionName = parcel->readString8();
if (sectionName.isEmpty()) {
@@ -228,7 +229,7 @@ status_t VendorTagDescriptor::createFromParcel(const Parcel* parcel,
}
}
- assert(tagCount == allTags.size());
+ LOG_ALWAYS_FATAL_IF(tagCount != allTags.size(), "tagCount must be the same as allTags size");
// Set up reverse mapping
for (size_t i = 0; i < static_cast<size_t>(tagCount); ++i) {
uint32_t tag = allTags[i];