Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF)  DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: Ib3eab0b780391f9a0ac9b53282616d66a0154ade
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 738eda5..4c11a15 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -92,11 +92,11 @@
     #define startRequest           sprintf(printBuf, "(")
     #define closeRequest           sprintf(printBuf, "%s)", printBuf)
     #define printRequest(token, req)           \
-            LOGD("[%04d]> %s %s", token, requestToString(req), printBuf)
+            ALOGD("[%04d]> %s %s", token, requestToString(req), printBuf)
 
     #define startResponse           sprintf(printBuf, "%s {", printBuf)
     #define closeResponse           sprintf(printBuf, "%s}", printBuf)
-    #define printResponse           LOGD("%s", printBuf)
+    #define printResponse           ALOGD("%s", printBuf)
 
     #define clearPrintBuf           printBuf[0] = 0
     #define removeLastChar          printBuf[strlen(printBuf)-1] = 0
@@ -337,7 +337,7 @@
     ret = pthread_mutex_unlock(&s_pendingRequestsMutex);
     assert (ret == 0);
 
-    LOGD("C[locl]> %s", requestToString(request));
+    ALOGD("C[locl]> %s", requestToString(request));
 
     s_callbacks.onRequest(request, data, len, pRI);
 }
@@ -2249,7 +2249,7 @@
     uint8_t uct;
     void* dest;
 
-    LOGD("Inside responseCdmaSms");
+    ALOGD("Inside responseCdmaSms");
 
     if (response == NULL && responselen != 0) {
         LOGE("invalid response: NULL");
@@ -2465,7 +2465,7 @@
             LOGE("Error on getpwuid() errno: %d", errno);
         }
     } else {
-        LOGD("Error on getsockopt() errno: %d", errno);
+        ALOGD("Error on getsockopt() errno: %d", errno);
     }
 
     if ( !is_phone_socket ) {
@@ -2877,7 +2877,7 @@
     if (pRI->local > 0) {
         // Locally issued command...void only!
         // response does not go back up the command socket
-        LOGD("C[locl]< %s", requestToString(pRI->pCI->requestNumber));
+        ALOGD("C[locl]< %s", requestToString(pRI->pCI->requestNumber));
 
         goto done;
     }
@@ -2910,7 +2910,7 @@
         }
 
         if (s_fdCommand < 0) {
-            LOGD ("RIL onRequestComplete: Command channel closed");
+            ALOGD ("RIL onRequestComplete: Command channel closed");
         }
         sendResponse(p);
     }
@@ -2937,11 +2937,11 @@
 wakeTimeoutCallback (void *param) {
     // We're using "param != NULL" as a cancellation mechanism
     if (param == NULL) {
-        //LOGD("wakeTimeout: releasing wake lock");
+        //ALOGD("wakeTimeout: releasing wake lock");
 
         releaseWakeLock();
     } else {
-        //LOGD("wakeTimeout: releasing wake lock CANCELLED");
+        //ALOGD("wakeTimeout: releasing wake lock CANCELLED");
     }
 }
 
@@ -2961,7 +2961,7 @@
             return RADIO_TECH_1xRTT;
 
         default:
-            LOGD("decodeVoiceRadioTechnology: Invoked with incorrect RadioState");
+            ALOGD("decodeVoiceRadioTechnology: Invoked with incorrect RadioState");
             return -1;
     }
 }
@@ -2982,7 +2982,7 @@
             return CDMA_SUBSCRIPTION_SOURCE_NV;
 
         default:
-            LOGD("decodeCdmaSubscriptionSource: Invoked with incorrect RadioState");
+            ALOGD("decodeCdmaSubscriptionSource: Invoked with incorrect RadioState");
             return -1;
     }
 }
@@ -3001,7 +3001,7 @@
        case RADIO_STATE_RUIM_LOCKED_OR_ABSENT:
            return radioState;
        default:
-           LOGD("decodeSimStatus: Invoked with incorrect RadioState");
+           ALOGD("decodeSimStatus: Invoked with incorrect RadioState");
            return -1;
    }
 }
diff --git a/libril/ril_event.cpp b/libril/ril_event.cpp
index 4a4b330..0679a20 100644
--- a/libril/ril_event.cpp
+++ b/libril/ril_event.cpp
@@ -75,7 +75,7 @@
 #define DEBUG 0
 
 #if DEBUG
-#define dlog(x...) LOGD( x )
+#define dlog(x...) ALOGD( x )
 static void dump_event(struct ril_event * ev)
 {
     dlog("~~~~ Event %x ~~~~", (unsigned int)ev);
diff --git a/mock-ril/src/cpp/ctrl_server.cpp b/mock-ril/src/cpp/ctrl_server.cpp
index 90b6d4c..c1c3c39 100644
--- a/mock-ril/src/cpp/ctrl_server.cpp
+++ b/mock-ril/src/cpp/ctrl_server.cpp
@@ -39,7 +39,7 @@
 //#define CONTROL_SERVER_DEBUG
 #ifdef  CONTROL_SERVER_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -356,7 +356,7 @@
                     if (status != STATUS_OK) break;
 
                     if (mh.cmd() == ril_proto::CTRL_CMD_ECHO) {
-                        LOGD("CtrlServerThread::Worker echo");
+                        ALOGD("CtrlServerThread::Worker echo");
                         status = WriteMessage(&mh, buffer);
                         if (status != STATUS_OK) break;
                     } else {
@@ -450,14 +450,14 @@
     if (status != STATUS_OK) {
         LOGE("mock_ril control server could not start");
     } else {
-        LOGD("CtrlServer started");
+        ALOGD("CtrlServer started");
     }
 
 #if 0
-    LOGD("Test CtrlServerThread stop sleeping 10 seconds...");
+    ALOGD("Test CtrlServerThread stop sleeping 10 seconds...");
     v8::Unlocker unlocker;
     sleep(10);
-    LOGD("Test CtrlServerThread call Stop");
+    ALOGD("Test CtrlServerThread call Stop");
     g_ctrl_server->Stop();
     v8::Locker locker;
 
diff --git a/mock-ril/src/cpp/experiments.cpp b/mock-ril/src/cpp/experiments.cpp
index 5fa6fec..0bb6b98 100644
--- a/mock-ril/src/cpp/experiments.cpp
+++ b/mock-ril/src/cpp/experiments.cpp
@@ -39,17 +39,17 @@
     int data[] = {1, 2, 3};
 
     int *param = data;
-    LOGD("before push q.size=%d", q.size());
+    ALOGD("before push q.size=%d", q.size());
     q.push(param);
-    LOGD("after push q.size=%d", q.size());
+    ALOGD("after push q.size=%d", q.size());
     void *p = q.front();
     if (p == param) {
-        LOGD("q.push succeeded");
+        ALOGD("q.push succeeded");
     } else {
-        LOGD("q.push failed");
+        ALOGD("q.push failed");
     }
     q.pop();
-    LOGD("after pop q.size=%d", q.size());
+    ALOGD("after pop q.size=%d", q.size());
 }
 
 v8::Handle<v8::Value> GetReqScreenState(v8::Local<v8::String> property,
@@ -59,7 +59,7 @@
             v8::Local<v8::External>::Cast(self->GetInternalField(0));
     void *p = wrap->Value();
     int state = static_cast<int *>(p)[0];
-    LOGD("GetReqScreenState state=%d", state);
+    ALOGD("GetReqScreenState state=%d", state);
     return v8::Integer::New(state);
 }
 
@@ -73,7 +73,7 @@
     v8::Handle<v8::Value> onRilRequestFunctionValue = context->Global()->Get(name);
     if(!onRilRequestFunctionValue->IsFunction()) {
         // Wasn't a function
-        LOGD("callOnRilRequest X wasn't a function");
+        ALOGD("callOnRilRequest X wasn't a function");
         return false;
     }
     v8::Handle<v8::Function> onRilRequestFunction =
@@ -87,9 +87,9 @@
             v8::ObjectTemplate::New()->NewInstance();
     switch(request) {
         case(RIL_REQUEST_SCREEN_STATE): {
-            LOGD("callOnRilRequest RIL_REQUEST_SCREEN_STATE");
+            ALOGD("callOnRilRequest RIL_REQUEST_SCREEN_STATE");
             if (datalen < sizeof(int)) {
-                LOGD("callOnRilRequest err size < sizeof int");
+                ALOGD("callOnRilRequest err size < sizeof int");
             } else {
                 v8::Handle<v8::ObjectTemplate> params_obj_template =
                         v8::ObjectTemplate::New();
@@ -105,7 +105,7 @@
             break;
         }
         default: {
-            LOGD("callOnRilRequest X unknown request");
+            ALOGD("callOnRilRequest X unknown request");
             break;
         }
     }
@@ -117,19 +117,19 @@
     v8::Handle<v8::Value> result =
         onRilRequestFunction->Call(context->Global(), argc, argv);
     if (try_catch.HasCaught()) {
-        LOGD("callOnRilRequest error");
+        ALOGD("callOnRilRequest error");
         ReportException(&try_catch);
         retValue = false;
     } else {
         v8::String::Utf8Value result_string(result);
-        LOGD("callOnRilRequest result=%s", ToCString(result_string));
+        ALOGD("callOnRilRequest result=%s", ToCString(result_string));
         retValue = true;
     }
     return retValue;
 }
 
 void testOnRilRequestUsingCppRequestObjs(v8::Handle<v8::Context> context) {
-    LOGD("testOnRilRequestUsingCppRequestObjs E:");
+    ALOGD("testOnRilRequestUsingCppRequestObjs E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
@@ -149,94 +149,94 @@
         callOnRilRequest(context, RIL_REQUEST_SCREEN_STATE, data,
                 sizeof(data), NULL);
     }
-    LOGD("testOnRilRequestUsingCppRequestObjs X:");
+    ALOGD("testOnRilRequestUsingCppRequestObjs X:");
 }
 
 void testReqScreenStateProtobuf() {
     v8::HandleScope handle_scope;
     v8::TryCatch try_catch;
 
-    LOGD("testReqScreenStateProtobuf E");
+    ALOGD("testReqScreenStateProtobuf E");
 
-    LOGD("create ReqScreenState");
+    ALOGD("create ReqScreenState");
     ril_proto::ReqScreenState* ss = new ril_proto::ReqScreenState();
     ss->set_state(true);
     bool state = ss->state();
-    LOGD("state=%d", state);
+    ALOGD("state=%d", state);
     ss->set_state(false);
     state = ss->state();
-    LOGD("state=%d", state);
+    ALOGD("state=%d", state);
     int len = ss->ByteSize();
-    LOGD("create buffer len=%d", len);
+    ALOGD("create buffer len=%d", len);
     char *buffer = new char[len];
-    LOGD("serialize");
+    ALOGD("serialize");
     bool ok = ss->SerializeToArray(buffer, len);
     if (!ok) {
-        LOGD("testReqScreenStateProtobuf X: Could not serialize ss");
+        ALOGD("testReqScreenStateProtobuf X: Could not serialize ss");
         return;
     }
-    LOGD("ReqScreenState serialized ok");
+    ALOGD("ReqScreenState serialized ok");
     ril_proto::ReqScreenState *newSs = new ril_proto::ReqScreenState();
     ok = newSs->ParseFromArray(buffer, len);
     if (!ok) {
-        LOGD("testReqScreenStateProtobuf X: Could not deserialize ss");
+        ALOGD("testReqScreenStateProtobuf X: Could not deserialize ss");
         return;
     }
-    LOGD("newSs->state=%d", newSs->state());
+    ALOGD("newSs->state=%d", newSs->state());
 
     delete [] buffer;
     delete ss;
     delete newSs;
-    LOGD("testReqScreenStateProtobuf X");
+    ALOGD("testReqScreenStateProtobuf X");
 }
 
 void testReqHangUpProtobuf() {
     v8::HandleScope handle_scope;
     v8::TryCatch try_catch;
 
-    LOGD("testReqHangUpProtobuf E");
+    ALOGD("testReqHangUpProtobuf E");
 
-    LOGD("create ReqHangUp");
+    ALOGD("create ReqHangUp");
     ril_proto::ReqHangUp* hu = new ril_proto::ReqHangUp();
     hu->set_connection_index(3);
     bool connection_index = hu->connection_index();
-    LOGD("connection_index=%d", connection_index);
+    ALOGD("connection_index=%d", connection_index);
     hu->set_connection_index(2);
     connection_index = hu->connection_index();
-    LOGD("connection_index=%d", connection_index);
-    LOGD("create buffer");
+    ALOGD("connection_index=%d", connection_index);
+    ALOGD("create buffer");
     int len = hu->ByteSize();
     char *buffer = new char[len];
-    LOGD("serialize");
+    ALOGD("serialize");
     bool ok = hu->SerializeToArray(buffer, len);
     if (!ok) {
-        LOGD("testReqHangUpProtobuf X: Could not serialize hu");
+        ALOGD("testReqHangUpProtobuf X: Could not serialize hu");
         return;
     }
-    LOGD("ReqHangUp serialized ok");
+    ALOGD("ReqHangUp serialized ok");
     ril_proto::ReqHangUp *newHu = new ril_proto::ReqHangUp();
     ok = newHu->ParseFromArray(buffer, len);
     if (!ok) {
-        LOGD("testReqHangUpProtobuf X: Could not deserialize hu");
+        ALOGD("testReqHangUpProtobuf X: Could not deserialize hu");
         return;
     }
-    LOGD("newHu->connection_index=%d", newHu->connection_index());
+    ALOGD("newHu->connection_index=%d", newHu->connection_index());
 
     delete [] buffer;
     delete hu;
     delete newHu;
-    LOGD("testReqHangUpProtobuf X");
+    ALOGD("testReqHangUpProtobuf X");
 }
 
 void testProtobufV8(v8::Handle<v8::Context> context) {
-    LOGD("testProtobufV8 E:");
+    ALOGD("testProtobufV8 E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
     try_catch.SetVerbose(true);
 
     if (try_catch.HasCaught()) {
-        LOGD("TryCatch.hasCaught is true after protobuf_v8::init");
+        ALOGD("TryCatch.hasCaught is true after protobuf_v8::init");
         ReportException(&try_catch);
     }
     runJs(context, &try_catch, "local-string",
@@ -268,14 +268,14 @@
         "print('serializedOriginalReqScreenState.length=' + serializedOriginalReqScreenState.length);\n"
         "newReqScreenState = ReqScreenStateSchema.parse(serializedOriginalReqScreenState);\n"
         "print('newReqScreenState: state=' + newReqScreenState.state);\n");
-    LOGD("testProtobufV8 X");
+    ALOGD("testProtobufV8 X");
 }
 
 void experiments(v8::Handle<v8::Context> context) {
-    LOGD("experiments E: ********");
+    ALOGD("experiments E: ********");
     testStlPort();
     testReqScreenStateProtobuf();
     testOnRilRequestUsingCppRequestObjs(context);
     testProtobufV8(context);
-    LOGD("experiments X: ********\n");
+    ALOGD("experiments X: ********\n");
 }
diff --git a/mock-ril/src/cpp/js_support.cpp b/mock-ril/src/cpp/js_support.cpp
index a2ce9c5..bca0a33 100644
--- a/mock-ril/src/cpp/js_support.cpp
+++ b/mock-ril/src/cpp/js_support.cpp
@@ -34,7 +34,7 @@
 //#define JS_SUPPORT_DEBUG
 #ifdef  JS_SUPPORT_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -88,7 +88,7 @@
         const char* cstr = ToCString(strUtf8);
         offset += snprintf(&str[offset], str_size, "%s", cstr);
     }
-    LOGD("%s", str);
+    ALOGD("%s", str);
     delete [] str;
     return v8::Undefined();
 }
@@ -301,7 +301,7 @@
 }
 
 void testRadioState(v8::Handle<v8::Context> context) {
-    LOGD("testRadioState E:");
+    ALOGD("testRadioState E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
@@ -314,11 +314,11 @@
         "}\n"
         "gRadioState = 1;\n"
         "print('last gRadioState=' + gRadioState);\n");
-    LOGD("testRadioState X:");
+    ALOGD("testRadioState X:");
 }
 
 void testMsSleep(v8::Handle<v8::Context> context) {
-    LOGD("testMsSleep E:");
+    ALOGD("testMsSleep E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
@@ -330,22 +330,22 @@
         "  print('msSleep ' + sleeptime);\n"
         "  msSleep(sleeptime);\n"
         "}\n");
-    LOGD("testMsSleep X:");
+    ALOGD("testMsSleep X:");
 }
 
 void testPrint(v8::Handle<v8::Context> context) {
-    LOGD("testPrint E:");
+    ALOGD("testPrint E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
     try_catch.SetVerbose(true);
 
     runJs(context, &try_catch, "local-string", "print(\"Hello\")");
-    LOGD("testPrint X:");
+    ALOGD("testPrint X:");
 }
 
 void testCompileError(v8::Handle<v8::Context> context) {
-    LOGD("testCompileError E:");
+    ALOGD("testCompileError E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
@@ -353,11 +353,11 @@
 
     // +++ generate a compile time error
     runJs(context, &try_catch, "local-string", "+++");
-    LOGD("testCompileError X:");
+    ALOGD("testCompileError X:");
 }
 
 void testRuntimeError(v8::Handle<v8::Context> context) {
-    LOGD("testRuntimeError E:");
+    ALOGD("testRuntimeError E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
@@ -369,7 +369,7 @@
         "  print(\"Hi there\");\n"
         "}\n"
         "helloo()");
-    LOGD("testRuntimeError X:");
+    ALOGD("testRuntimeError X:");
 }
 
 void testReadFile() {
@@ -377,18 +377,18 @@
     size_t length;
     int status;
 
-    LOGD("testReadFile E:");
+    ALOGD("testReadFile E:");
 
     status = ReadFile("/sdcard/data/no-file", &buffer, &length);
-    LOGD("testReadFile expect status != 0, status=%d, buffer=%p, length=%d",
+    ALOGD("testReadFile expect status != 0, status=%d, buffer=%p, length=%d",
             status, buffer, length);
 
-    LOGD("testReadFile X:");
+    ALOGD("testReadFile X:");
 }
 
 
 void testReadFileToStringBuffer(v8::Handle<v8::Context> context) {
-    LOGD("testReadFileToStringBuffer E:");
+    ALOGD("testReadFileToStringBuffer E:");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
@@ -399,11 +399,11 @@
         "print(\"fileContents:\\n\" + fileContents);\n"
         "buffer = readFileToBuffer(\"ril.desc\");\n"
         "print(\"buffer.length=\" + buffer.length);\n");
-    LOGD("testReadFileToStringBuffer X:");
+    ALOGD("testReadFileToStringBuffer X:");
 }
 
 void testJsSupport(v8::Handle<v8::Context> context) {
-    LOGD("testJsSupport E: ********");
+    ALOGD("testJsSupport E: ********");
     testRadioState(context);
     testMsSleep(context);
     testPrint(context);
@@ -411,5 +411,5 @@
     testRuntimeError(context);
     testReadFile();
     testReadFileToStringBuffer(context);
-    LOGD("testJsSupport X: ********\n");
+    ALOGD("testJsSupport X: ********\n");
 }
diff --git a/mock-ril/src/cpp/mock_ril.cpp b/mock-ril/src/cpp/mock_ril.cpp
index f6b6807..646c322 100644
--- a/mock-ril/src/cpp/mock_ril.cpp
+++ b/mock-ril/src/cpp/mock_ril.cpp
@@ -59,7 +59,7 @@
 //#define MOCK_RIL_DEBUG
 #ifdef  MOCK_RIL_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -243,7 +243,7 @@
 
     void * Worker(void *param)
     {
-        LOGD("UnsolicitedThread::Worker E param=%p", param);
+        ALOGD("UnsolicitedThread::Worker E param=%p", param);
 
         v8::Locker locker;
 
@@ -261,7 +261,7 @@
             v8::Locker locker;
         }
 
-        LOGD("UnsolicitedThread::Worker X param=%p", param);
+        ALOGD("UnsolicitedThread::Worker X param=%p", param);
 
         return NULL;
     }
@@ -296,7 +296,7 @@
     int ret;
     pthread_attr_t attr;
 
-    LOGD("RIL_Init E: ----------------");
+    ALOGD("RIL_Init E: ----------------");
 
     // Initialize V8
     v8::V8::Initialize();
@@ -335,13 +335,13 @@
     responsesInit(context);
 
 #if 0
-    LOGD("RIL_Init run tests #####################");
+    ALOGD("RIL_Init run tests #####################");
     testJsSupport(context);
     testRequests(context);
     experiments(context);
     testWorker();
     testWorkerV8(context);
-    LOGD("RIL_Init tests completed ###############");
+    ALOGD("RIL_Init tests completed ###############");
 #endif
 
     // Register our call backs so when we startMockRil
@@ -357,6 +357,6 @@
     ut->Run(NULL);
 #endif
 
-    LOGD("RIL_Init X: ----------------");
+    ALOGD("RIL_Init X: ----------------");
     return &s_callbacks;
 }
diff --git a/mock-ril/src/cpp/node_buffer.cpp b/mock-ril/src/cpp/node_buffer.cpp
index d72e19e..4c08a26 100644
--- a/mock-ril/src/cpp/node_buffer.cpp
+++ b/mock-ril/src/cpp/node_buffer.cpp
@@ -41,7 +41,7 @@
 //#define BUFFER_DEBUG
 #ifdef  BUFFER_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
diff --git a/mock-ril/src/cpp/protobuf_v8.cpp b/mock-ril/src/cpp/protobuf_v8.cpp
index 1622ba5..19f87c1 100644
--- a/mock-ril/src/cpp/protobuf_v8.cpp
+++ b/mock-ril/src/cpp/protobuf_v8.cpp
@@ -34,7 +34,7 @@
 //#define PROTOBUF_V8_DEBUG
 #ifdef  PROTOBUF_V8_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -372,7 +372,7 @@
           } else {
             str_value = ToCString(value);
             // TODO: Why can str_value be corrupted sometimes?
-            LOGD("str_value=%s", str_value);
+            ALOGD("str_value=%s", str_value);
             vd = ed->FindValueByName(str_value);
             if (vd == NULL) {
               snprintf(error_buff, sizeof(error_buff),
diff --git a/mock-ril/src/cpp/requests.cpp b/mock-ril/src/cpp/requests.cpp
index 366ba30..5fda19c 100644
--- a/mock-ril/src/cpp/requests.cpp
+++ b/mock-ril/src/cpp/requests.cpp
@@ -38,7 +38,7 @@
 //#define REQUESTS_DEBUG
 #ifdef  REQUESTS_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -403,7 +403,7 @@
 }
 
 int requestsInit(v8::Handle<v8::Context> context, RilRequestWorkerQueue **rwq) {
-    LOGD("requestsInit E");
+    ALOGD("requestsInit E");
 
     rilReqConversionMap[RIL_REQUEST_GET_SIM_STATUS] = ReqWithNoData; // 1
     rilReqConversionMap[RIL_REQUEST_ENTER_SIM_PIN] = ReqEnterSimPin; // 2
@@ -433,7 +433,7 @@
     *rwq = new RilRequestWorkerQueue(context);
     int status = (*rwq)->Run();
 
-    LOGD("requestsInit X: status=%d", status);
+    ALOGD("requestsInit X: status=%d", status);
     return status;
 }
 
@@ -446,7 +446,7 @@
     ReqConversionMap::iterator itr;
     int status;
 
-    LOGD("testRilRequest: request=%d", request);
+    ALOGD("testRilRequest: request=%d", request);
 
     itr = rilReqConversionMap.find(request);
     if (itr != rilReqConversionMap.end()) {
@@ -463,7 +463,7 @@
 }
 
 void testRequests(v8::Handle<v8::Context> context) {
-    LOGD("testRequests E: ********");
+    ALOGD("testRequests E: ********");
 
     v8::TryCatch try_catch;
 
@@ -521,5 +521,5 @@
         }
     }
 
-    LOGD("testRequests X: ********\n");
+    ALOGD("testRequests X: ********\n");
 }
diff --git a/mock-ril/src/cpp/responses.cpp b/mock-ril/src/cpp/responses.cpp
index d13fecf..fdf06fc 100644
--- a/mock-ril/src/cpp/responses.cpp
+++ b/mock-ril/src/cpp/responses.cpp
@@ -35,7 +35,7 @@
 //#define RESPONSES_DEBUG
 #ifdef  RESPONSES_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -501,7 +501,7 @@
 }
 
 int responsesInit(v8::Handle<v8::Context> context) {
-    LOGD("responsesInit E");
+    ALOGD("responsesInit E");
     int status = STATUS_OK;
 
     rilRspConversionMap[RIL_REQUEST_GET_SIM_STATUS] = RspGetSimStatus; // 1
@@ -531,6 +531,6 @@
     unsolRilRspConversionMap[RIL_UNSOL_SIGNAL_STRENGTH] = UnsolRspSignalStrength;  // 1009
 
 
-    LOGD("responsesInit X: status=%d", status);
+    ALOGD("responsesInit X: status=%d", status);
     return STATUS_OK;
 }
diff --git a/mock-ril/src/cpp/util.cpp b/mock-ril/src/cpp/util.cpp
index 6d0bf1a..97d9f9a 100644
--- a/mock-ril/src/cpp/util.cpp
+++ b/mock-ril/src/cpp/util.cpp
@@ -44,20 +44,20 @@
         // V8 didn't provide any extra information about this error; just
         // print the exception.
         if (alternate_message == NULL || strlen(alternate_message) == 0) {
-            LOGD("LogErrorMessage no message");
+            ALOGD("LogErrorMessage no message");
         } else {
-            LOGD("LogErrorMessage no message: %s", alternate_message);
+            ALOGD("LogErrorMessage no message: %s", alternate_message);
         }
     } else {
         v8::String::Utf8Value filename(message->GetScriptResourceName());
         const char* filename_string = ToCString(filename);
         int linenum = message->GetLineNumber();
-        LOGD("file:%s line:%i", filename_string, linenum);
+        ALOGD("file:%s line:%i", filename_string, linenum);
 
         // Print line of source code.
         v8::String::Utf8Value sourceline(message->GetSourceLine());
         const char* sourceline_string = ToCString(sourceline);
-        LOGD("%s", sourceline_string);
+        ALOGD("%s", sourceline_string);
 
         // Print location information under source line
         int start = message->GetStartColumn();
@@ -72,8 +72,8 @@
         memset(error_string, ' ', start);
         memset(&error_string[start], '^', lenErr);
         error_string[size-1] = 0;
-        LOGD("%s", error_string);
-        LOGD("%s", ToCString(v8::String::Utf8Value(message->Get())));
+        ALOGD("%s", error_string);
+        ALOGD("%s", ToCString(v8::String::Utf8Value(message->Get())));
         delete [] error_string;
     }
 }
diff --git a/mock-ril/src/cpp/worker.cpp b/mock-ril/src/cpp/worker.cpp
index 0379621..1508a52 100644
--- a/mock-ril/src/cpp/worker.cpp
+++ b/mock-ril/src/cpp/worker.cpp
@@ -23,7 +23,7 @@
 //#define WORKER_DEBUG
 #ifdef  WORKER_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -306,7 +306,7 @@
 
 class TestWorkerQueue : public WorkerQueue {
     virtual void Process(void *p) {
-        LOGD("TestWorkerQueue::Process: EX p=%p", p);
+        ALOGD("TestWorkerQueue::Process: EX p=%p", p);
     }
 };
 
@@ -314,7 +314,7 @@
   public:
     void * Worker(void *param)
     {
-        LOGD("TesterThread::Worker E param=%p", param);
+        ALOGD("TesterThread::Worker E param=%p", param);
         WorkerQueue *wq = (WorkerQueue *)param;
 
         // Test AddDelayed
@@ -327,7 +327,7 @@
         wq->AddDelayed((void *)2000, 2000);
 
         for (int i = 1; isRunning(); i++) {
-            LOGD("TesterThread: looping %d", i);
+            ALOGD("TesterThread: looping %d", i);
             wq->Add((void *)i);
             wq->Add((void *)i);
             wq->Add((void *)i);
@@ -335,14 +335,14 @@
             sleep(1);
         }
 
-        LOGD("TesterThread::Worker X param=%p", param);
+        ALOGD("TesterThread::Worker X param=%p", param);
 
         return NULL;
     }
 };
 
 void testWorker() {
-    LOGD("testWorker E: ********");
+    ALOGD("testWorker E: ********");
 
     // Test we can create a thread and delete it
     TesterThread *tester = new TesterThread();
@@ -350,18 +350,18 @@
 
     TestWorkerQueue *wq = new TestWorkerQueue();
     if (wq->Run() == STATUS_OK) {
-        LOGD("testWorker WorkerQueue %p running", wq);
+        ALOGD("testWorker WorkerQueue %p running", wq);
 
         // Test we can run a thread, stop it then delete it
         tester = new TesterThread();
         tester->Run(wq);
-        LOGD("testWorker tester %p running", tester);
+        ALOGD("testWorker tester %p running", tester);
         sleep(10);
-        LOGD("testWorker tester %p stopping", tester);
+        ALOGD("testWorker tester %p stopping", tester);
         tester->Stop();
-        LOGD("testWorker tester %p stopped", tester);
+        ALOGD("testWorker tester %p stopped", tester);
         wq->Stop();
-        LOGD("testWorker wq %p stopped", wq);
+        ALOGD("testWorker wq %p stopped", wq);
     }
-    LOGD("testWorker X: ********\n");
+    ALOGD("testWorker X: ********\n");
 }
diff --git a/mock-ril/src/cpp/worker_v8.cpp b/mock-ril/src/cpp/worker_v8.cpp
index 61e1d3b..0e71b06 100644
--- a/mock-ril/src/cpp/worker_v8.cpp
+++ b/mock-ril/src/cpp/worker_v8.cpp
@@ -30,7 +30,7 @@
 //#define WORKER_V8_V8_DEBUG
 #ifdef  WORKER_V8_V8_DEBUG
 
-#define DBG(...) LOGD(__VA_ARGS__)
+#define DBG(...) ALOGD(__VA_ARGS__)
 
 #else
 
@@ -193,13 +193,13 @@
 }
 
 void testWorkerV8(v8::Handle<v8::Context> context) {
-    LOGD("testWorkerV8 E: ********");
+    ALOGD("testWorkerV8 E: ********");
     v8::HandleScope handle_scope;
 
     v8::TryCatch try_catch;
     try_catch.SetVerbose(true);
 
-    LOGD("testWorkerV8 runJs");
+    ALOGD("testWorkerV8 runJs");
     runJs(context, &try_catch, "local-string",
         "var w1 = new Worker(function (msg) {"
         "     print('w1: ' + msg);\n"
@@ -214,7 +214,7 @@
         "w1.add('two');\n"
         "w1.addDelayed('four', 2000);\n"
     );
-    LOGD("testWorkerV8 X: ********");
+    ALOGD("testWorkerV8 X: ********");
 }
 
 extern void WorkerV8ObjectTemplateInit(v8::Handle<v8::ObjectTemplate> target) {
diff --git a/reference-ril/atchannel.c b/reference-ril/atchannel.c
index f878b35..410ad0e 100644
--- a/reference-ril/atchannel.c
+++ b/reference-ril/atchannel.c
@@ -69,7 +69,7 @@
 {
     if (len < 0)
         len = strlen(buff);
-    LOGD("%.*s", len, buff);
+    ALOGD("%.*s", len, buff);
 }
 #endif
 
@@ -398,9 +398,9 @@
         } else if (count <= 0) {
             /* read error encountered or EOF reached */
             if(count == 0) {
-                LOGD("atchannel: EOF reached");
+                ALOGD("atchannel: EOF reached");
             } else {
-                LOGD("atchannel: read error %s", strerror(errno));
+                ALOGD("atchannel: read error %s", strerror(errno));
             }
             return NULL;
         }
@@ -413,7 +413,7 @@
     s_ATBufferCur = p_eol + 1; /* this will always be <= p_read,    */
                               /* and there will be a \0 at *p_read */
 
-    LOGD("AT< %s\n", ret);
+    ALOGD("AT< %s\n", ret);
     return ret;
 }
 
@@ -499,7 +499,7 @@
         return AT_ERROR_CHANNEL_CLOSED;
     }
 
-    LOGD("AT> %s\n", s);
+    ALOGD("AT> %s\n", s);
 
     AT_DUMP( ">> ", s, strlen(s) );
 
@@ -538,7 +538,7 @@
         return AT_ERROR_CHANNEL_CLOSED;
     }
 
-    LOGD("AT> %s^Z\n", s);
+    ALOGD("AT> %s^Z\n", s);
 
     AT_DUMP( ">* ", s, strlen(s) );
 
diff --git a/reference-ril/reference-ril.c b/reference-ril/reference-ril.c
index ce2b0ce..f5495db 100644
--- a/reference-ril/reference-ril.c
+++ b/reference-ril/reference-ril.c
@@ -1033,12 +1033,12 @@
     int retry = 10;
     const char *pdp_type;
 
-    LOGD("requesting data connection to APN '%s'", apn);
+    ALOGD("requesting data connection to APN '%s'", apn);
 
     fd = open ("/dev/qmi", O_RDWR);
     if (fd >= 0) { /* the device doesn't exist on the emulator */
 
-        LOGD("opened the qmi device\n");
+        ALOGD("opened the qmi device\n");
         asprintf(&cmd, "up:%s", apn);
         len = strlen(cmd);
 
@@ -1070,7 +1070,7 @@
                 goto error;
             } else {
                 status[rlen] = '\0';
-                LOGD("### status: %s", status);
+                ALOGD("### status: %s", status);
             }
         } while (strncmp(status, "STATE=up", 8) && strcmp(status, "online") && --retry);
 
@@ -1083,7 +1083,7 @@
 
         qmistatus = system("netcfg rmnet0 dhcp");
 
-        LOGD("netcfg rmnet0 dhcp: status %d\n", qmistatus);
+        ALOGD("netcfg rmnet0 dhcp: status %d\n", qmistatus);
 
         if (qmistatus < 0) goto error;
 
@@ -1273,7 +1273,7 @@
     ATResponse *p_response;
     int err;
 
-    LOGD("onRequest: %s", requestToString(request));
+    ALOGD("onRequest: %s", requestToString(request));
 
     /* Ignore all requests except RIL_REQUEST_GET_SIM_STATUS
      * when RADIO_STATE_UNAVAILABLE.
@@ -1506,12 +1506,12 @@
             int i;
             const char ** cur;
 
-            LOGD("got OEM_HOOK_STRINGS: 0x%8p %lu", data, (long)datalen);
+            ALOGD("got OEM_HOOK_STRINGS: 0x%8p %lu", data, (long)datalen);
 
 
             for (i = (datalen / sizeof (char *)), cur = (const char **)data ;
                     i > 0 ; cur++, i --) {
-                LOGD("> '%s'", *cur);
+                ALOGD("> '%s'", *cur);
             }
 
             // echo back strings
diff --git a/rild/rild.c b/rild/rild.c
index 18ff671..9a1975e 100644
--- a/rild/rild.c
+++ b/rild/rild.c
@@ -148,7 +148,7 @@
         int           fd = open("/proc/cmdline",O_RDONLY);
 
         if (fd < 0) {
-            LOGD("could not open /proc/cmdline:%s", strerror(errno));
+            ALOGD("could not open /proc/cmdline:%s", strerror(errno));
             goto OpenLib;
         }
 
@@ -157,7 +157,7 @@
         while (len == -1 && errno == EINTR);
 
         if (len < 0) {
-            LOGD("could not read /proc/cmdline:%s", strerror(errno));
+            ALOGD("could not read /proc/cmdline:%s", strerror(errno));
             close(fd);
             goto OpenLib;
         }
@@ -193,7 +193,7 @@
                     done = 1;
                     break;
                 }
-                LOGD("could not connect to %s socket: %s",
+                ALOGD("could not connect to %s socket: %s",
                     QEMUD_SOCKET_NAME, strerror(errno));
                 if (--tries == 0)
                     break;
@@ -235,7 +235,7 @@
             hasLibArgs = 1;
             rilLibPath = REFERENCE_RIL_PATH;
 
-            LOGD("overriding with %s %s", arg_overrides[1], arg_overrides[2]);
+            ALOGD("overriding with %s %s", arg_overrides[1], arg_overrides[2]);
         }
     }
 OpenLib: