Migrate broadcast radio default HAL to the new logging API.
Bug: 112540729
Test: flash and boot
Change-Id: I18d8b508971cd9a9b7b2c9c221674d862ff351d6
diff --git a/broadcastradio/common/utils/Android.bp b/broadcastradio/common/utils/Android.bp
index 33ba7da..32e06d7 100644
--- a/broadcastradio/common/utils/Android.bp
+++ b/broadcastradio/common/utils/Android.bp
@@ -29,7 +29,6 @@
export_include_dirs: ["include"],
shared_libs: [
"libbase",
- "liblog",
"libutils",
],
}
diff --git a/broadcastradio/common/utils/WorkerThread.cpp b/broadcastradio/common/utils/WorkerThread.cpp
index bfcbb39..31f4d3f 100644
--- a/broadcastradio/common/utils/WorkerThread.cpp
+++ b/broadcastradio/common/utils/WorkerThread.cpp
@@ -14,13 +14,8 @@
* limitations under the License.
*/
-#define LOG_TAG "WorkerThread"
-//#define LOG_NDEBUG 0
-
#include <broadcastradio-utils/WorkerThread.h>
-#include <log/log.h>
-
namespace android {
using std::chrono::milliseconds;
@@ -39,7 +34,6 @@
WorkerThread::WorkerThread() : mIsTerminating(false), mThread(&WorkerThread::threadLoop, this) {}
WorkerThread::~WorkerThread() {
- ALOGV("%s", __func__);
{
lock_guard<mutex> lk(mMut);
mIsTerminating = true;
@@ -49,8 +43,6 @@
}
void WorkerThread::schedule(function<void()> task, milliseconds delay) {
- ALOGV("%s", __func__);
-
auto when = steady_clock::now() + delay;
lock_guard<mutex> lk(mMut);
@@ -59,14 +51,11 @@
}
void WorkerThread::cancelAll() {
- ALOGV("%s", __func__);
-
lock_guard<mutex> lk(mMut);
priority_queue<Task>().swap(mTasks); // empty queue
}
void WorkerThread::threadLoop() {
- ALOGV("%s", __func__);
while (!mIsTerminating) {
unique_lock<mutex> lk(mMut);
if (mTasks.empty()) {
diff --git a/broadcastradio/common/utils2x/Utils.cpp b/broadcastradio/common/utils2x/Utils.cpp
index f292c08..7892653 100644
--- a/broadcastradio/common/utils2x/Utils.cpp
+++ b/broadcastradio/common/utils2x/Utils.cpp
@@ -14,12 +14,10 @@
* limitations under the License.
*/
#define LOG_TAG "BcRadioDef.utils"
-//#define LOG_NDEBUG 0
#include <broadcastradio-utils-2x/Utils.h>
#include <android-base/logging.h>
-#include <log/log.h>
namespace android {
namespace hardware {
@@ -130,7 +128,7 @@
case IdentifierType::SXM_SERVICE_ID:
return haveEqualIds(a, b, IdentifierType::SXM_SERVICE_ID);
default: // includes all vendor types
- ALOGW("Unsupported program type: %s", toString(type).c_str());
+ LOG(WARNING) << "unsupported program type: " << toString(type);
return false;
}
}
@@ -166,7 +164,7 @@
return val;
}
- ALOGW("Identifier %s not found", toString(type).c_str());
+ LOG(WARNING) << "identifier not found: " << toString(type);
return 0;
}
@@ -205,7 +203,7 @@
auto expect = [&valid](bool condition, std::string message) {
if (!condition) {
valid = false;
- ALOGE("Identifier not valid, expected %s", message.c_str());
+ LOG(ERROR) << "identifier not valid, expected " << message;
}
};
diff --git a/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h b/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
index 1f716f1..f6cd6ae 100644
--- a/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
+++ b/broadcastradio/common/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
@@ -29,7 +29,7 @@
* INTERNAL IMPLEMENTATION - don't use in user code.
*/
#if EGMOCK_VERBOSE
-#define EGMOCK_LOG_(...) ALOGV("egmock: " __VA_ARGS__)
+#define EGMOCK_LOG_(...) LOG(VERBOSE) << "egmock: " << __VA_ARGS__
#else
#define EGMOCK_LOG_(...)
#endif