From 9181b9f4bb53af203c090eff6d1af67d1f7c8770 Mon Sep 17 00:00:00 2001 From: Zhijun He Date: Mon, 12 May 2014 10:33:51 -0700 Subject: Camera: Don't enable log spew by default for eng build Also replace assert with LOG_ALWAYS_FATAL_IF. Change-Id: I528b97d9bc7a93dc3575ded28f6bf7e294d0a1e6 --- camera/Android.mk | 5 ----- camera/VendorTagDescriptor.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'camera') diff --git a/camera/Android.mk b/camera/Android.mk index 18800b4..5774b6f 100644 --- a/camera/Android.mk +++ b/camera/Android.mk @@ -52,11 +52,6 @@ LOCAL_C_INCLUDES += \ system/media/camera/include \ system/media/private/camera/include -## Enable asserts for 'eng' builds -ifeq ($(TARGET_BUILD_VARIANT),eng) -LOCAL_CFLAGS += -UNDEBUG -endif - LOCAL_MODULE:= libcamera_client include $(BUILD_SHARED_LIBRARY) 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(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(tagCount); ++i) { uint32_t tag = allTags[i]; -- cgit v1.1