From b19fe0c95b0f5d15168a0e0bac0cd5eba0890050 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 11 Aug 2023 00:06:51 +0000 Subject: Use String8/16 c_str [graphics] Bug: 295394788 Test: make checkbuild Change-Id: I69aa06b109c2f40ecf40441cbbb0dfa3e1aa99a1 --- libs/gui/ConsumerBase.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'libs/gui/ConsumerBase.cpp') diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp index 9f91d9d3aa..b625c3f75e 100644 --- a/libs/gui/ConsumerBase.cpp +++ b/libs/gui/ConsumerBase.cpp @@ -41,11 +41,11 @@ #include // Macros for including the ConsumerBase name in log messages -#define CB_LOGV(x, ...) ALOGV("[%s] " x, mName.string(), ##__VA_ARGS__) -//#define CB_LOGD(x, ...) ALOGD("[%s] " x, mName.string(), ##__VA_ARGS__) -//#define CB_LOGI(x, ...) ALOGI("[%s] " x, mName.string(), ##__VA_ARGS__) -//#define CB_LOGW(x, ...) ALOGW("[%s] " x, mName.string(), ##__VA_ARGS__) -#define CB_LOGE(x, ...) ALOGE("[%s] " x, mName.string(), ##__VA_ARGS__) +#define CB_LOGV(x, ...) ALOGV("[%s] " x, mName.c_str(), ##__VA_ARGS__) +// #define CB_LOGD(x, ...) ALOGD("[%s] " x, mName.c_str(), ##__VA_ARGS__) +// #define CB_LOGI(x, ...) ALOGI("[%s] " x, mName.c_str(), ##__VA_ARGS__) +// #define CB_LOGW(x, ...) ALOGW("[%s] " x, mName.c_str(), ##__VA_ARGS__) +#define CB_LOGE(x, ...) ALOGE("[%s] " x, mName.c_str(), ##__VA_ARGS__) namespace android { @@ -86,8 +86,10 @@ ConsumerBase::~ConsumerBase() { // be done by ConsumerBase::onLastStrongRef(), but it's possible for a // derived class to override that method and not call // ConsumerBase::onLastStrongRef(). - LOG_ALWAYS_FATAL_IF(!mAbandoned, "[%s] ~ConsumerBase was called, but the " - "consumer is not abandoned!", mName.string()); + LOG_ALWAYS_FATAL_IF(!mAbandoned, + "[%s] ~ConsumerBase was called, but the " + "consumer is not abandoned!", + mName.c_str()); } void ConsumerBase::onLastStrongRef(const void* id __attribute__((unused))) { @@ -451,7 +453,7 @@ status_t ConsumerBase::addReleaseFenceLocked(int slot, // them to get an accurate timestamp. if (currentStatus == incomingStatus) { char fenceName[32] = {}; - snprintf(fenceName, 32, "%.28s:%d", mName.string(), slot); + snprintf(fenceName, 32, "%.28s:%d", mName.c_str(), slot); sp mergedFence = Fence::merge( fenceName, mSlots[slot].mFence, fence); if (!mergedFence.get()) { -- cgit v1.2.3-59-g8ed1b