Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)  DO NOT MERGE

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

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 988fee3..4d80296 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -463,7 +463,7 @@
         }
     }
     if (got_pid != pid) {
-        LOGW("waitpid failed: wanted %d, got %d: %s\n",
+        ALOGW("waitpid failed: wanted %d, got %d: %s\n",
             (int) pid, (int) got_pid, strerror(errno));
         return 1;
     }
@@ -472,7 +472,7 @@
         ALOGV("DexInv: --- END '%s' (success) ---\n", apk_path);
         return 0;
     } else {
-        LOGW("DexInv: --- END '%s' --- status=0x%04x, process failed\n",
+        ALOGW("DexInv: --- END '%s' --- status=0x%04x, process failed\n",
             apk_path, status);
         return status;      /* always nonzero */
     }
@@ -595,7 +595,7 @@
                 if (mkdir(path, mode) == 0) {
                     chown(path, uid, gid);
                 } else {
-                    LOGW("Unable to make directory %s: %s\n", path, strerror(errno));
+                    ALOGW("Unable to make directory %s: %s\n", path, strerror(errno));
                 }
             }
             path[basepos] = '/';
@@ -616,7 +616,7 @@
     int dstend = strlen(dstpath);
     
     if (lstat(srcpath, statbuf) < 0) {
-        LOGW("Unable to stat %s: %s\n", srcpath, strerror(errno));
+        ALOGW("Unable to stat %s: %s\n", srcpath, strerror(errno));
         return 1;
     }
     
@@ -631,7 +631,7 @@
                 return 1;
             }
         } else {
-            LOGW("Unable to rename %s to %s: %s\n",
+            ALOGW("Unable to rename %s to %s: %s\n",
                 srcpath, dstpath, strerror(errno));
             return 1;
         }
@@ -640,7 +640,7 @@
 
     d = opendir(srcpath);
     if (d == NULL) {
-        LOGW("Unable to opendir %s: %s\n", srcpath, strerror(errno));
+        ALOGW("Unable to opendir %s: %s\n", srcpath, strerror(errno));
         return 1;
     }
 
@@ -655,12 +655,12 @@
         }
         
         if ((srcend+strlen(name)) >= (PKG_PATH_MAX-2)) {
-            LOGW("Source path too long; skipping: %s/%s\n", srcpath, name);
+            ALOGW("Source path too long; skipping: %s/%s\n", srcpath, name);
             continue;
         }
         
         if ((dstend+strlen(name)) >= (PKG_PATH_MAX-2)) {
-            LOGW("Destination path too long; skipping: %s/%s\n", dstpath, name);
+            ALOGW("Destination path too long; skipping: %s/%s\n", dstpath, name);
             continue;
         }
         
@@ -716,7 +716,7 @@
         } else {
             subfd = openat(dfd, name, O_RDONLY);
             if (subfd < 0) {
-                LOGW("Unable to open update commands at %s%s\n",
+                ALOGW("Unable to open update commands at %s%s\n",
                         UPDATE_COMMANDS_DIR_PREFIX, name);
                 continue;
             }
@@ -742,7 +742,7 @@
                         // skip comments and empty lines.
                     } else if (hasspace) {
                         if (dstpkg[0] == 0) {
-                            LOGW("Path before package line in %s%s: %s\n",
+                            ALOGW("Path before package line in %s%s: %s\n",
                                     UPDATE_COMMANDS_DIR_PREFIX, name, buf+bufp);
                         } else if (srcpkg[0] == 0) {
                             // Skip -- source package no longer exists.
@@ -758,7 +758,7 @@
                     } else {
                         char* div = strchr(buf+bufp, ':');
                         if (div == NULL) {
-                            LOGW("Bad package spec in %s%s; no ':' sep: %s\n",
+                            ALOGW("Bad package spec in %s%s; no ':' sep: %s\n",
                                     UPDATE_COMMANDS_DIR_PREFIX, name, buf+bufp);
                         } else {
                             *div = 0;
@@ -767,14 +767,14 @@
                                 strcpy(dstpkg, buf+bufp);
                             } else {
                                 srcpkg[0] = dstpkg[0] = 0;
-                                LOGW("Package name too long in %s%s: %s\n",
+                                ALOGW("Package name too long in %s%s: %s\n",
                                         UPDATE_COMMANDS_DIR_PREFIX, name, buf+bufp);
                             }
                             if (strlen(div) < PKG_NAME_MAX) {
                                 strcpy(srcpkg, div);
                             } else {
                                 srcpkg[0] = dstpkg[0] = 0;
-                                LOGW("Package name too long in %s%s: %s\n",
+                                ALOGW("Package name too long in %s%s: %s\n",
                                         UPDATE_COMMANDS_DIR_PREFIX, name, div);
                             }
                             if (srcpkg[0] != 0) {
@@ -785,7 +785,7 @@
                                     }
                                 } else {
                                     srcpkg[0] = 0;
-                                    LOGW("Can't create path %s in %s%s\n",
+                                    ALOGW("Can't create path %s in %s%s\n",
                                             div, UPDATE_COMMANDS_DIR_PREFIX, name);
                                 }
                                 if (srcpkg[0] != 0) {
@@ -802,7 +802,7 @@
                                         }
                                     } else {
                                         srcpkg[0] = 0;
-                                        LOGW("Can't create path %s in %s%s\n",
+                                        ALOGW("Can't create path %s in %s%s\n",
                                                 div, UPDATE_COMMANDS_DIR_PREFIX, name);
                                     }
                                 }
@@ -815,7 +815,7 @@
                 } else {
                     if (bufp == 0) {
                         if (bufp < bufe) {
-                            LOGW("Line too long in %s%s, skipping: %s\n",
+                            ALOGW("Line too long in %s%s, skipping: %s\n",
                                     UPDATE_COMMANDS_DIR_PREFIX, name, buf);
                         }
                     } else if (bufp < bufe) {
@@ -825,7 +825,7 @@
                     }
                     readlen = read(subfd, buf+bufe, PKG_PATH_MAX-bufe);
                     if (readlen < 0) {
-                        LOGW("Failure reading update commands in %s%s: %s\n",
+                        ALOGW("Failure reading update commands in %s%s: %s\n",
                                 UPDATE_COMMANDS_DIR_PREFIX, name, strerror(errno));
                         break;
                     } else if (readlen == 0) {
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c
index a53a93c..940626e 100644
--- a/cmds/installd/utils.c
+++ b/cmds/installd/utils.c
@@ -83,7 +83,7 @@
     if (persona != 0) {
         int ret = snprintf(dst, dst_size, "%d/", persona);
         if (ret < 0 || (size_t) ret != uid_len + 1) {
-            LOGW("Error appending UID to APK path");
+            ALOGW("Error appending UID to APK path");
             return -1;
         }
     }
@@ -326,7 +326,7 @@
     const char* path = getenv(var);
     int ret = get_path_from_string(rec, path);
     if (ret < 0) {
-        LOGW("Problem finding value for environment variable %s\n", var);
+        ALOGW("Problem finding value for environment variable %s\n", var);
     }
     return ret;
 }
diff --git a/cmds/keystore/keystore.cpp b/cmds/keystore/keystore.cpp
index d8380a5..6ca31a6 100644
--- a/cmds/keystore/keystore.cpp
+++ b/cmds/keystore/keystore.cpp
@@ -785,7 +785,7 @@
         socklen_t size = sizeof(cred);
         int credResult = getsockopt(sock, SOL_SOCKET, SO_PEERCRED, &cred, &size);
         if (credResult != 0) {
-            LOGW("getsockopt: %s", strerror(errno));
+            ALOGW("getsockopt: %s", strerror(errno));
         } else {
             int8_t request;
             if (recv_code(sock, &request)) {
diff --git a/cmds/system_server/system_main.cpp b/cmds/system_server/system_main.cpp
index de00326..ddff065 100644
--- a/cmds/system_server/system_main.cpp
+++ b/cmds/system_server/system_main.cpp
@@ -49,7 +49,7 @@
     blockSignals();
     
     // You can trust me, honestly!
-    LOGW("*** Current priority: %d\n", getpriority(PRIO_PROCESS, 0));
+    ALOGW("*** Current priority: %d\n", getpriority(PRIO_PROCESS, 0));
     setpriority(PRIO_PROCESS, 0, -1);
 
     system_init();    
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 274121a..57f4b95 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -396,7 +396,7 @@
     sigemptyset(&mask);
     sigaddset(&mask, SIGPIPE);
     if (sigprocmask(SIG_BLOCK, &mask, NULL) != 0)
-        LOGW("WARNING: SIGPIPE not blocked\n");
+        ALOGW("WARNING: SIGPIPE not blocked\n");
 }
 
 /*
@@ -889,9 +889,9 @@
 
     ALOGD("Shutting down VM\n");
     if (mJavaVM->DetachCurrentThread() != JNI_OK)
-        LOGW("Warning: unable to detach main thread\n");
+        ALOGW("Warning: unable to detach main thread\n");
     if (mJavaVM->DestroyJavaVM() != 0)
-        LOGW("Warning: VM did not shut down cleanly\n");
+        ALOGW("Warning: VM did not shut down cleanly\n");
 }
 
 void AndroidRuntime::onExit(int code)
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp
index de2d8c4..9e697b4 100644
--- a/core/jni/android/graphics/SurfaceTexture.cpp
+++ b/core/jni/android/graphics/SurfaceTexture.cpp
@@ -136,7 +136,7 @@
         env->DeleteGlobalRef(mWeakThiz);
         env->DeleteGlobalRef(mClazz);
     } else {
-        LOGW("leaking JNI object references");
+        ALOGW("leaking JNI object references");
     }
     if (needsDetach) {
         detachJNI();
@@ -150,7 +150,7 @@
     if (env != NULL) {
         env->CallStaticVoidMethod(mClazz, fields.postEvent, mWeakThiz);
     } else {
-        LOGW("onFrameAvailable event will not posted");
+        ALOGW("onFrameAvailable event will not posted");
     }
     if (needsDetach) {
         detachJNI();
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 75251c9..1b7623d 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -423,7 +423,7 @@
                         isRTL = (paraDir == 1);
                         useSingleRun = true;
                     } else if (!U_SUCCESS(status) || rc < 1) {
-                        LOGW("Need to force to single run -- string = '%s',"
+                        ALOGW("Need to force to single run -- string = '%s',"
                                 " status = %d, rc = %d",
                                 String8(chars + start, count).string(), status, int(rc));
                         isRTL = (paraDir == 1);
@@ -438,7 +438,7 @@
                             if (startRun == -1 || lengthRun == -1) {
                                 // Something went wrong when getting the visual run, need to clear
                                 // already computed data before doing a single run pass
-                                LOGW("Visual run is not valid");
+                                ALOGW("Visual run is not valid");
                                 outGlyphs->clear();
                                 outAdvances->clear();
                                 *outTotalAdvance = 0;
@@ -475,13 +475,13 @@
                         }
                     }
                 } else {
-                    LOGW("Cannot set Para");
+                    ALOGW("Cannot set Para");
                     useSingleRun = true;
                     isRTL = (bidiReq = 1) || (bidiReq = UBIDI_DEFAULT_RTL);
                 }
                 ubidi_close(bidi);
             } else {
-                LOGW("Cannot ubidi_open()");
+                ALOGW("Cannot ubidi_open()");
                 useSingleRun = true;
                 isRTL = (bidiReq = 1) || (bidiReq = UBIDI_DEFAULT_RTL);
             }
diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp
index 15bb543..7f5ba85 100644
--- a/core/jni/android_app_NativeActivity.cpp
+++ b/core/jni/android_app_NativeActivity.cpp
@@ -84,8 +84,8 @@
     
     if (res == sizeof(work)) return;
     
-    if (res < 0) LOGW("Failed writing to work fd: %s", strerror(errno));
-    else LOGW("Truncated writing to work fd: %d", res);
+    if (res < 0) ALOGW("Failed writing to work fd: %s", strerror(errno));
+    else ALOGW("Truncated writing to work fd: %d", res);
 }
 
 static bool read_work(int fd, ActivityWork* outWork) {
@@ -93,8 +93,8 @@
     // no need to worry about EINTR, poll loop will just come back again.
     if (res == sizeof(ActivityWork)) return true;
     
-    if (res < 0) LOGW("Failed reading work fd: %s", strerror(errno));
-    else LOGW("Truncated reading work fd: %d", res);
+    if (res < 0) ALOGW("Failed reading work fd: %s", strerror(errno));
+    else ALOGW("Truncated reading work fd: %d", res);
     return false;
 }
 
@@ -108,7 +108,7 @@
         mWorkWrite(workWrite), mConsumer(channel), mSeq(0) {
     int msgpipe[2];
     if (pipe(msgpipe)) {
-        LOGW("could not create pipe: %s", strerror(errno));
+        ALOGW("could not create pipe: %s", strerror(errno));
         mDispatchKeyRead = mDispatchKeyWrite = -1;
     } else {
         mDispatchKeyRead = msgpipe[0];
@@ -187,7 +187,7 @@
                 }
             }
             if (*outEvent == NULL) {
-                LOGW("getEvent couldn't find inflight for seq %d", finish.seq);
+                ALOGW("getEvent couldn't find inflight for seq %d", finish.seq);
             }
         }
         mLock.unlock();
@@ -211,7 +211,7 @@
     InputEvent* myEvent = NULL;
     res = mConsumer.consume(this, &myEvent);
     if (res != android::OK) {
-        LOGW("channel '%s' ~ Failed to consume input event.  status=%d",
+        ALOGW("channel '%s' ~ Failed to consume input event.  status=%d",
                 mConsumer.getChannel()->getName().string(), res);
         mConsumer.sendFinishedSignal(false);
         return -1;
@@ -265,7 +265,7 @@
             if (inflight.doFinish) {
                 int32_t res = mConsumer.sendFinishedSignal(handled);
                 if (res != android::OK) {
-                    LOGW("Failed to send finished signal on channel '%s'.  status=%d",
+                    ALOGW("Failed to send finished signal on channel '%s'.  status=%d",
                             mConsumer.getChannel()->getName().string(), res);
                 }
             }
@@ -281,7 +281,7 @@
     }
     mLock.unlock();
     
-    LOGW("finishEvent called for unknown event: %p", event);
+    ALOGW("finishEvent called for unknown event: %p", event);
 }
 
 void AInputQueue::dispatchEvent(android::KeyEvent* event) {
@@ -398,7 +398,7 @@
         }
     }
 
-    LOGW("preDispatchKey called for unknown event: %p", keyEvent);
+    ALOGW("preDispatchKey called for unknown event: %p", keyEvent);
     return false;
 }
 
@@ -412,8 +412,8 @@
 
     if (res == sizeof(dummy)) return;
 
-    if (res < 0) LOGW("Failed writing to dispatch fd: %s", strerror(errno));
-    else LOGW("Truncated writing to dispatch fd: %d", res);
+    if (res < 0) ALOGW("Failed writing to dispatch fd: %s", strerror(errno));
+    else ALOGW("Truncated writing to dispatch fd: %d", res);
 }
 
 namespace android {
@@ -629,7 +629,7 @@
             checkAndClearExceptionFromCallback(code->env, "hideIme");
         } break;
         default:
-            LOGW("Unknown work command: %d", work.cmd);
+            ALOGW("Unknown work command: %d", work.cmd);
             break;
     }
     
@@ -660,21 +660,21 @@
         env->ReleaseStringUTFChars(funcName, funcStr);
         
         if (code->createActivityFunc == NULL) {
-            LOGW("ANativeActivity_onCreate not found");
+            ALOGW("ANativeActivity_onCreate not found");
             delete code;
             return 0;
         }
         
         code->looper = android_os_MessageQueue_getLooper(env, messageQueue);
         if (code->looper == NULL) {
-            LOGW("Unable to retrieve MessageQueue's Looper");
+            ALOGW("Unable to retrieve MessageQueue's Looper");
             delete code;
             return 0;
         }
         
         int msgpipe[2];
         if (pipe(msgpipe)) {
-            LOGW("could not create pipe: %s", strerror(errno));
+            ALOGW("could not create pipe: %s", strerror(errno));
             delete code;
             return 0;
         }
@@ -690,7 +690,7 @@
         
         code->ANativeActivity::callbacks = &code->callbacks;
         if (env->GetJavaVM(&code->vm) < 0) {
-            LOGW("NativeActivity GetJavaVM failed");
+            ALOGW("NativeActivity GetJavaVM failed");
             delete code;
             return 0;
         }
diff --git a/core/jni/android_backup_BackupHelperDispatcher.cpp b/core/jni/android_backup_BackupHelperDispatcher.cpp
index 1f188ff..3e36677 100644
--- a/core/jni/android_backup_BackupHelperDispatcher.cpp
+++ b/core/jni/android_backup_BackupHelperDispatcher.cpp
@@ -58,7 +58,7 @@
     int remainingHeader = flattenedHeader.headerSize - sizeof(flattenedHeader.headerSize);
 
     if (flattenedHeader.headerSize < (int)sizeof(chunk_header_v1)) {
-        LOGW("Skipping unknown header: %d bytes", flattenedHeader.headerSize);
+        ALOGW("Skipping unknown header: %d bytes", flattenedHeader.headerSize);
         if (remainingHeader > 0) {
             lseek(fd, remainingHeader, SEEK_CUR);
             // >0 means skip this chunk
@@ -69,13 +69,13 @@
     amt = read(fd, &flattenedHeader.version,
             sizeof(chunk_header_v1)-sizeof(flattenedHeader.headerSize));
     if (amt <= 0) {
-        LOGW("Failed reading chunk header");
+        ALOGW("Failed reading chunk header");
         return -1;
     }
     remainingHeader -= sizeof(chunk_header_v1)-sizeof(flattenedHeader.headerSize);
 
     if (flattenedHeader.version != VERSION_1_HEADER) {
-        LOGW("Skipping unknown header version: 0x%08x, %d bytes", flattenedHeader.version,
+        ALOGW("Skipping unknown header version: 0x%08x, %d bytes", flattenedHeader.version,
                 flattenedHeader.headerSize);
         if (remainingHeader > 0) {
             lseek(fd, remainingHeader, SEEK_CUR);
@@ -94,14 +94,14 @@
 
     if (flattenedHeader.dataSize < 0 || flattenedHeader.nameLength < 0 ||
             remainingHeader < flattenedHeader.nameLength) {
-        LOGW("Malformed V1 header remainingHeader=%d dataSize=%d nameLength=%d", remainingHeader,
+        ALOGW("Malformed V1 header remainingHeader=%d dataSize=%d nameLength=%d", remainingHeader,
                 flattenedHeader.dataSize, flattenedHeader.nameLength);
         return -1;
     }
 
     buf = keyPrefix.lockBuffer(flattenedHeader.nameLength);
     if (buf == NULL) {
-        LOGW("unable to allocate %d bytes", flattenedHeader.nameLength);
+        ALOGW("unable to allocate %d bytes", flattenedHeader.nameLength);
         return -1;
     }
 
diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp
index 8dd3116..1f59937 100644
--- a/core/jni/android_bluetooth_HeadsetBase.cpp
+++ b/core/jni/android_bluetooth_HeadsetBase.cpp
@@ -126,7 +126,7 @@
     }
 
     if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) {
-        LOGW("RFCOMM poll() returned  success (%d), "
+        ALOGW("RFCOMM poll() returned  success (%d), "
              "but with an unexpected revents bitmask: %#x\n", ret, pfd.revents);
         errno = EIO;
         *err = errno;
diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp
index cf4cbb8..d5a034a 100644
--- a/core/jni/android_database_SQLiteDatabase.cpp
+++ b/core/jni/android_database_SQLiteDatabase.cpp
@@ -92,7 +92,7 @@
     ALOGV("Registering sqlite logging func \n");
     int err = sqlite3_config(SQLITE_CONFIG_LOG, &sqlLogger, (void *)createStr(path, 0));
     if (err != SQLITE_OK) {
-        LOGW("sqlite returned error = %d when trying to register logging func.\n", err);
+        ALOGW("sqlite returned error = %d when trying to register logging func.\n", err);
         return;
     }
     loggingFuncSet = true;
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 953da79..e192ec6 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -173,7 +173,7 @@
     // VM pointer will be NULL if object is released
     Mutex::Autolock _l(mLock);
     if (mCameraJObjectWeak == NULL) {
-        LOGW("callback on dead camera object");
+        ALOGW("callback on dead camera object");
         return;
     }
     JNIEnv *env = AndroidRuntime::getJNIEnv();
@@ -279,7 +279,7 @@
     Mutex::Autolock _l(mLock);
     JNIEnv *env = AndroidRuntime::getJNIEnv();
     if (mCameraJObjectWeak == NULL) {
-        LOGW("callback on dead camera object");
+        ALOGW("callback on dead camera object");
         return;
     }
 
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index d9908ce..9586717 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -517,14 +517,14 @@
     /* dup() the descriptor so we don't close the original with fclose() */
     int fd = dup(origFd);
     if (fd < 0) {
-        LOGW("dup(%d) failed: %s\n", origFd, strerror(errno));
+        ALOGW("dup(%d) failed: %s\n", origFd, strerror(errno));
         jniThrowRuntimeException(env, "dup() failed");
         return;
     }
 
     FILE* fp = fdopen(fd, "w");
     if (fp == NULL) {
-        LOGW("fdopen(%d) failed: %s\n", fd, strerror(errno));
+        ALOGW("fdopen(%d) failed: %s\n", fd, strerror(errno));
         close(fd);
         jniThrowRuntimeException(env, "fdopen() failed");
         return;
diff --git a/core/jni/android_server_BluetoothEventLoop.cpp b/core/jni/android_server_BluetoothEventLoop.cpp
index d146e27..1924dbf 100644
--- a/core/jni/android_server_BluetoothEventLoop.cpp
+++ b/core/jni/android_server_BluetoothEventLoop.cpp
@@ -629,7 +629,7 @@
             return;
         }
     }
-    LOGW("WatchRemove given with unknown watch");
+    ALOGW("WatchRemove given with unknown watch");
 }
 
 static void *eventLoopMain(void *ptr) {
@@ -717,7 +717,7 @@
     nat->running = false;
 
     if (nat->pollData) {
-        LOGW("trying to start EventLoop a second time!");
+        ALOGW("trying to start EventLoop a second time!");
         pthread_mutex_unlock( &(nat->thread_mutex) );
         return JNI_FALSE;
     }
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index b2ecf62..4d6bfbc 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -203,7 +203,7 @@
         gLogOffsets.mClass, gLogOffsets.mLogE, tagstr, msgstr, excep);
     if (env->ExceptionCheck()) {
         /* attempting to log the failure has failed */
-        LOGW("Failed trying to log exception, msg='%s'\n", msg);
+        ALOGW("Failed trying to log exception, msg='%s'\n", msg);
         env->ExceptionClear();
     }
 
@@ -463,11 +463,11 @@
                     (jstring) env->CallObjectMethod(objClassRef.get(), gClassOffsets.mGetName));
             ScopedUtfChars nameUtf(env, nameRef.get());
             if (nameUtf.c_str() != NULL) {
-                LOGW("BinderProxy is being destroyed but the application did not call "
+                ALOGW("BinderProxy is being destroyed but the application did not call "
                         "unlinkToDeath to unlink all of its death recipients beforehand.  "
                         "Releasing leaked death recipient: %s", nameUtf.c_str());
             } else {
-                LOGW("BinderProxy being destroyed; unable to get DR object name");
+                ALOGW("BinderProxy being destroyed; unable to get DR object name");
                 env->ExceptionClear();
             }
         }
@@ -630,7 +630,7 @@
             env->GetIntField(obj, gBinderProxyOffsets.mObject);
     }
 
-    LOGW("ibinderForJavaObject: %p is not a Binder object", obj);
+    ALOGW("ibinderForJavaObject: %p is not a Binder object", obj);
     return NULL;
 }
 
@@ -976,7 +976,7 @@
     jint len = strlen(str);
     int space_needed = 1 + sizeof(len) + len;
     if (end - *pos < space_needed) {
-        LOGW("not enough space for string. remain=%d; needed=%d",
+        ALOGW("not enough space for string. remain=%d; needed=%d",
              (end - *pos), space_needed);
         return false;
     }
@@ -992,7 +992,7 @@
 static bool push_eventlog_int(char** pos, const char* end, jint val) {
     int space_needed = 1 + sizeof(val);
     if (end - *pos < space_needed) {
-        LOGW("not enough space for int.  remain=%d; needed=%d",
+        ALOGW("not enough space for int.  remain=%d; needed=%d",
              (end - *pos), space_needed);
         return false;
     }
@@ -1117,7 +1117,7 @@
     IBinder* target = (IBinder*)
         env->GetIntField(obj, gBinderProxyOffsets.mObject);
     if (target == NULL) {
-        LOGW("Binder has been finalized when calling linkToDeath() with recip=%p)\n", recipient);
+        ALOGW("Binder has been finalized when calling linkToDeath() with recip=%p)\n", recipient);
         assert(false);
     }
 
@@ -1149,7 +1149,7 @@
     IBinder* target = (IBinder*)
         env->GetIntField(obj, gBinderProxyOffsets.mObject);
     if (target == NULL) {
-        LOGW("Binder has been finalized when calling linkToDeath() with recip=%p)\n", recipient);
+        ALOGW("Binder has been finalized when calling linkToDeath() with recip=%p)\n", recipient);
         return JNI_FALSE;
     }
 
diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp
index 8660668..9245d99 100644
--- a/core/jni/android_util_Process.cpp
+++ b/core/jni/android_util_Process.cpp
@@ -371,7 +371,7 @@
     int fd = open("/proc/meminfo", O_RDONLY);
 
     if (fd < 0) {
-        LOGW("Unable to open /proc/meminfo");
+        ALOGW("Unable to open /proc/meminfo");
         return -1;
     }
 
@@ -380,7 +380,7 @@
     close(fd);
 
     if (len < 0) {
-        LOGW("Unable to read /proc/meminfo");
+        ALOGW("Unable to read /proc/meminfo");
         return -1;
     }
     buffer[len] = 0;
@@ -479,7 +479,7 @@
         close(fd);
 
         if (len < 0) {
-            LOGW("Unable to read %s", file.string());
+            ALOGW("Unable to read %s", file.string());
             len = 0;
         }
         buffer[len] = 0;
@@ -521,7 +521,7 @@
 
         free(buffer);
     } else {
-        LOGW("Unable to open %s", file.string());
+        ALOGW("Unable to open %s", file.string());
     }
 
     //ALOGI("Done!");
@@ -759,7 +759,7 @@
     env->ReleaseStringUTFChars(file, file8);
 
     if (fd < 0) {
-        //LOGW("Unable to open process file: %s\n", file8);
+        //ALOGW("Unable to open process file: %s\n", file8);
         return JNI_FALSE;
     }
 
@@ -768,7 +768,7 @@
     close(fd);
 
     if (len < 0) {
-        //LOGW("Unable to open process file: %s fd=%d\n", file8, fd);
+        //ALOGW("Unable to open process file: %s fd=%d\n", file8, fd);
         return JNI_FALSE;
     }
     buffer[len] = 0;
diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp
index f61795d..aff4b29 100644
--- a/core/jni/android_view_DisplayEventReceiver.cpp
+++ b/core/jni/android_view_DisplayEventReceiver.cpp
@@ -84,7 +84,7 @@
 status_t NativeDisplayEventReceiver::initialize() {
     status_t result = mReceiver.initCheck();
     if (result) {
-        LOGW("Failed to initialize display event receiver, status=%d", result);
+        ALOGW("Failed to initialize display event receiver, status=%d", result);
         return result;
     }
 
@@ -103,13 +103,13 @@
         }
 
         if (n < 0) {
-            LOGW("Failed to drain events from display event receiver, status=%d", status_t(n));
+            ALOGW("Failed to drain events from display event receiver, status=%d", status_t(n));
             return status_t(n);
         }
 
         status_t status = mReceiver.requestNextVsync();
         if (status) {
-            LOGW("Failed to request next vsync, status=%d", status);
+            ALOGW("Failed to request next vsync, status=%d", status);
             return status;
         }
 
@@ -138,7 +138,7 @@
     }
 
     if (!(events & ALOOPER_EVENT_INPUT)) {
-        LOGW("Received spurious callback for unhandled poll event.  "
+        ALOGW("Received spurious callback for unhandled poll event.  "
                 "events=0x%x", events);
         return 1; // keep the callback
     }
diff --git a/core/jni/android_view_InputChannel.cpp b/core/jni/android_view_InputChannel.cpp
index 5fcf8fa..e0976a1 100644
--- a/core/jni/android_view_InputChannel.cpp
+++ b/core/jni/android_view_InputChannel.cpp
@@ -101,7 +101,7 @@
     NativeInputChannel* nativeInputChannel =
             android_view_InputChannel_getNativeInputChannel(env, inputChannelObj);
     if (nativeInputChannel == NULL) {
-        LOGW("Cannot set dispose callback because input channel object has not been initialized.");
+        ALOGW("Cannot set dispose callback because input channel object has not been initialized.");
     } else {
         nativeInputChannel->setDisposeCallback(callback, data);
     }
@@ -161,7 +161,7 @@
             android_view_InputChannel_getNativeInputChannel(env, obj);
     if (nativeInputChannel) {
         if (finalized) {
-            LOGW("Input channel object '%s' was finalized without being disposed!",
+            ALOGW("Input channel object '%s' was finalized without being disposed!",
                     nativeInputChannel->getInputChannel()->getName().string());
         }
 
diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp
index c8f1f51..c77404d 100644
--- a/core/jni/android_view_InputEventReceiver.cpp
+++ b/core/jni/android_view_InputEventReceiver.cpp
@@ -95,7 +95,7 @@
 status_t NativeInputEventReceiver::initialize() {
     status_t result = mInputConsumer.initialize();
     if (result) {
-        LOGW("Failed to initialize input consumer for input channel '%s', status=%d",
+        ALOGW("Failed to initialize input consumer for input channel '%s', status=%d",
                 getInputChannelName(), result);
         return result;
     }
@@ -114,12 +114,12 @@
 
         status_t status = mInputConsumer.sendFinishedSignal(handled);
         if (status) {
-            LOGW("Failed to send finished signal on channel '%s'.  status=%d",
+            ALOGW("Failed to send finished signal on channel '%s'.  status=%d",
                     getInputChannelName(), status);
         }
         return status;
     } else {
-        LOGW("Ignoring attempt to finish input event while no event is in progress.");
+        ALOGW("Ignoring attempt to finish input event while no event is in progress.");
         return OK;
     }
 }
@@ -134,7 +134,7 @@
     }
 
     if (!(events & ALOOPER_EVENT_INPUT)) {
-        LOGW("channel '%s' ~ Received spurious callback for unhandled poll event.  "
+        ALOGW("channel '%s' ~ Received spurious callback for unhandled poll event.  "
                 "events=0x%x", r->getInputChannelName(), events);
         return 1;
     }
@@ -147,7 +147,7 @@
     }
 
     if (r->mEventInProgress) {
-        LOGW("channel '%s' ~ Publisher sent spurious dispatch signal.",
+        ALOGW("channel '%s' ~ Publisher sent spurious dispatch signal.",
                 r->getInputChannelName());
         return 1;
     }
@@ -155,7 +155,7 @@
     InputEvent* inputEvent;
     status = r->mInputConsumer.consume(&r->mInputEventFactory, &inputEvent);
     if (status) {
-        LOGW("channel '%s' ~ Failed to consume input event.  status=%d",
+        ALOGW("channel '%s' ~ Failed to consume input event.  status=%d",
                 r->getInputChannelName(), status);
         r->mInputConsumer.sendFinishedSignal(false);
         return 1;
@@ -188,7 +188,7 @@
     }
 
     if (!inputEventObj) {
-        LOGW("channel '%s' ~ Failed to obtain event object.",
+        ALOGW("channel '%s' ~ Failed to obtain event object.",
                 r->getInputChannelName());
         r->mInputConsumer.sendFinishedSignal(false);
         return 1;
diff --git a/core/jni/android_view_KeyEvent.cpp b/core/jni/android_view_KeyEvent.cpp
index 4b04b8b..78951aa 100644
--- a/core/jni/android_view_KeyEvent.cpp
+++ b/core/jni/android_view_KeyEvent.cpp
@@ -93,7 +93,7 @@
 status_t android_view_KeyEvent_recycle(JNIEnv* env, jobject eventObj) {
     env->CallVoidMethod(eventObj, gKeyEventClassInfo.recycle);
     if (env->ExceptionCheck()) {
-        LOGW("An exception occurred while recycling a key event.");
+        ALOGW("An exception occurred while recycling a key event.");
         LOGW_EX(env);
         env->ExceptionClear();
         return UNKNOWN_ERROR;
diff --git a/core/jni/android_view_MotionEvent.cpp b/core/jni/android_view_MotionEvent.cpp
index fef06b2..fccc66e 100644
--- a/core/jni/android_view_MotionEvent.cpp
+++ b/core/jni/android_view_MotionEvent.cpp
@@ -99,7 +99,7 @@
 status_t android_view_MotionEvent_recycle(JNIEnv* env, jobject eventObj) {
     env->CallVoidMethod(eventObj, gMotionEventClassInfo.recycle);
     if (env->ExceptionCheck()) {
-        LOGW("An exception occurred while recycling a motion event.");
+        ALOGW("An exception occurred while recycling a motion event.");
         LOGW_EX(env);
         env->ExceptionClear();
         return UNKNOWN_ERROR;
diff --git a/core/jni/android_view_PointerIcon.cpp b/core/jni/android_view_PointerIcon.cpp
index 091341a..8b6dc60 100644
--- a/core/jni/android_view_PointerIcon.cpp
+++ b/core/jni/android_view_PointerIcon.cpp
@@ -43,7 +43,7 @@
     jobject pointerIconObj = env->CallStaticObjectMethod(gPointerIconClassInfo.clazz,
             gPointerIconClassInfo.getSystemIcon, contextObj, style);
     if (env->ExceptionCheck()) {
-        LOGW("An exception occurred while getting a pointer icon with style %d.", style);
+        ALOGW("An exception occurred while getting a pointer icon with style %d.", style);
         LOGW_EX(env);
         env->ExceptionClear();
         return NULL;
@@ -62,7 +62,7 @@
     jobject loadedPointerIconObj = env->CallObjectMethod(pointerIconObj,
             gPointerIconClassInfo.load, contextObj);
     if (env->ExceptionCheck() || !loadedPointerIconObj) {
-        LOGW("An exception occurred while loading a pointer icon.");
+        ALOGW("An exception occurred while loading a pointer icon.");
         LOGW_EX(env);
         env->ExceptionClear();
         return UNKNOWN_ERROR;
diff --git a/core/jni/android_view_VelocityTracker.cpp b/core/jni/android_view_VelocityTracker.cpp
index 516e421..0da90d7 100644
--- a/core/jni/android_view_VelocityTracker.cpp
+++ b/core/jni/android_view_VelocityTracker.cpp
@@ -154,7 +154,7 @@
         jobject eventObj) {
     const MotionEvent* event = android_view_MotionEvent_getNativePtr(env, eventObj);
     if (!event) {
-        LOGW("nativeAddMovement failed because MotionEvent was finalized.");
+        ALOGW("nativeAddMovement failed because MotionEvent was finalized.");
         return;
     }
 
diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp
index 67f58ca..b222b8f 100644
--- a/drm/libdrmframework/DrmManagerClientImpl.cpp
+++ b/drm/libdrmframework/DrmManagerClientImpl.cpp
@@ -54,7 +54,7 @@
             if (binder != 0) {
                 break;
             }
-            LOGW("DrmManagerService not published, waiting...");
+            ALOGW("DrmManagerService not published, waiting...");
             struct timespec reqt;
             reqt.tv_sec  = 0;
             reqt.tv_nsec = 500000000; //0.5 sec
@@ -342,6 +342,6 @@
 void DrmManagerClientImpl::DeathNotifier::binderDied(const wp<IBinder>& who) {
     Mutex::Autolock lock(sMutex);
     DrmManagerClientImpl::sDrmManagerService.clear();
-    LOGW("DrmManager server died!");
+    ALOGW("DrmManager server died!");
 }
 
diff --git a/libs/binder/Binder.cpp b/libs/binder/Binder.cpp
index 9945f91..e20d8a3 100644
--- a/libs/binder/Binder.cpp
+++ b/libs/binder/Binder.cpp
@@ -89,7 +89,7 @@
     // This is a local static rather than a global static,
     // to avoid static initializer ordering issues.
     static String16 sEmptyDescriptor;
-    LOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this);
+    ALOGW("reached BBinder::getInterfaceDescriptor (this=%p)", this);
     return sEmptyDescriptor;
 }
 
diff --git a/libs/binder/CursorWindow.cpp b/libs/binder/CursorWindow.cpp
index 0733378..19b7631 100644
--- a/libs/binder/CursorWindow.cpp
+++ b/libs/binder/CursorWindow.cpp
@@ -209,7 +209,7 @@
     uint32_t offset = mHeader->freeOffset + padding;
     uint32_t nextFreeOffset = offset + size;
     if (nextFreeOffset > mSize) {
-        LOGW("Window is full: requested allocation %d bytes, "
+        ALOGW("Window is full: requested allocation %d bytes, "
                 "free space %d bytes, window size %d bytes",
                 size, freeSpace(), mSize);
         return 0;
diff --git a/libs/binder/IServiceManager.cpp b/libs/binder/IServiceManager.cpp
index 1c1b546..33b305d 100644
--- a/libs/binder/IServiceManager.cpp
+++ b/libs/binder/IServiceManager.cpp
@@ -87,7 +87,7 @@
             
             // Is this a permission failure, or did the controller go away?
             if (pc->asBinder()->isBinderAlive()) {
-                LOGW("Permission failure: %s from uid=%d pid=%d",
+                ALOGW("Permission failure: %s from uid=%d pid=%d",
                         String8(permission).string(), uid, pid);
                 return false;
             }
diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp
index f299924..4b958d1 100644
--- a/libs/binder/MemoryDealer.cpp
+++ b/libs/binder/MemoryDealer.cpp
@@ -210,7 +210,7 @@
 #ifdef MADV_REMOVE
             if (size) {
                 int err = madvise(start_ptr, size, MADV_REMOVE);
-                LOGW_IF(err, "madvise(%p, %u, MADV_REMOVE) returned %s",
+                ALOGW_IF(err, "madvise(%p, %u, MADV_REMOVE) returned %s",
                         start_ptr, size, err<0 ? strerror(errno) : "Ok");
             }
 #endif
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index e455980..affe1a4 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -504,7 +504,7 @@
     if (str == interface) {
         return true;
     } else {
-        LOGW("**** enforceInterface() expected '%s' but read '%s'\n",
+        ALOGW("**** enforceInterface() expected '%s' but read '%s'\n",
                 String8(interface).string(), String8(str).string());
         return false;
     }
@@ -1216,7 +1216,7 @@
                 return obj;
             }
         }
-        LOGW("Attempt to read object from Parcel %p at offset %d that is not in the object list",
+        ALOGW("Attempt to read object from Parcel %p at offset %d that is not in the object list",
              this, DPOS);
     }
     return NULL;
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index f06a59e..b6d4f1a 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -317,7 +317,7 @@
             LOGE("Binder ioctl to set max threads failed: %s", strerror(errno));
         }
     } else {
-        LOGW("Opening '/dev/binder' failed: %s\n", strerror(errno));
+        ALOGW("Opening '/dev/binder' failed: %s\n", strerror(errno));
     }
     return fd;
 }
diff --git a/libs/camera/Camera.cpp b/libs/camera/Camera.cpp
index eef1dd2..d28b7f8 100644
--- a/libs/camera/Camera.cpp
+++ b/libs/camera/Camera.cpp
@@ -47,7 +47,7 @@
             binder = sm->getService(String16("media.camera"));
             if (binder != 0)
                 break;
-            LOGW("CameraService not published, waiting...");
+            ALOGW("CameraService not published, waiting...");
             usleep(500000); // 0.5 s
         } while(true);
         if (mDeathNotifier == NULL) {
@@ -397,13 +397,13 @@
     if (listener != NULL) {
         listener->postDataTimestamp(timestamp, msgType, dataPtr);
     } else {
-        LOGW("No listener was set. Drop a recording frame.");
+        ALOGW("No listener was set. Drop a recording frame.");
         releaseRecordingFrame(dataPtr);
     }
 }
 
 void Camera::binderDied(const wp<IBinder>& who) {
-    LOGW("ICamera died");
+    ALOGW("ICamera died");
     notifyCallback(CAMERA_MSG_ERROR, CAMERA_ERROR_SERVER_DIED, 0);
 }
 
@@ -411,7 +411,7 @@
     ALOGV("binderDied");
     Mutex::Autolock _l(Camera::mLock);
     Camera::mCameraService.clear();
-    LOGW("Camera server died!");
+    ALOGW("Camera server died!");
 }
 
 sp<ICameraRecordingProxy> Camera::getRecordingProxy() {
diff --git a/libs/cpustats/ThreadCpuUsage.cpp b/libs/cpustats/ThreadCpuUsage.cpp
index 4bfbdf3..c1fb365 100644
--- a/libs/cpustats/ThreadCpuUsage.cpp
+++ b/libs/cpustats/ThreadCpuUsage.cpp
@@ -99,7 +99,7 @@
         mStatistics.sample((double) mAccumulator);
         mAccumulator = 0;
     } else {
-        LOGW("Can't add sample because measurements have never been enabled");
+        ALOGW("Can't add sample because measurements have never been enabled");
     }
 }
 
@@ -119,7 +119,7 @@
                     (ts.tv_nsec - mMonotonicTs.tv_nsec);
         }
     } else {
-        LOGW("Can't compute elapsed time because measurements have never been enabled");
+        ALOGW("Can't compute elapsed time because measurements have never been enabled");
         elapsed = 0;
     }
     return elapsed;
diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp
index dafcdea..3b39601 100644
--- a/libs/gui/SensorManager.cpp
+++ b/libs/gui/SensorManager.cpp
@@ -78,7 +78,7 @@
         class DeathObserver : public IBinder::DeathRecipient {
             SensorManager& mSensorManger;
             virtual void binderDied(const wp<IBinder>& who) {
-                LOGW("sensorservice died [%p]", who.unsafe_get());
+                ALOGW("sensorservice died [%p]", who.unsafe_get());
                 mSensorManger.sensorManagerDied();
             }
         public:
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 104cefb..62ab92d 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -65,7 +65,7 @@
 #define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__)
-#define ST_LOGW(x, ...) LOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
+#define ST_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__)
 #define ST_LOGE(x, ...) LOGE("[%s] "x, mName.string(), ##__VA_ARGS__)
 
 namespace android {
@@ -352,7 +352,7 @@
                 }
 
                 // if buffer is FREE it CANNOT be current
-                LOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i),
+                ALOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i),
                         "dequeueBuffer: buffer %d is both FREE and current!",
                         i);
 
@@ -992,7 +992,7 @@
 }
 
 void SurfaceTexture::freeAllBuffersLocked() {
-    LOGW_IF(!mQueue.isEmpty(),
+    ALOGW_IF(!mQueue.isEmpty(),
             "freeAllBuffersLocked called but mQueue is not empty");
     mCurrentTexture = INVALID_BUFFER_SLOT;
     for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
@@ -1001,7 +1001,7 @@
 }
 
 void SurfaceTexture::freeAllBuffersExceptHeadLocked() {
-    LOGW_IF(!mQueue.isEmpty(),
+    ALOGW_IF(!mQueue.isEmpty(),
             "freeAllBuffersExceptCurrentLocked called but mQueue is not empty");
     int head = -1;
     if (!mQueue.empty()) {
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index b6f3c11..aaff897 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -663,7 +663,7 @@
                     GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
                     newDirtyRegion.bounds(), &vaddr);
 
-            LOGW_IF(res, "failed locking buffer (handle = %p)",
+            ALOGW_IF(res, "failed locking buffer (handle = %p)",
                     backBuffer->handle);
 
             mLockedBuffer = backBuffer;
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index fa1e9b8..d1af1a3 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -50,7 +50,7 @@
     GLint maxTextureUnits;
     glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
     if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
-        LOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT);
+        ALOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT);
     }
 
     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index f122396..e320eb2 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -185,14 +185,14 @@
     Caches& caches = Caches::getInstance();
     GLuint fbo = caches.fboCache.get();
     if (!fbo) {
-        LOGW("Could not obtain an FBO");
+        ALOGW("Could not obtain an FBO");
         return NULL;
     }
 
     caches.activeTexture(0);
     Layer* layer = caches.layerCache.get(width, height);
     if (!layer) {
-        LOGW("Could not obtain a layer");
+        ALOGW("Could not obtain a layer");
         return NULL;
     }
 
@@ -360,7 +360,7 @@
 
         GLuint fbo = caches.fboCache.get();
         if (!fbo) {
-            LOGW("Could not obtain an FBO");
+            ALOGW("Could not obtain an FBO");
             return false;
         }
 
diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h
index 2c0f3ab..b60ef4c 100644
--- a/libs/hwui/ShapeCache.h
+++ b/libs/hwui/ShapeCache.h
@@ -503,7 +503,7 @@
     const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5);
 
     if (width > mMaxTextureSize || height > mMaxTextureSize) {
-        LOGW("Shape %s too large to be rendered into a texture (%dx%d, max=%dx%d)",
+        ALOGW("Shape %s too large to be rendered into a texture (%dx%d, max=%dx%d)",
                 mName, width, height, mMaxTextureSize, mMaxTextureSize);
         return NULL;
     }
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 237911b..3f46a30 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -125,7 +125,7 @@
 
     if (!texture) {
         if (bitmap->width() > mMaxTextureSize || bitmap->height() > mMaxTextureSize) {
-            LOGW("Bitmap too large to be uploaded into a texture (%dx%d, max=%dx%d)",
+            ALOGW("Bitmap too large to be uploaded into a texture (%dx%d, max=%dx%d)",
                     bitmap->width(), bitmap->height(), mMaxTextureSize, mMaxTextureSize);
             return NULL;
         }
@@ -249,7 +249,7 @@
         texture->blend = !bitmap->isOpaque();
         break;
     default:
-        LOGW("Unsupported bitmap config: %d", bitmap->getConfig());
+        ALOGW("Unsupported bitmap config: %d", bitmap->getConfig());
         break;
     }
 
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index b2b70c1..466fce6 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -101,7 +101,7 @@
     
     err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
 
-    LOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)",
+    ALOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)",
             w, h, format, usage, err, strerror(-err));
     
     if (err == NO_ERROR) {
@@ -132,7 +132,7 @@
 
     err = mAllocDev->free(mAllocDev, handle);
 
-    LOGW_IF(err, "free(...) failed %d (%s)", err, strerror(-err));
+    ALOGW_IF(err, "free(...) failed %d (%s)", err, strerror(-err));
     if (err == NO_ERROR) {
         Mutex::Autolock _l(sLock);
         KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index 07c0674..ac53da8 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -50,7 +50,7 @@
 
     err = mAllocMod->registerBuffer(mAllocMod, handle);
 
-    LOGW_IF(err, "registerBuffer(%p) failed %d (%s)",
+    ALOGW_IF(err, "registerBuffer(%p) failed %d (%s)",
             handle, err, strerror(-err));
     return err;
 }
@@ -61,7 +61,7 @@
 
     err = mAllocMod->unregisterBuffer(mAllocMod, handle);
 
-    LOGW_IF(err, "unregisterBuffer(%p) failed %d (%s)",
+    ALOGW_IF(err, "unregisterBuffer(%p) failed %d (%s)",
             handle, err, strerror(-err));
     return err;
 }
@@ -75,7 +75,7 @@
             bounds.left, bounds.top, bounds.width(), bounds.height(),
             vaddr);
 
-    LOGW_IF(err, "lock(...) failed %d (%s)", err, strerror(-err));
+    ALOGW_IF(err, "lock(...) failed %d (%s)", err, strerror(-err));
     return err;
 }
 
@@ -85,7 +85,7 @@
 
     err = mAllocMod->unlock(mAllocMod, handle);
 
-    LOGW_IF(err, "unlock(...) failed %d (%s)", err, strerror(-err));
+    ALOGW_IF(err, "unlock(...) failed %d (%s)", err, strerror(-err));
     return err;
 }
 
diff --git a/libs/ui/Input.cpp b/libs/ui/Input.cpp
index 267a9f7..263c8d9 100644
--- a/libs/ui/Input.cpp
+++ b/libs/ui/Input.cpp
@@ -345,7 +345,7 @@
 #endif
 
 void PointerCoords::tooManyAxes(int axis) {
-    LOGW("Could not set value for axis %d because the PointerCoords structure is full and "
+    ALOGW("Could not set value for axis %d because the PointerCoords structure is full and "
             "cannot contain more than %d axis values.", axis, int(MAX_AXES));
 }
 
diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp
index 07693bb..22af816 100644
--- a/libs/utils/Asset.cpp
+++ b/libs/utils/Asset.cpp
@@ -327,14 +327,14 @@
         newOffset = maxPosn + offset;
         break;
     default:
-        LOGW("unexpected whence %d\n", whence);
+        ALOGW("unexpected whence %d\n", whence);
         // this was happening due to an off64_t size mismatch
         assert(false);
         return (off64_t) -1;
     }
 
     if (newOffset < 0 || newOffset > maxPosn) {
-        LOGW("seek out of range: want %ld, end=%ld\n",
+        ALOGW("seek out of range: want %ld, end=%ld\n",
             (long) newOffset, (long) maxPosn);
         return (off64_t) -1;
     }
@@ -855,7 +855,7 @@
      */
     buf = new unsigned char[mUncompressedLen];
     if (buf == NULL) {
-        LOGW("alloc %ld bytes failed\n", (long) mUncompressedLen);
+        ALOGW("alloc %ld bytes failed\n", (long) mUncompressedLen);
         goto bail;
     }
 
diff --git a/libs/utils/AssetManager.cpp b/libs/utils/AssetManager.cpp
index 77db3d4..8a8551f 100644
--- a/libs/utils/AssetManager.cpp
+++ b/libs/utils/AssetManager.cpp
@@ -151,7 +151,7 @@
         ap.path = path;
         ap.type = ::getFileType(path.string());
         if (ap.type != kFileTypeDirectory && ap.type != kFileTypeRegular) {
-            LOGW("Asset path %s is neither a directory nor file (type=%d).",
+            ALOGW("Asset path %s is neither a directory nor file (type=%d).",
                  path.string(), (int)ap.type);
             return false;
         }
@@ -200,7 +200,7 @@
             if (addOverlay) {
                 mAssetPaths.add(oap);
             } else {
-                LOGW("failed to add overlay package %s\n", overlayPath.string());
+                ALOGW("failed to add overlay package %s\n", overlayPath.string());
             }
         }
     }
@@ -216,17 +216,17 @@
         if (errno == ENOENT) {
             return true; // non-existing idmap is always stale
         } else {
-            LOGW("failed to stat file %s: %s\n", idmapPath.string(), strerror(errno));
+            ALOGW("failed to stat file %s: %s\n", idmapPath.string(), strerror(errno));
             return false;
         }
     }
     if (st.st_size < ResTable::IDMAP_HEADER_SIZE_BYTES) {
-        LOGW("file %s has unexpectedly small size=%zd\n", idmapPath.string(), (size_t)st.st_size);
+        ALOGW("file %s has unexpectedly small size=%zd\n", idmapPath.string(), (size_t)st.st_size);
         return false;
     }
     int fd = TEMP_FAILURE_RETRY(::open(idmapPath.string(), O_RDONLY));
     if (fd == -1) {
-        LOGW("failed to open file %s: %s\n", idmapPath.string(), strerror(errno));
+        ALOGW("failed to open file %s: %s\n", idmapPath.string(), strerror(errno));
         return false;
     }
     char buf[ResTable::IDMAP_HEADER_SIZE_BYTES];
@@ -300,24 +300,24 @@
         ap.path = *paths[i];
         Asset* ass = openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap);
         if (ass == NULL) {
-            LOGW("failed to find resources.arsc in %s\n", ap.path.string());
+            ALOGW("failed to find resources.arsc in %s\n", ap.path.string());
             goto error;
         }
         tables[i].add(ass, (void*)1, false);
     }
 
     if (!getZipEntryCrcLocked(originalPath, "resources.arsc", &originalCrc)) {
-        LOGW("failed to retrieve crc for resources.arsc in %s\n", originalPath.string());
+        ALOGW("failed to retrieve crc for resources.arsc in %s\n", originalPath.string());
         goto error;
     }
     if (!getZipEntryCrcLocked(overlayPath, "resources.arsc", &overlayCrc)) {
-        LOGW("failed to retrieve crc for resources.arsc in %s\n", overlayPath.string());
+        ALOGW("failed to retrieve crc for resources.arsc in %s\n", overlayPath.string());
         goto error;
     }
 
     if (tables[0].createIdmap(tables[1], originalCrc, overlayCrc,
                               (void**)&data, &size) != NO_ERROR) {
-        LOGW("failed to generate idmap data for file %s\n", idmapPath.string());
+        ALOGW("failed to generate idmap data for file %s\n", idmapPath.string());
         goto error;
     }
 
@@ -326,13 +326,13 @@
     // installd).
     fd = TEMP_FAILURE_RETRY(::open(idmapPath.string(), O_WRONLY | O_CREAT | O_TRUNC, 0644));
     if (fd == -1) {
-        LOGW("failed to write idmap file %s (open: %s)\n", idmapPath.string(), strerror(errno));
+        ALOGW("failed to write idmap file %s (open: %s)\n", idmapPath.string(), strerror(errno));
         goto error_free;
     }
     for (;;) {
         ssize_t written = TEMP_FAILURE_RETRY(write(fd, data + offset, size));
         if (written < 0) {
-            LOGW("failed to write idmap file %s (write: %s)\n", idmapPath.string(),
+            ALOGW("failed to write idmap file %s (write: %s)\n", idmapPath.string(),
                  strerror(errno));
             goto error_close;
         }
@@ -686,7 +686,7 @@
         }
     }
 
-    if (required && !rt) LOGW("Unable to find resources file resources.arsc");
+    if (required && !rt) ALOGW("Unable to find resources file resources.arsc");
     if (!rt) {
         mResources = rt = new ResTable();
     }
@@ -727,7 +727,7 @@
         if (ass) {
             ALOGV("loading idmap %s\n", ap.idmap.string());
         } else {
-            LOGW("failed to load idmap %s\n", ap.idmap.string());
+            ALOGW("failed to load idmap %s\n", ap.idmap.string());
         }
     }
     return ass;
@@ -1074,13 +1074,13 @@
     if (!pZipFile->getEntryInfo(entry, &method, &uncompressedLen, NULL, NULL,
             NULL, NULL))
     {
-        LOGW("getEntryInfo failed\n");
+        ALOGW("getEntryInfo failed\n");
         return NULL;
     }
 
     FileMap* dataMap = pZipFile->createEntryFileMap(entry);
     if (dataMap == NULL) {
-        LOGW("create map from entry failed\n");
+        ALOGW("create map from entry failed\n");
         return NULL;
     }
 
@@ -1096,7 +1096,7 @@
     }
     if (pAsset == NULL) {
         /* unexpected */
-        LOGW("create from segment failed\n");
+        ALOGW("create from segment failed\n");
     }
 
     return pAsset;
@@ -1427,7 +1427,7 @@
 
     pZip = mZipSet.getZip(ap.path);
     if (pZip == NULL) {
-        LOGW("Failure opening zip %s\n", ap.path.string());
+        ALOGW("Failure opening zip %s\n", ap.path.string());
         return false;
     }
 
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp
index 882bf71..04b2e71 100644
--- a/libs/utils/BackupHelpers.cpp
+++ b/libs/utils/BackupHelpers.cpp
@@ -100,7 +100,7 @@
     bytesRead += amt;
 
     if (header.magic0 != MAGIC0 || header.magic1 != MAGIC1) {
-        LOGW("read_snapshot_file header.magic0=0x%08x magic1=0x%08x", header.magic0, header.magic1);
+        ALOGW("read_snapshot_file header.magic0=0x%08x magic1=0x%08x", header.magic0, header.magic1);
         return 1;
     }
 
@@ -110,7 +110,7 @@
 
         amt = read(fd, &file, sizeof(FileState));
         if (amt != sizeof(FileState)) {
-            LOGW("read_snapshot_file FileState truncated/error with read at %d bytes\n", bytesRead);
+            ALOGW("read_snapshot_file FileState truncated/error with read at %d bytes\n", bytesRead);
             return 1;
         }
         bytesRead += amt;
@@ -129,13 +129,13 @@
             free(filename);
         }
         if (amt != nameBufSize) {
-            LOGW("read_snapshot_file filename truncated/error with read at %d bytes\n", bytesRead);
+            ALOGW("read_snapshot_file filename truncated/error with read at %d bytes\n", bytesRead);
             return 1;
         }
     }
 
     if (header.totalSize != bytesRead) {
-        LOGW("read_snapshot_file length mismatch: header.totalSize=%d bytesRead=%d\n",
+        ALOGW("read_snapshot_file length mismatch: header.totalSize=%d bytesRead=%d\n",
                 header.totalSize, bytesRead);
         return 1;
     }
@@ -166,7 +166,7 @@
 
     amt = write(fd, &header, sizeof(header));
     if (amt != sizeof(header)) {
-        LOGW("write_snapshot_file error writing header %s", strerror(errno));
+        ALOGW("write_snapshot_file error writing header %s", strerror(errno));
         return errno;
     }
 
@@ -178,14 +178,14 @@
 
             amt = write(fd, &r.s, sizeof(FileState));
             if (amt != sizeof(FileState)) {
-                LOGW("write_snapshot_file error writing header %s", strerror(errno));
+                ALOGW("write_snapshot_file error writing header %s", strerror(errno));
                 return 1;
             }
 
             // filename is not NULL terminated, but it is padded
             amt = write(fd, name.string(), nameLen);
             if (amt != nameLen) {
-                LOGW("write_snapshot_file error writing filename %s", strerror(errno));
+                ALOGW("write_snapshot_file error writing filename %s", strerror(errno));
                 return 1;
             }
             int paddingLen = ROUND_UP[nameLen % 4];
@@ -193,7 +193,7 @@
                 int padding = 0xabababab;
                 amt = write(fd, &padding, paddingLen);
                 if (amt != paddingLen) {
-                    LOGW("write_snapshot_file error writing %d bytes of filename padding %s",
+                    ALOGW("write_snapshot_file error writing %d bytes of filename padding %s",
                             paddingLen, strerror(errno));
                     return 1;
                 }
@@ -591,7 +591,7 @@
     } else if (S_ISREG(s.st_mode)) {
         type = '0';     // tar magic: '0' == normal file
     } else {
-        LOGW("Error: unknown file mode 0%o [%s]", s.st_mode, filepath.string());
+        ALOGW("Error: unknown file mode 0%o [%s]", s.st_mode, filepath.string());
         goto cleanup;
     }
     buf[156] = type;
@@ -759,7 +759,7 @@
     file_metadata_v1 metadata;
     amt = in->ReadEntityData(&metadata, sizeof(metadata));
     if (amt != sizeof(metadata)) {
-        LOGW("Could not read metadata for %s -- %ld / %s", filename.string(),
+        ALOGW("Could not read metadata for %s -- %ld / %s", filename.string(),
                 (long)amt, strerror(errno));
         return EIO;
     }
@@ -768,7 +768,7 @@
     if (metadata.version > CURRENT_METADATA_VERSION) {
         if (!m_loggedUnknownMetadata) {
             m_loggedUnknownMetadata = true;
-            LOGW("Restoring file with unsupported metadata version %d (currently %d)",
+            ALOGW("Restoring file with unsupported metadata version %d (currently %d)",
                     metadata.version, CURRENT_METADATA_VERSION);
         }
     }
@@ -778,7 +778,7 @@
     crc = crc32(0L, Z_NULL, 0);
     fd = open(filename.string(), O_CREAT|O_RDWR|O_TRUNC, mode);
     if (fd == -1) {
-        LOGW("Could not open file %s -- %s", filename.string(), strerror(errno));
+        ALOGW("Could not open file %s -- %s", filename.string(), strerror(errno));
         return errno;
     }
     
@@ -786,7 +786,7 @@
         err = write(fd, buf, amt);
         if (err != amt) {
             close(fd);
-            LOGW("Error '%s' writing '%s'", strerror(errno), filename.string());
+            ALOGW("Error '%s' writing '%s'", strerror(errno), filename.string());
             return errno;
         }
         crc = crc32(crc, (Bytef*)buf, amt);
@@ -797,7 +797,7 @@
     // Record for the snapshot
     err = stat(filename.string(), &st);
     if (err != 0) {
-        LOGW("Error stating file that we just created %s", filename.string());
+        ALOGW("Error stating file that we just created %s", filename.string());
         return errno;
     }
 
diff --git a/libs/utils/BlobCache.cpp b/libs/utils/BlobCache.cpp
index 4970828..0011d29 100644
--- a/libs/utils/BlobCache.cpp
+++ b/libs/utils/BlobCache.cpp
@@ -69,11 +69,11 @@
         return;
     }
     if (keySize == 0) {
-        LOGW("set: not caching because keySize is 0");
+        ALOGW("set: not caching because keySize is 0");
         return;
     }
     if (valueSize <= 0) {
-        LOGW("set: not caching because valueSize is 0");
+        ALOGW("set: not caching because valueSize is 0");
         return;
     }
 
diff --git a/libs/utils/FileMap.cpp b/libs/utils/FileMap.cpp
index b2a61f1..c9a423e 100644
--- a/libs/utils/FileMap.cpp
+++ b/libs/utils/FileMap.cpp
@@ -217,7 +217,7 @@
 
     cc = madvise(mBasePtr, mBaseLength, sysAdvice);
     if (cc != 0)
-        LOGW("madvise(%d) failed: %s\n", sysAdvice, strerror(errno));
+        ALOGW("madvise(%d) failed: %s\n", sysAdvice, strerror(errno));
     return cc;
 #else
 	return -1;
diff --git a/libs/utils/Looper.cpp b/libs/utils/Looper.cpp
index 1bc92cf..28ed0e8 100644
--- a/libs/utils/Looper.cpp
+++ b/libs/utils/Looper.cpp
@@ -163,7 +163,7 @@
         Looper::setForThread(looper);
     }
     if (looper->getAllowNonCallbacks() != allowNonCallbacks) {
-        LOGW("Looper already prepared for this thread with a different value for the "
+        ALOGW("Looper already prepared for this thread with a different value for the "
                 "ALOOPER_PREPARE_ALLOW_NON_CALLBACKS option.");
     }
     return looper;
@@ -262,7 +262,7 @@
         if (errno == EINTR) {
             goto Done;
         }
-        LOGW("Poll failed with an unexpected error, errno=%d", errno);
+        ALOGW("Poll failed with an unexpected error, errno=%d", errno);
         result = ALOOPER_POLL_ERROR;
         goto Done;
     }
@@ -289,7 +289,7 @@
             if (epollEvents & EPOLLIN) {
                 awoken();
             } else {
-                LOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents);
+                ALOGW("Ignoring unexpected epoll events 0x%x on wake read pipe.", epollEvents);
             }
         } else {
             ssize_t requestIndex = mRequests.indexOfKey(fd);
@@ -301,7 +301,7 @@
                 if (epollEvents & EPOLLHUP) events |= ALOOPER_EVENT_HANGUP;
                 pushResponse(events, mRequests.valueAt(requestIndex));
             } else {
-                LOGW("Ignoring unexpected epoll events 0x%x on fd %d that is "
+                ALOGW("Ignoring unexpected epoll events 0x%x on fd %d that is "
                         "no longer registered.", epollEvents, fd);
             }
         }
@@ -317,7 +317,7 @@
                 if (pollEvents & POLLIN) {
                     awoken();
                 } else {
-                    LOGW("Ignoring unexpected poll events 0x%x on wake read pipe.", pollEvents);
+                    ALOGW("Ignoring unexpected poll events 0x%x on wake read pipe.", pollEvents);
                 }
             } else {
                 int events = 0;
@@ -468,7 +468,7 @@
 
     if (nWrite != 1) {
         if (errno != EAGAIN) {
-            LOGW("Could not write wake signal, errno=%d", errno);
+            ALOGW("Could not write wake signal, errno=%d", errno);
         }
     }
 }
diff --git a/libs/utils/ObbFile.cpp b/libs/utils/ObbFile.cpp
index 11fe1e9..ddf5991 100644
--- a/libs/utils/ObbFile.cpp
+++ b/libs/utils/ObbFile.cpp
@@ -90,14 +90,14 @@
 
     fd = ::open(filename, O_RDONLY);
     if (fd < 0) {
-        LOGW("couldn't open file %s: %s", filename, strerror(errno));
+        ALOGW("couldn't open file %s: %s", filename, strerror(errno));
         goto out;
     }
     success = readFrom(fd);
     close(fd);
 
     if (!success) {
-        LOGW("failed to read from %s (fd=%d)\n", filename, fd);
+        ALOGW("failed to read from %s (fd=%d)\n", filename, fd);
     }
 
 out:
@@ -107,7 +107,7 @@
 bool ObbFile::readFrom(int fd)
 {
     if (fd < 0) {
-        LOGW("attempt to read from invalid fd\n");
+        ALOGW("attempt to read from invalid fd\n");
         return false;
     }
 
@@ -120,9 +120,9 @@
 
     if (fileLength < kFooterMinSize) {
         if (fileLength < 0) {
-            LOGW("error seeking in ObbFile: %s\n", strerror(errno));
+            ALOGW("error seeking in ObbFile: %s\n", strerror(errno));
         } else {
-            LOGW("file is only %lld (less than %d minimum)\n", fileLength, kFooterMinSize);
+            ALOGW("file is only %lld (less than %d minimum)\n", fileLength, kFooterMinSize);
         }
         return false;
     }
@@ -136,13 +136,13 @@
         char *footer = new char[kFooterTagSize];
         actual = TEMP_FAILURE_RETRY(read(fd, footer, kFooterTagSize));
         if (actual != kFooterTagSize) {
-            LOGW("couldn't read footer signature: %s\n", strerror(errno));
+            ALOGW("couldn't read footer signature: %s\n", strerror(errno));
             return false;
         }
 
         unsigned int fileSig = get4LE((unsigned char*)footer + sizeof(int32_t));
         if (fileSig != kSignature) {
-            LOGW("footer didn't match magic string (expected 0x%08x; got 0x%08x)\n",
+            ALOGW("footer didn't match magic string (expected 0x%08x; got 0x%08x)\n",
                     kSignature, fileSig);
             return false;
         }
@@ -150,13 +150,13 @@
         footerSize = get4LE((unsigned char*)footer);
         if (footerSize > (size_t)fileLength - kFooterTagSize
                 || footerSize > kMaxBufSize) {
-            LOGW("claimed footer size is too large (0x%08zx; file size is 0x%08llx)\n",
+            ALOGW("claimed footer size is too large (0x%08zx; file size is 0x%08llx)\n",
                     footerSize, fileLength);
             return false;
         }
 
         if (footerSize < (kFooterMinSize - kFooterTagSize)) {
-            LOGW("claimed footer size is too small (0x%zx; minimum size is 0x%x)\n",
+            ALOGW("claimed footer size is too small (0x%zx; minimum size is 0x%x)\n",
                     footerSize, kFooterMinSize - kFooterTagSize);
             return false;
         }
@@ -164,7 +164,7 @@
 
     off64_t fileOffset = fileLength - footerSize - kFooterTagSize;
     if (lseek64(fd, fileOffset, SEEK_SET) != fileOffset) {
-        LOGW("seek %lld failed: %s\n", fileOffset, strerror(errno));
+        ALOGW("seek %lld failed: %s\n", fileOffset, strerror(errno));
         return false;
     }
 
@@ -172,7 +172,7 @@
 
     char* scanBuf = (char*)malloc(footerSize);
     if (scanBuf == NULL) {
-        LOGW("couldn't allocate scanBuf: %s\n", strerror(errno));
+        ALOGW("couldn't allocate scanBuf: %s\n", strerror(errno));
         return false;
     }
 
@@ -192,7 +192,7 @@
 
     uint32_t sigVersion = get4LE((unsigned char*)scanBuf);
     if (sigVersion != kSigVersion) {
-        LOGW("Unsupported ObbFile version %d\n", sigVersion);
+        ALOGW("Unsupported ObbFile version %d\n", sigVersion);
         free(scanBuf);
         return false;
     }
@@ -205,7 +205,7 @@
     size_t packageNameLen = get4LE((unsigned char*)scanBuf + kPackageNameLenOffset);
     if (packageNameLen == 0
             || packageNameLen > (footerSize - kPackageNameOffset)) {
-        LOGW("bad ObbFile package name length (0x%04zx; 0x%04zx possible)\n",
+        ALOGW("bad ObbFile package name length (0x%04zx; 0x%04zx possible)\n",
                 packageNameLen, footerSize - kPackageNameOffset);
         free(scanBuf);
         return false;
@@ -237,7 +237,7 @@
 
 out:
     if (!success) {
-        LOGW("failed to write to %s: %s\n", filename, strerror(errno));
+        ALOGW("failed to write to %s: %s\n", filename, strerror(errno));
     }
     return success;
 }
@@ -251,7 +251,7 @@
     lseek64(fd, 0, SEEK_END);
 
     if (mPackageName.size() == 0 || mVersion == -1) {
-        LOGW("tried to write uninitialized ObbFile data\n");
+        ALOGW("tried to write uninitialized ObbFile data\n");
         return false;
     }
 
@@ -260,48 +260,48 @@
 
     put4LE(intBuf, kSigVersion);
     if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) {
-        LOGW("couldn't write signature version: %s\n", strerror(errno));
+        ALOGW("couldn't write signature version: %s\n", strerror(errno));
         return false;
     }
 
     put4LE(intBuf, mVersion);
     if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) {
-        LOGW("couldn't write package version\n");
+        ALOGW("couldn't write package version\n");
         return false;
     }
 
     put4LE(intBuf, mFlags);
     if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) {
-        LOGW("couldn't write package version\n");
+        ALOGW("couldn't write package version\n");
         return false;
     }
 
     if (write(fd, mSalt, sizeof(mSalt)) != (ssize_t)sizeof(mSalt)) {
-        LOGW("couldn't write salt: %s\n", strerror(errno));
+        ALOGW("couldn't write salt: %s\n", strerror(errno));
         return false;
     }
 
     size_t packageNameLen = mPackageName.size();
     put4LE(intBuf, packageNameLen);
     if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) {
-        LOGW("couldn't write package name length: %s\n", strerror(errno));
+        ALOGW("couldn't write package name length: %s\n", strerror(errno));
         return false;
     }
 
     if (write(fd, mPackageName.string(), packageNameLen) != (ssize_t)packageNameLen) {
-        LOGW("couldn't write package name: %s\n", strerror(errno));
+        ALOGW("couldn't write package name: %s\n", strerror(errno));
         return false;
     }
 
     put4LE(intBuf, kPackageNameOffset + packageNameLen);
     if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) {
-        LOGW("couldn't write footer size: %s\n", strerror(errno));
+        ALOGW("couldn't write footer size: %s\n", strerror(errno));
         return false;
     }
 
     put4LE(intBuf, kSignature);
     if (write(fd, &intBuf, sizeof(uint32_t)) != (ssize_t)sizeof(uint32_t)) {
-        LOGW("couldn't write footer magic signature: %s\n", strerror(errno));
+        ALOGW("couldn't write footer magic signature: %s\n", strerror(errno));
         return false;
     }
 
@@ -322,7 +322,7 @@
 
 out:
     if (!success) {
-        LOGW("failed to remove signature from %s: %s\n", filename, strerror(errno));
+        ALOGW("failed to remove signature from %s: %s\n", filename, strerror(errno));
     }
     return success;
 }
diff --git a/libs/utils/PropertyMap.cpp b/libs/utils/PropertyMap.cpp
index 99603ab..d801609 100644
--- a/libs/utils/PropertyMap.cpp
+++ b/libs/utils/PropertyMap.cpp
@@ -84,7 +84,7 @@
     char* end;
     int value = strtol(stringValue.string(), & end, 10);
     if (*end != '\0') {
-        LOGW("Property key '%s' has invalid value '%s'.  Expected an integer.",
+        ALOGW("Property key '%s' has invalid value '%s'.  Expected an integer.",
                 key.string(), stringValue.string());
         return false;
     }
@@ -101,7 +101,7 @@
     char* end;
     float value = strtof(stringValue.string(), & end);
     if (*end != '\0') {
-        LOGW("Property key '%s' has invalid value '%s'.  Expected a float.",
+        ALOGW("Property key '%s' has invalid value '%s'.  Expected a float.",
                 key.string(), stringValue.string());
         return false;
     }
diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp
index 3569e32..9a8816f 100644
--- a/libs/utils/ResourceTypes.cpp
+++ b/libs/utils/ResourceTypes.cpp
@@ -107,20 +107,20 @@
                 if ((ssize_t)size <= (dataEnd-((const uint8_t*)chunk))) {
                     return NO_ERROR;
                 }
-                LOGW("%s data size %p extends beyond resource end %p.",
+                ALOGW("%s data size %p extends beyond resource end %p.",
                      name, (void*)size,
                      (void*)(dataEnd-((const uint8_t*)chunk)));
                 return BAD_TYPE;
             }
-            LOGW("%s size 0x%x or headerSize 0x%x is not on an integer boundary.",
+            ALOGW("%s size 0x%x or headerSize 0x%x is not on an integer boundary.",
                  name, (int)size, (int)headerSize);
             return BAD_TYPE;
         }
-        LOGW("%s size %p is smaller than header size %p.",
+        ALOGW("%s size %p is smaller than header size %p.",
              name, (void*)size, (void*)(int)headerSize);
         return BAD_TYPE;
     }
-    LOGW("%s header size %p is too small.",
+    ALOGW("%s header size %p is too small.",
          name, (void*)(int)headerSize);
     return BAD_TYPE;
 }
@@ -221,11 +221,11 @@
 static bool assertIdmapHeader(const uint32_t* map, size_t sizeBytes)
 {
     if (sizeBytes < ResTable::IDMAP_HEADER_SIZE_BYTES) {
-        LOGW("idmap assertion failed: size=%d bytes\n", sizeBytes);
+        ALOGW("idmap assertion failed: size=%d bytes\n", sizeBytes);
         return false;
     }
     if (*map != htodl(IDMAP_MAGIC)) { // htodl: map data expected to be in correct endianess
-        LOGW("idmap assertion failed: invalid magic found (is 0x%08x, expected 0x%08x)\n",
+        ALOGW("idmap assertion failed: invalid magic found (is 0x%08x, expected 0x%08x)\n",
              *map, htodl(IDMAP_MAGIC));
         return false;
     }
@@ -246,11 +246,11 @@
     const uint32_t typeCount = *map;
 
     if (type > typeCount) {
-        LOGW("Resource ID map: type=%d exceeds number of types=%d\n", type, typeCount);
+        ALOGW("Resource ID map: type=%d exceeds number of types=%d\n", type, typeCount);
         return UNKNOWN_ERROR;
     }
     if (typeCount > size) {
-        LOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, size);
+        ALOGW("Resource ID map: number of types=%d exceeds size of map=%d\n", typeCount, size);
         return UNKNOWN_ERROR;
     }
     const uint32_t typeOffset = map[type];
@@ -259,7 +259,7 @@
         return NO_ERROR;
     }
     if (typeOffset + 1 > size) {
-        LOGW("Resource ID map: type offset=%d exceeds reasonable value, size of map=%d\n",
+        ALOGW("Resource ID map: type offset=%d exceeds reasonable value, size of map=%d\n",
              typeOffset, size);
         return UNKNOWN_ERROR;
     }
@@ -271,7 +271,7 @@
     }
     const uint32_t index = typeOffset + 2 + entry - entryOffset;
     if (index > size) {
-        LOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, size);
+        ALOGW("Resource ID map: entry index=%d exceeds size of map=%d\n", index, size);
         *outValue = 0;
         return NO_ERROR;
     }
@@ -358,7 +358,7 @@
 
     if (mHeader->header.headerSize > mHeader->header.size
             || mHeader->header.size > size) {
-        LOGW("Bad string block: header size %d or total size %d is larger than data size %d\n",
+        ALOGW("Bad string block: header size %d or total size %d is larger than data size %d\n",
                 (int)mHeader->header.headerSize, (int)mHeader->header.size, (int)size);
         return (mError=BAD_TYPE);
     }
@@ -370,7 +370,7 @@
         if ((mHeader->stringCount*sizeof(uint32_t) < mHeader->stringCount)  // uint32 overflow?
             || (mHeader->header.headerSize+(mHeader->stringCount*sizeof(uint32_t)))
                 > size) {
-            LOGW("Bad string block: entry of %d items extends past data size %d\n",
+            ALOGW("Bad string block: entry of %d items extends past data size %d\n",
                     (int)(mHeader->header.headerSize+(mHeader->stringCount*sizeof(uint32_t))),
                     (int)size);
             return (mError=BAD_TYPE);
@@ -388,7 +388,7 @@
         mStrings = (const void*)
             (((const uint8_t*)data)+mHeader->stringsStart);
         if (mHeader->stringsStart >= (mHeader->header.size-sizeof(uint16_t))) {
-            LOGW("Bad string block: string pool starts at %d, after total size %d\n",
+            ALOGW("Bad string block: string pool starts at %d, after total size %d\n",
                     (int)mHeader->stringsStart, (int)mHeader->header.size);
             return (mError=BAD_TYPE);
         }
@@ -398,13 +398,13 @@
         } else {
             // check invariant: styles starts before end of data
             if (mHeader->stylesStart >= (mHeader->header.size-sizeof(uint16_t))) {
-                LOGW("Bad style block: style block starts at %d past data size of %d\n",
+                ALOGW("Bad style block: style block starts at %d past data size of %d\n",
                     (int)mHeader->stylesStart, (int)mHeader->header.size);
                 return (mError=BAD_TYPE);
             }
             // check invariant: styles follow the strings
             if (mHeader->stylesStart <= mHeader->stringsStart) {
-                LOGW("Bad style block: style block starts at %d, before strings at %d\n",
+                ALOGW("Bad style block: style block starts at %d, before strings at %d\n",
                     (int)mHeader->stylesStart, (int)mHeader->stringsStart);
                 return (mError=BAD_TYPE);
             }
@@ -414,7 +414,7 @@
 
         // check invariant: stringCount > 0 requires a string pool to exist
         if (mStringPoolSize == 0) {
-            LOGW("Bad string block: stringCount is %d but pool size is 0\n", (int)mHeader->stringCount);
+            ALOGW("Bad string block: stringCount is %d but pool size is 0\n", (int)mHeader->stringCount);
             return (mError=BAD_TYPE);
         }
 
@@ -437,7 +437,7 @@
                 ((uint8_t*)mStrings)[mStringPoolSize-1] != 0) ||
                 (!mHeader->flags&ResStringPool_header::UTF8_FLAG &&
                 ((char16_t*)mStrings)[mStringPoolSize-1] != 0)) {
-            LOGW("Bad string block: last string is not 0-terminated\n");
+            ALOGW("Bad string block: last string is not 0-terminated\n");
             return (mError=BAD_TYPE);
         }
     } else {
@@ -449,12 +449,12 @@
         mEntryStyles = mEntries + mHeader->stringCount;
         // invariant: integer overflow in calculating mEntryStyles
         if (mEntryStyles < mEntries) {
-            LOGW("Bad string block: integer overflow finding styles\n");
+            ALOGW("Bad string block: integer overflow finding styles\n");
             return (mError=BAD_TYPE);
         }
 
         if (((const uint8_t*)mEntryStyles-(const uint8_t*)mHeader) > (int)size) {
-            LOGW("Bad string block: entry of %d styles extends past data size %d\n",
+            ALOGW("Bad string block: entry of %d styles extends past data size %d\n",
                     (int)((const uint8_t*)mEntryStyles-(const uint8_t*)mHeader),
                     (int)size);
             return (mError=BAD_TYPE);
@@ -462,7 +462,7 @@
         mStyles = (const uint32_t*)
             (((const uint8_t*)data)+mHeader->stylesStart);
         if (mHeader->stylesStart >= mHeader->header.size) {
-            LOGW("Bad string block: style pool starts %d, after total size %d\n",
+            ALOGW("Bad string block: style pool starts %d, after total size %d\n",
                     (int)mHeader->stylesStart, (int)mHeader->header.size);
             return (mError=BAD_TYPE);
         }
@@ -487,7 +487,7 @@
         };
         if (memcmp(&mStyles[mStylePoolSize-(sizeof(endSpan)/sizeof(uint32_t))],
                    &endSpan, sizeof(endSpan)) != 0) {
-            LOGW("Bad string block: last style is not 0xFFFFFFFF-terminated\n");
+            ALOGW("Bad string block: last style is not 0xFFFFFFFF-terminated\n");
             return (mError=BAD_TYPE);
         }
     } else {
@@ -581,7 +581,7 @@
                 if ((uint32_t)(str+*u16len-strings) < mStringPoolSize) {
                     return str;
                 } else {
-                    LOGW("Bad string block: string #%d extends to %d, past end at %d\n",
+                    ALOGW("Bad string block: string #%d extends to %d, past end at %d\n",
                             (int)idx, (int)(str+*u16len-strings), (int)mStringPoolSize);
                 }
             } else {
@@ -601,7 +601,7 @@
 
                     ssize_t actualLen = utf8_to_utf16_length(u8str, u8len);
                     if (actualLen < 0 || (size_t)actualLen != *u16len) {
-                        LOGW("Bad string block: string #%lld decoded length is not correct "
+                        ALOGW("Bad string block: string #%lld decoded length is not correct "
                                 "%lld vs %llu\n",
                                 (long long)idx, (long long)actualLen, (long long)*u16len);
                         return NULL;
@@ -609,7 +609,7 @@
 
                     char16_t *u16str = (char16_t *)calloc(*u16len+1, sizeof(char16_t));
                     if (!u16str) {
-                        LOGW("No memory when trying to allocate decode cache for string #%d\n",
+                        ALOGW("No memory when trying to allocate decode cache for string #%d\n",
                                 (int)idx);
                         return NULL;
                     }
@@ -618,13 +618,13 @@
                     mCache[idx] = u16str;
                     return u16str;
                 } else {
-                    LOGW("Bad string block: string #%lld extends to %lld, past end at %lld\n",
+                    ALOGW("Bad string block: string #%lld extends to %lld, past end at %lld\n",
                             (long long)idx, (long long)(u8str+u8len-strings),
                             (long long)mStringPoolSize);
                 }
             }
         } else {
-            LOGW("Bad string block: string #%d entry is at %d, past end at %d\n",
+            ALOGW("Bad string block: string #%d entry is at %d, past end at %d\n",
                     (int)idx, (int)(off*sizeof(uint16_t)),
                     (int)(mStringPoolSize*sizeof(uint16_t)));
         }
@@ -646,12 +646,12 @@
                 if ((uint32_t)(str+encLen-strings) < mStringPoolSize) {
                     return (const char*)str;
                 } else {
-                    LOGW("Bad string block: string #%d extends to %d, past end at %d\n",
+                    ALOGW("Bad string block: string #%d extends to %d, past end at %d\n",
                             (int)idx, (int)(str+encLen-strings), (int)mStringPoolSize);
                 }
             }
         } else {
-            LOGW("Bad string block: string #%d entry is at %d, past end at %d\n",
+            ALOGW("Bad string block: string #%d entry is at %d, past end at %d\n",
                     (int)idx, (int)(off*sizeof(uint16_t)),
                     (int)(mStringPoolSize*sizeof(uint16_t)));
         }
@@ -671,7 +671,7 @@
         if (off < mStylePoolSize) {
             return (const ResStringPool_span*)(mStyles+off);
         } else {
-            LOGW("Bad string block: style #%d entry is at %d, past end at %d\n",
+            ALOGW("Bad string block: style #%d entry is at %d, past end at %d\n",
                     (int)idx, (int)(off*sizeof(uint32_t)),
                     (int)(mStylePoolSize*sizeof(uint32_t)));
         }
@@ -1087,7 +1087,7 @@
     do {
         const ResXMLTree_node* next = (const ResXMLTree_node*)
             (((const uint8_t*)mCurNode) + dtohl(mCurNode->header.size));
-        //LOGW("Next node: prev=%p, next=%p\n", mCurNode, next);
+        //ALOGW("Next node: prev=%p, next=%p\n", mCurNode, next);
         
         if (((const uint8_t*)next) >= mTree.mDataEnd) {
             mCurNode = NULL;
@@ -1120,14 +1120,14 @@
                 minExtSize = sizeof(ResXMLTree_cdataExt);
                 break;
             default:
-                LOGW("Unknown XML block: header type %d in node at %d\n",
+                ALOGW("Unknown XML block: header type %d in node at %d\n",
                      (int)dtohs(next->header.type),
                      (int)(((const uint8_t*)next)-((const uint8_t*)mTree.mHeader)));
                 continue;
         }
         
         if ((totalSize-headerSize) < minExtSize) {
-            LOGW("Bad XML block: header type 0x%x in node at 0x%x has size %d, need %d\n",
+            ALOGW("Bad XML block: header type 0x%x in node at 0x%x has size %d, need %d\n",
                  (int)dtohs(next->header.type),
                  (int)(((const uint8_t*)next)-((const uint8_t*)mTree.mHeader)),
                  (int)(totalSize-headerSize), (int)minExtSize);
@@ -1199,7 +1199,7 @@
     mHeader = (const ResXMLTree_header*)data;
     mSize = dtohl(mHeader->header.size);
     if (dtohs(mHeader->header.headerSize) > mSize || mSize > size) {
-        LOGW("Bad XML block: header size %d or total size %d is larger than data size %d\n",
+        ALOGW("Bad XML block: header size %d or total size %d is larger than data size %d\n",
              (int)dtohs(mHeader->header.headerSize),
              (int)dtohl(mHeader->header.size), (int)size);
         mError = BAD_TYPE;
@@ -1259,7 +1259,7 @@
     }
 
     if (mRootNode == NULL) {
-        LOGW("Bad XML block: no root element node found\n");
+        ALOGW("Bad XML block: no root element node found\n");
         mError = BAD_TYPE;
         goto done;
     }
@@ -1313,12 +1313,12 @@
             if ((dtohs(attrExt->attributeStart)+attrSize) <= (size-headerSize)) {
                 return NO_ERROR;
             }
-            LOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n",
+            ALOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n",
                     (unsigned int)(dtohs(attrExt->attributeStart)+attrSize),
                     (unsigned int)(size-headerSize));
         }
         else {
-            LOGW("Bad XML start block: node header size 0x%x, size 0x%x\n",
+            ALOGW("Bad XML start block: node header size 0x%x, size 0x%x\n",
                 (unsigned int)headerSize, (unsigned int)size);
         }
         return BAD_TYPE;
@@ -1342,21 +1342,21 @@
                         <= (size-headerSize)) {
                     return NO_ERROR;
                 }
-                LOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n",
+                ALOGW("Bad XML block: node attributes use 0x%x bytes, only have 0x%x bytes\n",
                         ((int)dtohs(node->attributeSize))*dtohs(node->attributeCount),
                         (int)(size-headerSize));
                 return BAD_TYPE;
             }
-            LOGW("Bad XML block: node at 0x%x extends beyond data end 0x%x\n",
+            ALOGW("Bad XML block: node at 0x%x extends beyond data end 0x%x\n",
                     (int)(((const uint8_t*)node)-((const uint8_t*)mHeader)), (int)mSize);
             return BAD_TYPE;
         }
-        LOGW("Bad XML block: node at 0x%x header size 0x%x smaller than total size 0x%x\n",
+        ALOGW("Bad XML block: node at 0x%x header size 0x%x smaller than total size 0x%x\n",
                 (int)(((const uint8_t*)node)-((const uint8_t*)mHeader)),
                 (int)headerSize, (int)size);
         return BAD_TYPE;
     }
-    LOGW("Bad XML block: node at 0x%x header size 0x%x too small\n",
+    ALOGW("Bad XML block: node at 0x%x header size 0x%x too small\n",
             (int)(((const uint8_t*)node)-((const uint8_t*)mHeader)),
             (int)headerSize);
     return BAD_TYPE;
@@ -1712,7 +1712,7 @@
                                 resID = te.value.data;
                                 continue;
                             }
-                            LOGW("Too many attribute references, stopped at: 0x%08x\n", resID);
+                            ALOGW("Too many attribute references, stopped at: 0x%08x\n", resID);
                             return BAD_INDEX;
                         } else if (type != Res_value::TYPE_NULL) {
                             *outValue = te.value;
@@ -1813,7 +1813,7 @@
 {
     const void* data = asset->getBuffer(true);
     if (data == NULL) {
-        LOGW("Unable to get buffer of resource asset file");
+        ALOGW("Unable to get buffer of resource asset file");
         return UNKNOWN_ERROR;
     }
     size_t size = (size_t)asset->getLength();
@@ -1888,13 +1888,13 @@
                                   16, 16, 0, false, printToLogFunc));
     if (dtohs(header->header->header.headerSize) > header->size
             || header->size > size) {
-        LOGW("Bad resource table: header size 0x%x or total size 0x%x is larger than data size 0x%x\n",
+        ALOGW("Bad resource table: header size 0x%x or total size 0x%x is larger than data size 0x%x\n",
              (int)dtohs(header->header->header.headerSize),
              (int)header->size, (int)size);
         return (mError=BAD_TYPE);
     }
     if (((dtohs(header->header->header.headerSize)|header->size)&0x3) != 0) {
-        LOGW("Bad resource table: header size 0x%x or total size 0x%x is not on an integer boundary\n",
+        ALOGW("Bad resource table: header size 0x%x or total size 0x%x is not on an integer boundary\n",
              (int)dtohs(header->header->header.headerSize),
              (int)header->size);
         return (mError=BAD_TYPE);
@@ -1927,11 +1927,11 @@
                     return (mError=err);
                 }
             } else {
-                LOGW("Multiple string chunks found in resource table.");
+                ALOGW("Multiple string chunks found in resource table.");
             }
         } else if (ctype == RES_TABLE_PACKAGE_TYPE) {
             if (curPackage >= dtohl(header->header->packageCount)) {
-                LOGW("More package chunks were found than the %d declared in the header.",
+                ALOGW("More package chunks were found than the %d declared in the header.",
                      dtohl(header->header->packageCount));
                 return (mError=BAD_TYPE);
             }
@@ -1949,7 +1949,7 @@
             }
             curPackage++;
         } else {
-            LOGW("Unknown chunk type %p in table at %p.\n",
+            ALOGW("Unknown chunk type %p in table at %p.\n",
                  (void*)(int)(ctype),
                  (void*)(((const uint8_t*)chunk) - ((const uint8_t*)header->header)));
         }
@@ -1958,13 +1958,13 @@
     }
 
     if (curPackage < dtohl(header->header->packageCount)) {
-        LOGW("Fewer package chunks (%d) were found than the %d declared in the header.",
+        ALOGW("Fewer package chunks (%d) were found than the %d declared in the header.",
              (int)curPackage, dtohl(header->header->packageCount));
         return (mError=BAD_TYPE);
     }
     mError = header->values.getError();
     if (mError != NO_ERROR) {
-        LOGW("No string values found in resource table!");
+        ALOGW("No string values found in resource table!");
     }
 
     TABLE_NOISY(LOGV("Returning from add with mError=%d\n", mError));
@@ -2011,20 +2011,20 @@
 
     if (p < 0) {
         if (Res_GETPACKAGE(resID)+1 == 0) {
-            LOGW("No package identifier when getting name for resource number 0x%08x", resID);
+            ALOGW("No package identifier when getting name for resource number 0x%08x", resID);
         } else {
-            LOGW("No known package when getting name for resource number 0x%08x", resID);
+            ALOGW("No known package when getting name for resource number 0x%08x", resID);
         }
         return false;
     }
     if (t < 0) {
-        LOGW("No type identifier when getting name for resource number 0x%08x", resID);
+        ALOGW("No type identifier when getting name for resource number 0x%08x", resID);
         return false;
     }
 
     const PackageGroup* const grp = mPackageGroups[p];
     if (grp == NULL) {
-        LOGW("Bad identifier when getting name for resource number 0x%08x", resID);
+        ALOGW("Bad identifier when getting name for resource number 0x%08x", resID);
         return false;
     }
     if (grp->packages.size() > 0) {
@@ -2067,14 +2067,14 @@
 
     if (p < 0) {
         if (Res_GETPACKAGE(resID)+1 == 0) {
-            LOGW("No package identifier when getting value for resource number 0x%08x", resID);
+            ALOGW("No package identifier when getting value for resource number 0x%08x", resID);
         } else {
-            LOGW("No known package when getting value for resource number 0x%08x", resID);
+            ALOGW("No known package when getting value for resource number 0x%08x", resID);
         }
         return BAD_INDEX;
     }
     if (t < 0) {
-        LOGW("No type identifier when getting value for resource number 0x%08x", resID);
+        ALOGW("No type identifier when getting value for resource number 0x%08x", resID);
         return BAD_INDEX;
     }
 
@@ -2089,7 +2089,7 @@
     // recently added.
     const PackageGroup* const grp = mPackageGroups[p];
     if (grp == NULL) {
-        LOGW("Bad identifier when getting value for resource number 0x%08x", resID);
+        ALOGW("Bad identifier when getting value for resource number 0x%08x", resID);
         return BAD_INDEX;
     }
 
@@ -2141,7 +2141,7 @@
             // overlay package did not specify a default.
             // Non-overlay packages are still required to provide a default.
             if (offset < 0 && ip == 0) {
-                LOGW("Failure getting entry for 0x%08x (t=%d e=%d) in package %zd (error %d)\n",
+                ALOGW("Failure getting entry for 0x%08x (t=%d e=%d) in package %zd (error %d)\n",
                         resID, T, E, ip, (int)offset);
                 rc = offset;
                 goto out;
@@ -2151,7 +2151,7 @@
 
         if ((dtohs(entry->flags)&entry->FLAG_COMPLEX) != 0) {
             if (!mayBeBag) {
-                LOGW("Requesting resource %p failed because it is complex\n",
+                ALOGW("Requesting resource %p failed because it is complex\n",
                      (void*)resID);
             }
             continue;
@@ -2161,7 +2161,7 @@
               << HexDump(type, dtohl(type->header.size)) << endl);
 
         if ((size_t)offset > (dtohl(type->header.size)-sizeof(Res_value))) {
-            LOGW("ResTable_item at %d is beyond type chunk data %d",
+            ALOGW("ResTable_item at %d is beyond type chunk data %d",
                  (int)offset, dtohl(type->header.size));
             rc = BAD_TYPE;
             goto out;
@@ -2307,23 +2307,23 @@
     const int e = Res_GETENTRY(resID);
 
     if (p < 0) {
-        LOGW("Invalid package identifier when getting bag for resource number 0x%08x", resID);
+        ALOGW("Invalid package identifier when getting bag for resource number 0x%08x", resID);
         return BAD_INDEX;
     }
     if (t < 0) {
-        LOGW("No type identifier when getting bag for resource number 0x%08x", resID);
+        ALOGW("No type identifier when getting bag for resource number 0x%08x", resID);
         return BAD_INDEX;
     }
 
     //printf("Get bag: id=0x%08x, p=%d, t=%d\n", resID, p, t);
     PackageGroup* const grp = mPackageGroups[p];
     if (grp == NULL) {
-        LOGW("Bad identifier when getting bag for resource number 0x%08x", resID);
+        ALOGW("Bad identifier when getting bag for resource number 0x%08x", resID);
         return false;
     }
 
     if (t >= (int)grp->typeCount) {
-        LOGW("Type identifier 0x%x is larger than type count 0x%x",
+        ALOGW("Type identifier 0x%x is larger than type count 0x%x",
              t+1, (int)grp->typeCount);
         return BAD_INDEX;
     }
@@ -2334,7 +2334,7 @@
 
     const size_t NENTRY = typeConfigs->entryCount;
     if (e >= (int)NENTRY) {
-        LOGW("Entry identifier 0x%x is larger than entry count 0x%x",
+        ALOGW("Entry identifier 0x%x is larger than entry count 0x%x",
              e, (int)typeConfigs->entryCount);
         return BAD_INDEX;
     }
@@ -2353,7 +2353,7 @@
                     //ALOGI("Found existing bag for: %p\n", (void*)resID);
                     return set->numAttrs;
                 }
-                LOGW("Attempt to retrieve bag 0x%08x which is invalid or in a cycle.",
+                ALOGW("Attempt to retrieve bag 0x%08x which is invalid or in a cycle.",
                      resID);
                 return BAD_INDEX;
             }
@@ -2429,7 +2429,7 @@
         }
 
         if ((dtohs(entry->flags)&entry->FLAG_COMPLEX) == 0) {
-            LOGW("Skipping entry %p in package table %d because it is not complex!\n",
+            ALOGW("Skipping entry %p in package table %d because it is not complex!\n",
                  (void*)resID, (int)ip);
             continue;
         }
@@ -2505,7 +2505,7 @@
             TABLE_NOISY(printf("Now at %p\n", (void*)curOff));
 
             if ((size_t)curOff > (dtohl(type->header.size)-sizeof(ResTable_map))) {
-                LOGW("ResTable_map at %d is beyond type chunk data %d",
+                ALOGW("ResTable_map at %d is beyond type chunk data %d",
                      (int)curOff, dtohl(type->header.size));
                 return BAD_TYPE;
             }
@@ -2676,7 +2676,7 @@
                 && name[6] == '_') {
                 int index = atoi(String8(name + 7, nameLen - 7).string());
                 if (Res_CHECKID(index)) {
-                    LOGW("Array resource index: %d is too large.",
+                    ALOGW("Array resource index: %d is too large.",
                          index);
                     return 0;
                 }
@@ -2792,12 +2792,12 @@
                 offset += typeOffset;
                 
                 if (offset > (dtohl(ty->header.size)-sizeof(ResTable_entry))) {
-                    LOGW("ResTable_entry at %d is beyond type chunk data %d",
+                    ALOGW("ResTable_entry at %d is beyond type chunk data %d",
                          offset, dtohl(ty->header.size));
                     return 0;
                 }
                 if ((offset&0x3) != 0) {
-                    LOGW("ResTable_entry at %d (pkg=%d type=%d ent=%d) is not on an integer boundary when looking for %s:%s/%s",
+                    ALOGW("ResTable_entry at %d (pkg=%d type=%d ent=%d) is not on an integer boundary when looking for %s:%s/%s",
                          (int)offset, (int)group->id, (int)ti+1, (int)i,
                          String8(package, packageLen).string(),
                          String8(type, typeLen).string(),
@@ -2808,7 +2808,7 @@
                 const ResTable_entry* const entry = (const ResTable_entry*)
                     (((const uint8_t*)ty) + offset);
                 if (dtohs(entry->size) < sizeof(*entry)) {
-                    LOGW("ResTable_entry size %d is too small", dtohs(entry->size));
+                    ALOGW("ResTable_entry size %d is too small", dtohs(entry->size));
                     return BAD_TYPE;
                 }
 
@@ -3935,7 +3935,7 @@
     }
 
     if ((size_t)entryIndex >= allTypes->entryCount) {
-        LOGW("getEntry failing because entryIndex %d is beyond type entryCount %d",
+        ALOGW("getEntry failing because entryIndex %d is beyond type entryCount %d",
             entryIndex, (int)allTypes->entryCount);
         return BAD_TYPE;
     }
@@ -4039,12 +4039,12 @@
           << ", offset=" << (void*)offset << endl);
 
     if (offset > (dtohl(type->header.size)-sizeof(ResTable_entry))) {
-        LOGW("ResTable_entry at 0x%x is beyond type chunk data 0x%x",
+        ALOGW("ResTable_entry at 0x%x is beyond type chunk data 0x%x",
              offset, dtohl(type->header.size));
         return BAD_TYPE;
     }
     if ((offset&0x3) != 0) {
-        LOGW("ResTable_entry at 0x%x is not on an integer boundary",
+        ALOGW("ResTable_entry at 0x%x is not on an integer boundary",
              offset);
         return BAD_TYPE;
     }
@@ -4052,7 +4052,7 @@
     const ResTable_entry* const entry = (const ResTable_entry*)
         (((const uint8_t*)type) + offset);
     if (dtohs(entry->size) < sizeof(*entry)) {
-        LOGW("ResTable_entry size 0x%x is too small", dtohs(entry->size));
+        ALOGW("ResTable_entry size 0x%x is too small", dtohs(entry->size));
         return BAD_TYPE;
     }
 
@@ -4077,22 +4077,22 @@
     const size_t pkgSize = dtohl(pkg->header.size);
 
     if (dtohl(pkg->typeStrings) >= pkgSize) {
-        LOGW("ResTable_package type strings at %p are past chunk size %p.",
+        ALOGW("ResTable_package type strings at %p are past chunk size %p.",
              (void*)dtohl(pkg->typeStrings), (void*)pkgSize);
         return (mError=BAD_TYPE);
     }
     if ((dtohl(pkg->typeStrings)&0x3) != 0) {
-        LOGW("ResTable_package type strings at %p is not on an integer boundary.",
+        ALOGW("ResTable_package type strings at %p is not on an integer boundary.",
              (void*)dtohl(pkg->typeStrings));
         return (mError=BAD_TYPE);
     }
     if (dtohl(pkg->keyStrings) >= pkgSize) {
-        LOGW("ResTable_package key strings at %p are past chunk size %p.",
+        ALOGW("ResTable_package key strings at %p are past chunk size %p.",
              (void*)dtohl(pkg->keyStrings), (void*)pkgSize);
         return (mError=BAD_TYPE);
     }
     if ((dtohl(pkg->keyStrings)&0x3) != 0) {
-        LOGW("ResTable_package key strings at %p is not on an integer boundary.",
+        ALOGW("ResTable_package key strings at %p is not on an integer boundary.",
              (void*)dtohl(pkg->keyStrings));
         return (mError=BAD_TYPE);
     }
@@ -4195,7 +4195,7 @@
             if ((dtohl(typeSpec->entryCount) > (INT32_MAX/sizeof(uint32_t))
                     || dtohs(typeSpec->header.headerSize)+(sizeof(uint32_t)*dtohl(typeSpec->entryCount))
                     > typeSpecSize)) {
-                LOGW("ResTable_typeSpec entry index to %p extends beyond chunk end %p.",
+                ALOGW("ResTable_typeSpec entry index to %p extends beyond chunk end %p.",
                      (void*)(dtohs(typeSpec->header.headerSize)
                              +(sizeof(uint32_t)*dtohl(typeSpec->entryCount))),
                      (void*)typeSpecSize);
@@ -4203,7 +4203,7 @@
             }
             
             if (typeSpec->id == 0) {
-                LOGW("ResTable_type has an id of 0.");
+                ALOGW("ResTable_type has an id of 0.");
                 return (mError=BAD_TYPE);
             }
             
@@ -4215,7 +4215,7 @@
                 t = new Type(header, package, dtohl(typeSpec->entryCount));
                 package->types.editItemAt(typeSpec->id-1) = t;
             } else if (dtohl(typeSpec->entryCount) != t->entryCount) {
-                LOGW("ResTable_typeSpec entry count inconsistent: given %d, previously %d",
+                ALOGW("ResTable_typeSpec entry count inconsistent: given %d, previously %d",
                     (int)dtohl(typeSpec->entryCount), (int)t->entryCount);
                 return (mError=BAD_TYPE);
             }
@@ -4240,7 +4240,7 @@
                                     (void*)typeSize));
             if (dtohs(type->header.headerSize)+(sizeof(uint32_t)*dtohl(type->entryCount))
                 > typeSize) {
-                LOGW("ResTable_type entry index to %p extends beyond chunk end %p.",
+                ALOGW("ResTable_type entry index to %p extends beyond chunk end %p.",
                      (void*)(dtohs(type->header.headerSize)
                              +(sizeof(uint32_t)*dtohl(type->entryCount))),
                      (void*)typeSize);
@@ -4248,12 +4248,12 @@
             }
             if (dtohl(type->entryCount) != 0
                 && dtohl(type->entriesStart) > (typeSize-sizeof(ResTable_entry))) {
-                LOGW("ResTable_type entriesStart at %p extends beyond chunk end %p.",
+                ALOGW("ResTable_type entriesStart at %p extends beyond chunk end %p.",
                      (void*)dtohl(type->entriesStart), (void*)typeSize);
                 return (mError=BAD_TYPE);
             }
             if (type->id == 0) {
-                LOGW("ResTable_type has an id of 0.");
+                ALOGW("ResTable_type has an id of 0.");
                 return (mError=BAD_TYPE);
             }
             
@@ -4265,7 +4265,7 @@
                 t = new Type(header, package, dtohl(type->entryCount));
                 package->types.editItemAt(type->id-1) = t;
             } else if (dtohl(type->entryCount) != t->entryCount) {
-                LOGW("ResTable_type entry count inconsistent: given %d, previously %d",
+                ALOGW("ResTable_type entry count inconsistent: given %d, previously %d",
                     (int)dtohl(type->entryCount), (int)t->entryCount);
                 return (mError=BAD_TYPE);
             }
@@ -4346,7 +4346,7 @@
                 | (0x0000ffff & (entryIndex));
             resource_name resName;
             if (!this->getResourceName(resID, &resName)) {
-                LOGW("idmap: resource 0x%08x has spec but lacks values, skipping\n", resID);
+                ALOGW("idmap: resource 0x%08x has spec but lacks values, skipping\n", resID);
                 continue;
             }
 
diff --git a/libs/utils/SystemClock.cpp b/libs/utils/SystemClock.cpp
index 89a052f..8b8ac10 100644
--- a/libs/utils/SystemClock.cpp
+++ b/libs/utils/SystemClock.cpp
@@ -69,20 +69,20 @@
 #ifdef HAVE_ANDROID_OS
     fd = open("/dev/alarm", O_RDWR);
     if(fd < 0) {
-        LOGW("Unable to open alarm driver: %s\n", strerror(errno));
+        ALOGW("Unable to open alarm driver: %s\n", strerror(errno));
         return -1;
     }
     ts.tv_sec = tv.tv_sec;
     ts.tv_nsec = tv.tv_usec * 1000;
     res = ioctl(fd, ANDROID_ALARM_SET_RTC, &ts);
     if(res < 0) {
-        LOGW("Unable to set rtc to %ld: %s\n", tv.tv_sec, strerror(errno));
+        ALOGW("Unable to set rtc to %ld: %s\n", tv.tv_sec, strerror(errno));
         ret = -1;
     }
     close(fd);
 #else
     if (settimeofday(&tv, NULL) != 0) {
-        LOGW("Unable to set clock to %d.%d: %s\n",
+        ALOGW("Unable to set clock to %d.%d: %s\n",
             (int) tv.tv_sec, (int) tv.tv_usec, strerror(errno));
         ret = -1;
     }
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index fe4b8e6..fb52d7c 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -870,7 +870,7 @@
 {
     Mutex::Autolock _l(mLock);
     if (mThread == getThreadId()) {
-        LOGW(
+        ALOGW(
         "Thread (this=%p): don't call waitForExit() from this "
         "Thread object's thread. It's a guaranteed deadlock!",
         this);
@@ -894,7 +894,7 @@
 {
     Mutex::Autolock _l(mLock);
     if (mThread == getThreadId()) {
-        LOGW(
+        ALOGW(
         "Thread (this=%p): don't call join() from this "
         "Thread object's thread. It's a guaranteed deadlock!",
         this);
diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp
index 6ca9a28..a6cce7e 100644
--- a/libs/utils/ZipFileRO.cpp
+++ b/libs/utils/ZipFileRO.cpp
@@ -120,7 +120,7 @@
 {
     long ent = ((long) entry) - kZipEntryAdj;
     if (ent < 0 || ent >= mHashTableSize || mHashTable[ent].name == NULL) {
-        LOGW("Invalid ZipEntryRO %p (%ld)\n", entry, ent);
+        ALOGW("Invalid ZipEntryRO %p (%ld)\n", entry, ent);
         return -1;
     }
     return ent;
@@ -142,7 +142,7 @@
      */
     fd = ::open(zipFileName, O_RDONLY | O_BINARY);
     if (fd < 0) {
-        LOGW("Unable to open zip '%s': %s\n", zipFileName, strerror(errno));
+        ALOGW("Unable to open zip '%s': %s\n", zipFileName, strerror(errno));
         return NAME_NOT_FOUND;
     }
 
@@ -194,7 +194,7 @@
 
     unsigned char* scanBuf = (unsigned char*) malloc(readAmount);
     if (scanBuf == NULL) {
-        LOGW("couldn't allocate scanBuf: %s", strerror(errno));
+        ALOGW("couldn't allocate scanBuf: %s", strerror(errno));
         free(scanBuf);
         return false;
     }
@@ -203,7 +203,7 @@
      * Make sure this is a Zip archive.
      */
     if (lseek64(mFd, 0, SEEK_SET) != 0) {
-        LOGW("seek to start failed: %s", strerror(errno));
+        ALOGW("seek to start failed: %s", strerror(errno));
         free(scanBuf);
         return false;
     }
@@ -243,13 +243,13 @@
     off64_t searchStart = mFileLength - readAmount;
 
     if (lseek64(mFd, searchStart, SEEK_SET) != searchStart) {
-        LOGW("seek %ld failed: %s\n",  (long) searchStart, strerror(errno));
+        ALOGW("seek %ld failed: %s\n",  (long) searchStart, strerror(errno));
         free(scanBuf);
         return false;
     }
     actual = TEMP_FAILURE_RETRY(read(mFd, scanBuf, readAmount));
     if (actual != (ssize_t) readAmount) {
-        LOGW("Zip: read " ZD ", expected " ZD ". Failed: %s\n",
+        ALOGW("Zip: read " ZD ", expected " ZD ". Failed: %s\n",
             (ZD_TYPE) actual, (ZD_TYPE) readAmount, strerror(errno));
         free(scanBuf);
         return false;
@@ -290,12 +290,12 @@
 
     // Verify that they look reasonable.
     if ((long long) dirOffset + (long long) dirSize > (long long) eocdOffset) {
-        LOGW("bad offsets (dir %ld, size %u, eocd %ld)\n",
+        ALOGW("bad offsets (dir %ld, size %u, eocd %ld)\n",
             (long) dirOffset, dirSize, (long) eocdOffset);
         return false;
     }
     if (numEntries == 0) {
-        LOGW("empty archive?\n");
+        ALOGW("empty archive?\n");
         return false;
     }
 
@@ -304,12 +304,12 @@
 
     mDirectoryMap = new FileMap();
     if (mDirectoryMap == NULL) {
-        LOGW("Unable to create directory map: %s", strerror(errno));
+        ALOGW("Unable to create directory map: %s", strerror(errno));
         return false;
     }
 
     if (!mDirectoryMap->create(mFileName, mFd, dirOffset, dirSize, true)) {
-        LOGW("Unable to map '%s' (" ZD " to " ZD "): %s\n", mFileName,
+        ALOGW("Unable to map '%s' (" ZD " to " ZD "): %s\n", mFileName,
                 (ZD_TYPE) dirOffset, (ZD_TYPE) (dirOffset + dirSize), strerror(errno));
         return false;
     }
@@ -341,17 +341,17 @@
     const unsigned char* ptr = cdPtr;
     for (int i = 0; i < numEntries; i++) {
         if (get4LE(ptr) != kCDESignature) {
-            LOGW("Missed a central dir sig (at %d)\n", i);
+            ALOGW("Missed a central dir sig (at %d)\n", i);
             goto bail;
         }
         if (ptr + kCDELen > cdPtr + cdLength) {
-            LOGW("Ran off the end (at %d)\n", i);
+            ALOGW("Ran off the end (at %d)\n", i);
             goto bail;
         }
 
         long localHdrOffset = (long) get4LE(ptr + kCDELocalOffset);
         if (localHdrOffset >= mDirectoryOffset) {
-            LOGW("bad LFH offset %ld at entry %d\n", localHdrOffset, i);
+            ALOGW("bad LFH offset %ld at entry %d\n", localHdrOffset, i);
             goto bail;
         }
 
@@ -367,7 +367,7 @@
 
         ptr += kCDELen + fileNameLen + extraLen + commentLen;
         if ((size_t)(ptr - cdPtr) > cdLength) {
-            LOGW("bad CD advance (%d vs " ZD ") at entry %d\n",
+            ALOGW("bad CD advance (%d vs " ZD ") at entry %d\n",
                 (int) (ptr - cdPtr), (ZD_TYPE) cdLength, i);
             goto bail;
         }
@@ -452,7 +452,7 @@
 ZipEntryRO ZipFileRO::findEntryByIndex(int idx) const
 {
     if (idx < 0 || idx >= mNumEntries) {
-        LOGW("Invalid index %d\n", idx);
+        ALOGW("Invalid index %d\n", idx);
         return NULL;
     }
 
@@ -544,12 +544,12 @@
                 TEMP_FAILURE_RETRY(pread64(mFd, lfhBuf, sizeof(lfhBuf), localHdrOffset));
 
         if (actual != sizeof(lfhBuf)) {
-            LOGW("failed reading lfh from offset %ld\n", localHdrOffset);
+            ALOGW("failed reading lfh from offset %ld\n", localHdrOffset);
             return false;
         }
 
         if (get4LE(lfhBuf) != kLFHSignature) {
-            LOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; "
+            ALOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; "
                     "got: data=0x%08lx\n",
                     localHdrOffset, kLFHSignature, get4LE(lfhBuf));
             return false;
@@ -567,20 +567,20 @@
             AutoMutex _l(mFdLock);
 
             if (lseek64(mFd, localHdrOffset, SEEK_SET) != localHdrOffset) {
-                LOGW("failed seeking to lfh at offset %ld\n", localHdrOffset);
+                ALOGW("failed seeking to lfh at offset %ld\n", localHdrOffset);
                 return false;
             }
 
             ssize_t actual =
                     TEMP_FAILURE_RETRY(read(mFd, lfhBuf, sizeof(lfhBuf)));
             if (actual != sizeof(lfhBuf)) {
-                LOGW("failed reading lfh from offset %ld\n", localHdrOffset);
+                ALOGW("failed reading lfh from offset %ld\n", localHdrOffset);
                 return false;
             }
 
             if (get4LE(lfhBuf) != kLFHSignature) {
                 off64_t actualOffset = lseek64(mFd, 0, SEEK_CUR);
-                LOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; "
+                ALOGW("didn't find signature at start of lfh; wanted: offset=%ld data=0x%08x; "
                         "got: offset=" ZD " data=0x%08lx\n",
                         localHdrOffset, kLFHSignature, (ZD_TYPE) actualOffset, get4LE(lfhBuf));
                 return false;
@@ -591,13 +591,13 @@
         off64_t dataOffset = localHdrOffset + kLFHLen
             + get2LE(lfhBuf + kLFHNameLen) + get2LE(lfhBuf + kLFHExtraLen);
         if (dataOffset >= cdOffset) {
-            LOGW("bad data offset %ld in zip\n", (long) dataOffset);
+            ALOGW("bad data offset %ld in zip\n", (long) dataOffset);
             return false;
         }
 
         /* check lengths */
         if ((off64_t)(dataOffset + compLen) > cdOffset) {
-            LOGW("bad compressed length in zip (%ld + " ZD " > %ld)\n",
+            ALOGW("bad compressed length in zip (%ld + " ZD " > %ld)\n",
                 (long) dataOffset, (ZD_TYPE) compLen, (long) cdOffset);
             return false;
         }
@@ -819,7 +819,7 @@
      */
     zerr = inflate(&zstream, Z_FINISH);
     if (zerr != Z_STREAM_END) {
-        LOGW("Zip inflate failed, zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n",
+        ALOGW("Zip inflate failed, zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n",
             zerr, zstream.next_in, zstream.avail_in,
             zstream.next_out, zstream.avail_out);
         goto z_bail;
@@ -827,7 +827,7 @@
 
     /* paranoia */
     if (zstream.total_out != uncompLen) {
-        LOGW("Size mismatch on inflated file (%ld vs " ZD ")\n",
+        ALOGW("Size mismatch on inflated file (%ld vs " ZD ")\n",
             zstream.total_out, (ZD_TYPE) uncompLen);
         goto z_bail;
     }
@@ -890,7 +890,7 @@
          */
         zerr = inflate(&zstream, Z_NO_FLUSH);
         if (zerr != Z_OK && zerr != Z_STREAM_END) {
-            LOGW("zlib inflate: zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n",
+            ALOGW("zlib inflate: zerr=%d (nIn=%p aIn=%u nOut=%p aOut=%u)\n",
                 zerr, zstream.next_in, zstream.avail_in,
                 zstream.next_out, zstream.avail_out);
             goto z_bail;
@@ -903,7 +903,7 @@
             long writeSize = zstream.next_out - writeBuf;
             int cc = write(fd, writeBuf, writeSize);
             if (cc != (int) writeSize) {
-                LOGW("write failed in inflate (%d vs %ld)\n", cc, writeSize);
+                ALOGW("write failed in inflate (%d vs %ld)\n", cc, writeSize);
                 goto z_bail;
             }
 
@@ -916,7 +916,7 @@
 
     /* paranoia */
     if (zstream.total_out != uncompLen) {
-        LOGW("Size mismatch on inflated file (%ld vs " ZD ")\n",
+        ALOGW("Size mismatch on inflated file (%ld vs " ZD ")\n",
             zstream.total_out, (ZD_TYPE) uncompLen);
         goto z_bail;
     }
diff --git a/libs/utils/ZipUtils.cpp b/libs/utils/ZipUtils.cpp
index cc5c68a..0fe1a7b 100644
--- a/libs/utils/ZipUtils.cpp
+++ b/libs/utils/ZipUtils.cpp
@@ -124,7 +124,7 @@
     assert(zerr == Z_STREAM_END);       /* other errors should've been caught */
 
     if ((long) zstream.total_out != uncompressedLen) {
-        LOGW("Size mismatch on inflated file (%ld vs %ld)\n",
+        ALOGW("Size mismatch on inflated file (%ld vs %ld)\n",
             zstream.total_out, uncompressedLen);
         goto z_bail;
     }
@@ -236,7 +236,7 @@
     assert(zerr == Z_STREAM_END);       /* other errors should've been caught */
 
     if ((long) zstream.total_out != uncompressedLen) {
-        LOGW("Size mismatch on inflated file (%ld vs %ld)\n",
+        ALOGW("Size mismatch on inflated file (%ld vs %ld)\n",
             zstream.total_out, uncompressedLen);
         goto z_bail;
     }
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 0272a03..39f470f 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -659,7 +659,7 @@
     ALOGV("native_finalize");
     sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
     if (mp != NULL) {
-        LOGW("MediaPlayer finalized without being released");
+        ALOGW("MediaPlayer finalized without being released");
     }
     android_media_MediaPlayer_release(env, thiz);
 }
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp
index d517a58..0ce0277 100644
--- a/media/jni/audioeffect/android_media_AudioEffect.cpp
+++ b/media/jni/audioeffect/android_media_AudioEffect.cpp
@@ -112,14 +112,14 @@
             callbackInfo->audioEffect_class);
 
     if (!user || !env) {
-        LOGW("effectCallback error user %p, env %p", user, env);
+        ALOGW("effectCallback error user %p, env %p", user, env);
         return;
     }
 
     switch (event) {
     case AudioEffect::EVENT_CONTROL_STATUS_CHANGED:
         if (info == 0) {
-            LOGW("EVENT_CONTROL_STATUS_CHANGED info == NULL");
+            ALOGW("EVENT_CONTROL_STATUS_CHANGED info == NULL");
             goto effectCallback_Exit;
         }
         param = *(bool *)info;
@@ -128,7 +128,7 @@
         break;
     case AudioEffect::EVENT_ENABLE_STATUS_CHANGED:
         if (info == 0) {
-            LOGW("EVENT_ENABLE_STATUS_CHANGED info == NULL");
+            ALOGW("EVENT_ENABLE_STATUS_CHANGED info == NULL");
             goto effectCallback_Exit;
         }
         param = *(bool *)info;
@@ -137,7 +137,7 @@
         break;
     case AudioEffect::EVENT_PARAMETER_CHANGED:
         if (info == 0) {
-            LOGW("EVENT_PARAMETER_CHANGED info == NULL");
+            ALOGW("EVENT_PARAMETER_CHANGED info == NULL");
             goto effectCallback_Exit;
         }
         p = (effect_param_t *)info;
@@ -159,7 +159,7 @@
         ALOGV("EVENT_PARAMETER_CHANGED");
        break;
     case AudioEffect::EVENT_ERROR:
-        LOGW("EVENT_ERROR");
+        ALOGW("EVENT_ERROR");
         break;
     }
 
diff --git a/media/jni/audioeffect/android_media_Visualizer.cpp b/media/jni/audioeffect/android_media_Visualizer.cpp
index b64505c..53c90f3 100644
--- a/media/jni/audioeffect/android_media_Visualizer.cpp
+++ b/media/jni/audioeffect/android_media_Visualizer.cpp
@@ -113,7 +113,7 @@
             callbackInfo->visualizer_class);
 
     if (!user || !env) {
-        LOGW("captureCallback error user %p, env %p", user, env);
+        ALOGW("captureCallback error user %p, env %p", user, env);
         return;
     }
 
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp
index 40db37f..ed63189 100644
--- a/media/jni/soundpool/SoundPool.cpp
+++ b/media/jni/soundpool/SoundPool.cpp
@@ -52,7 +52,7 @@
     else if (mMaxChannels > 32) {
         mMaxChannels = 32;
     }
-    LOGW_IF(maxChannels != mMaxChannels, "App requested %d channels", maxChannels);
+    ALOGW_IF(maxChannels != mMaxChannels, "App requested %d channels", maxChannels);
 
     mQuit = false;
     mDecodeThread = 0;
@@ -255,7 +255,7 @@
     // is sample ready?
     sample = findSample(sampleID);
     if ((sample == 0) || (sample->state() != Sample::READY)) {
-        LOGW("  sample %d not READY", sampleID);
+        ALOGW("  sample %d not READY", sampleID);
         return 0;
     }
 
diff --git a/media/jni/soundpool/SoundPoolThread.cpp b/media/jni/soundpool/SoundPoolThread.cpp
index bbb56ff..ba3b482 100644
--- a/media/jni/soundpool/SoundPoolThread.cpp
+++ b/media/jni/soundpool/SoundPoolThread.cpp
@@ -91,7 +91,7 @@
             doLoadSample(msg.mData);
             break;
         default:
-            LOGW("run: Unrecognized message %d\n",
+            ALOGW("run: Unrecognized message %d\n",
                     msg.mMessageType);
             break;
         }
diff --git a/media/libeffects/factory/EffectsFactory.c b/media/libeffects/factory/EffectsFactory.c
index ee2279a..9f6599f 100644
--- a/media/libeffects/factory/EffectsFactory.c
+++ b/media/libeffects/factory/EffectsFactory.c
@@ -279,7 +279,7 @@
     ret = init();
 
     if (ret < 0) {
-        LOGW("EffectCreate() init error: %d", ret);
+        ALOGW("EffectCreate() init error: %d", ret);
         return ret;
     }
 
@@ -293,7 +293,7 @@
     // create effect in library
     ret = l->desc->create_effect(uuid, sessionId, ioId, &itfe);
     if (ret != 0) {
-        LOGW("EffectCreate() library %s: could not create fx %s, error %d", l->name, d->name, ret);
+        ALOGW("EffectCreate() library %s: could not create fx %s, error %d", l->name, d->name, ret);
         goto exit;
     }
 
@@ -359,7 +359,7 @@
 
     // release effect in library
     if (fx->lib == NULL) {
-        LOGW("EffectRelease() fx %p library already unloaded", handle);
+        ALOGW("EffectRelease() fx %p library already unloaded", handle);
     } else {
         pthread_mutex_lock(&fx->lib->lock);
         fx->lib->desc->release_effect(fx->subItfe);
@@ -456,24 +456,24 @@
 
     hdl = dlopen(node->value, RTLD_NOW);
     if (hdl == NULL) {
-        LOGW("loadLibrary() failed to open %s", node->value);
+        ALOGW("loadLibrary() failed to open %s", node->value);
         goto error;
     }
 
     desc = (audio_effect_library_t *)dlsym(hdl, AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR);
     if (desc == NULL) {
-        LOGW("loadLibrary() could not find symbol %s", AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR);
+        ALOGW("loadLibrary() could not find symbol %s", AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR);
         goto error;
     }
 
     if (AUDIO_EFFECT_LIBRARY_TAG != desc->tag) {
-        LOGW("getLibrary() bad tag %08x in lib info struct", desc->tag);
+        ALOGW("getLibrary() bad tag %08x in lib info struct", desc->tag);
         goto error;
     }
 
     if (EFFECT_API_VERSION_MAJOR(desc->version) !=
             EFFECT_API_VERSION_MAJOR(EFFECT_LIBRARY_API_VERSION)) {
-        LOGW("loadLibrary() bad lib version %08x", desc->version);
+        ALOGW("loadLibrary() bad lib version %08x", desc->version);
         goto error;
     }
 
@@ -534,7 +534,7 @@
 
     l = getLibrary(node->value);
     if (l == NULL) {
-        LOGW("loadEffect() could not get library %s", node->value);
+        ALOGW("loadEffect() could not get library %s", node->value);
         return -EINVAL;
     }
 
@@ -543,7 +543,7 @@
         return -EINVAL;
     }
     if (stringToUuid(node->value, &uuid) != 0) {
-        LOGW("loadEffect() invalid uuid %s", node->value);
+        ALOGW("loadEffect() invalid uuid %s", node->value);
         return -EINVAL;
     }
 
@@ -551,7 +551,7 @@
     if (l->desc->get_descriptor(&uuid, d) != 0) {
         char s[40];
         uuidToString(&uuid, s, 40);
-        LOGW("Error querying effect %s on lib %s", s, l->name);
+        ALOGW("Error querying effect %s on lib %s", s, l->name);
         free(d);
         return -EINVAL;
     }
@@ -562,7 +562,7 @@
 #endif
     if (EFFECT_API_VERSION_MAJOR(d->apiVersion) !=
             EFFECT_API_VERSION_MAJOR(EFFECT_CONTROL_API_VERSION)) {
-        LOGW("Bad API version %08x on lib %s", d->apiVersion, l->name);
+        ALOGW("Bad API version %08x on lib %s", d->apiVersion, l->name);
         free(d);
         return -EINVAL;
     }
diff --git a/media/libeffects/preprocessing/PreProcessing.cpp b/media/libeffects/preprocessing/PreProcessing.cpp
index c99552b..8dfcb78 100755
--- a/media/libeffects/preprocessing/PreProcessing.cpp
+++ b/media/libeffects/preprocessing/PreProcessing.cpp
@@ -240,7 +240,7 @@
     webrtc::GainControl *agc = effect->session->apm->gain_control();
     ALOGV("AgcCreate got agc %p", agc);
     if (agc == NULL) {
-        LOGW("AgcCreate Error");
+        ALOGW("AgcCreate Error");
         return -ENOMEM;
     }
     effect->engine = static_cast<preproc_fx_handle_t>(agc);
@@ -280,7 +280,7 @@
         break;
 
     default:
-        LOGW("AgcGetParameter() unknown param %08x", param);
+        ALOGW("AgcGetParameter() unknown param %08x", param);
         status = -EINVAL;
         break;
     }
@@ -305,7 +305,7 @@
         pProperties->limiterEnabled = (bool)agc->is_limiter_enabled();
         break;
     default:
-        LOGW("AgcGetParameter() unknown param %d", param);
+        ALOGW("AgcGetParameter() unknown param %d", param);
         status = -EINVAL;
         break;
     }
@@ -344,7 +344,7 @@
         status = agc->enable_limiter(pProperties->limiterEnabled);
         break;
     default:
-        LOGW("AgcSetParameter() unknown param %08x value %08x", param, *(uint32_t *)pValue);
+        ALOGW("AgcSetParameter() unknown param %08x value %08x", param, *(uint32_t *)pValue);
         status = -EINVAL;
         break;
     }
@@ -403,7 +403,7 @@
     webrtc::EchoControlMobile *aec = effect->session->apm->echo_control_mobile();
     ALOGV("AecCreate got aec %p", aec);
     if (aec == NULL) {
-        LOGW("AgcCreate Error");
+        ALOGW("AgcCreate Error");
         return -ENOMEM;
     }
     effect->engine = static_cast<preproc_fx_handle_t>(aec);
@@ -429,7 +429,7 @@
         ALOGV("AecGetParameter() echo delay %d us", *(uint32_t *)pValue);
         break;
     default:
-        LOGW("AecGetParameter() unknown param %08x value %08x", param, *(uint32_t *)pValue);
+        ALOGW("AecGetParameter() unknown param %08x value %08x", param, *(uint32_t *)pValue);
         status = -EINVAL;
         break;
     }
@@ -449,7 +449,7 @@
         ALOGV("AecSetParameter() echo delay %d us, status %d", value, status);
         break;
     default:
-        LOGW("AecSetParameter() unknown param %08x value %08x", param, *(uint32_t *)pValue);
+        ALOGW("AecSetParameter() unknown param %08x value %08x", param, *(uint32_t *)pValue);
         status = -EINVAL;
         break;
     }
@@ -522,7 +522,7 @@
     webrtc::NoiseSuppression *ns = effect->session->apm->noise_suppression();
     ALOGV("NsCreate got ns %p", ns);
     if (ns == NULL) {
-        LOGW("AgcCreate Error");
+        ALOGW("AgcCreate Error");
         return -ENOMEM;
     }
     effect->engine = static_cast<preproc_fx_handle_t>(ns);
@@ -730,7 +730,7 @@
     if (session->createdMsk == 0) {
         session->apm = webrtc::AudioProcessing::Create(session->io);
         if (session->apm == NULL) {
-            LOGW("Session_CreateEffect could not get apm engine");
+            ALOGW("Session_CreateEffect could not get apm engine");
             goto error;
         }
         session->apm->set_sample_rate_hz(kPreprocDefaultSr);
@@ -738,12 +738,12 @@
         session->apm->set_num_reverse_channels(kPreProcDefaultCnl);
         session->procFrame = new webrtc::AudioFrame();
         if (session->procFrame == NULL) {
-            LOGW("Session_CreateEffect could not allocate audio frame");
+            ALOGW("Session_CreateEffect could not allocate audio frame");
             goto error;
         }
         session->revFrame = new webrtc::AudioFrame();
         if (session->revFrame == NULL) {
-            LOGW("Session_CreateEffect could not allocate reverse audio frame");
+            ALOGW("Session_CreateEffect could not allocate reverse audio frame");
             goto error;
         }
         session->apmSamplingRate = kPreprocDefaultSr;
@@ -794,7 +794,7 @@
 int Session_ReleaseEffect(preproc_session_t *session,
                           preproc_effect_t *fx)
 {
-    LOGW_IF(Effect_Release(fx) != 0, " Effect_Release() failed for proc ID %d", fx->procId);
+    ALOGW_IF(Effect_Release(fx) != 0, " Effect_Release() failed for proc ID %d", fx->procId);
     session->createdMsk &= ~(1<<fx->procId);
     if (session->createdMsk == 0) {
         webrtc::AudioProcessing::Destroy(session->apm);
@@ -904,7 +904,7 @@
                                                     RESAMPLER_QUALITY,
                                                     &error);
         if (session->inResampler == NULL) {
-            LOGW("Session_SetConfig Cannot create speex resampler: %s",
+            ALOGW("Session_SetConfig Cannot create speex resampler: %s",
                  speex_resampler_strerror(error));
             return -EINVAL;
         }
@@ -914,7 +914,7 @@
                                                     RESAMPLER_QUALITY,
                                                     &error);
         if (session->outResampler == NULL) {
-            LOGW("Session_SetConfig Cannot create speex resampler: %s",
+            ALOGW("Session_SetConfig Cannot create speex resampler: %s",
                  speex_resampler_strerror(error));
             speex_resampler_destroy(session->inResampler);
             session->inResampler = NULL;
@@ -926,7 +926,7 @@
                                                     RESAMPLER_QUALITY,
                                                     &error);
         if (session->revResampler == NULL) {
-            LOGW("Session_SetConfig Cannot create speex resampler: %s",
+            ALOGW("Session_SetConfig Cannot create speex resampler: %s",
                  speex_resampler_strerror(error));
             speex_resampler_destroy(session->inResampler);
             session->inResampler = NULL;
@@ -1105,7 +1105,7 @@
 
     if (inBuffer == NULL  || inBuffer->raw == NULL  ||
             outBuffer == NULL || outBuffer->raw == NULL){
-        LOGW("PreProcessingFx_Process() ERROR bad pointer");
+        ALOGW("PreProcessingFx_Process() ERROR bad pointer");
         return -EINVAL;
     }
 
@@ -1443,13 +1443,13 @@
     int    status = 0;
 
     if (effect == NULL){
-        LOGW("PreProcessingFx_ProcessReverse() ERROR effect == NULL");
+        ALOGW("PreProcessingFx_ProcessReverse() ERROR effect == NULL");
         return -EINVAL;
     }
     preproc_session_t * session = (preproc_session_t *)effect->session;
 
     if (inBuffer == NULL  || inBuffer->raw == NULL){
-        LOGW("PreProcessingFx_ProcessReverse() ERROR bad pointer");
+        ALOGW("PreProcessingFx_ProcessReverse() ERROR bad pointer");
         return -EINVAL;
     }
 
@@ -1585,14 +1585,14 @@
     }
     desc =  PreProc_GetDescriptor(uuid);
     if (desc == NULL) {
-        LOGW("EffectCreate: fx not found uuid: %08x", uuid->timeLow);
+        ALOGW("EffectCreate: fx not found uuid: %08x", uuid->timeLow);
         return -EINVAL;
     }
     procId = UuidToProcId(&desc->type);
 
     session = PreProc_GetSession(procId, sessionId, ioId);
     if (session == NULL) {
-        LOGW("EffectCreate: no more session available");
+        ALOGW("EffectCreate: no more session available");
         return -EINVAL;
     }
 
diff --git a/media/libeffects/testlibs/EffectEqualizer.cpp b/media/libeffects/testlibs/EffectEqualizer.cpp
index 52fbf79..5241660 100644
--- a/media/libeffects/testlibs/EffectEqualizer.cpp
+++ b/media/libeffects/testlibs/EffectEqualizer.cpp
@@ -165,7 +165,7 @@
 
     ret = Equalizer_init(pContext);
     if (ret < 0) {
-        LOGW("EffectLibCreateEffect() init failed");
+        ALOGW("EffectLibCreateEffect() init failed");
         delete pContext;
         return ret;
     }
@@ -735,7 +735,7 @@
     case EFFECT_CMD_SET_AUDIO_MODE:
         break;
     default:
-        LOGW("Equalizer_command invalid command %d",cmdCode);
+        ALOGW("Equalizer_command invalid command %d",cmdCode);
         return -EINVAL;
     }
 
diff --git a/media/libeffects/testlibs/EffectReverb.c b/media/libeffects/testlibs/EffectReverb.c
index 419a41c..ebb72c1 100644
--- a/media/libeffects/testlibs/EffectReverb.c
+++ b/media/libeffects/testlibs/EffectReverb.c
@@ -154,7 +154,7 @@
     }
     ret = Reverb_Init(module, aux, preset);
     if (ret < 0) {
-        LOGW("EffectLibCreateEffect() init failed");
+        ALOGW("EffectLibCreateEffect() init failed");
         free(module);
         return ret;
     }
@@ -405,7 +405,7 @@
         ALOGV("Reverb_Command EFFECT_CMD_SET_AUDIO_MODE: %d", *(uint32_t *)pCmdData);
         break;
     default:
-        LOGW("Reverb_Command invalid command %d",cmdCode);
+        ALOGW("Reverb_Command invalid command %d",cmdCode);
         return -EINVAL;
     }
 
diff --git a/media/libeffects/visualizer/EffectVisualizer.cpp b/media/libeffects/visualizer/EffectVisualizer.cpp
index b2a7a35..5d70a9b 100644
--- a/media/libeffects/visualizer/EffectVisualizer.cpp
+++ b/media/libeffects/visualizer/EffectVisualizer.cpp
@@ -212,7 +212,7 @@
 
     ret = Visualizer_init(pContext);
     if (ret < 0) {
-        LOGW("VisualizerLib_Create() init failed");
+        ALOGW("VisualizerLib_Create() init failed");
         delete pContext;
         return ret;
     }
@@ -472,7 +472,7 @@
         break;
 
     default:
-        LOGW("Visualizer_command invalid command %d",cmdCode);
+        ALOGW("Visualizer_command invalid command %d",cmdCode);
         return -EINVAL;
     }
 
diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp
index 6e53a15..d74389d 100644
--- a/media/libmedia/AudioEffect.cpp
+++ b/media/libmedia/AudioEffect.cpp
@@ -101,7 +101,7 @@
     ALOGV("set %p mUserData: %p uuid: %p timeLow %08x", this, user, type, type ? type->timeLow : 0);
 
     if (mIEffect != 0) {
-        LOGW("Effect already in use");
+        ALOGW("Effect already in use");
         return INVALID_OPERATION;
     }
 
@@ -112,7 +112,7 @@
     }
 
     if (type == NULL && uuid == NULL) {
-        LOGW("Must specify at least type or uuid");
+        ALOGW("Must specify at least type or uuid");
         return BAD_VALUE;
     }
 
@@ -340,7 +340,7 @@
 
 void AudioEffect::binderDied()
 {
-    LOGW("IEffect died");
+    ALOGW("IEffect died");
     mStatus = NO_INIT;
     if (mCbf) {
         status_t status = DEAD_OBJECT;
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index dd1c6a5..c1591a4 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -535,7 +535,7 @@
             if (CC_UNLIKELY(result != NO_ERROR)) {
                 cblk->waitTimeMs += waitTimeMs;
                 if (cblk->waitTimeMs >= cblk->bufferTimeoutMs) {
-                    LOGW(   "obtainBuffer timed out (is the CPU pegged?) "
+                    ALOGW(   "obtainBuffer timed out (is the CPU pegged?) "
                             "user=%08x, server=%08x", cblk->user, cblk->server);
                     cblk->lock.unlock();
                     result = mAudioRecord->start();
@@ -546,7 +546,7 @@
                         result = AudioRecord::restoreRecord_l(cblk);
                     }
                     if (result != NO_ERROR) {
-                        LOGW("obtainBuffer create Track error %d", result);
+                        ALOGW("obtainBuffer create Track error %d", result);
                         cblk->lock.unlock();
                         return result;
                     }
@@ -764,7 +764,7 @@
     status_t result;
 
     if (!(android_atomic_or(CBLK_RESTORING_ON, &cblk->flags) & CBLK_RESTORING_MSK)) {
-        LOGW("dead IAudioRecord, creating a new one");
+        ALOGW("dead IAudioRecord, creating a new one");
         // signal old cblk condition so that other threads waiting for available buffers stop
         // waiting now
         cblk->cv.broadcast();
@@ -787,13 +787,13 @@
         cblk->cv.broadcast();
     } else {
         if (!(cblk->flags & CBLK_RESTORED_MSK)) {
-            LOGW("dead IAudioRecord, waiting for a new one to be created");
+            ALOGW("dead IAudioRecord, waiting for a new one to be created");
             mLock.unlock();
             result = cblk->cv.waitRelative(cblk->lock, milliseconds(RESTORE_TIMEOUT_MS));
             cblk->lock.unlock();
             mLock.lock();
         } else {
-            LOGW("dead IAudioRecord, already restored");
+            ALOGW("dead IAudioRecord, already restored");
             result = NO_ERROR;
             cblk->lock.unlock();
         }
@@ -810,7 +810,7 @@
     }
     cblk->lock.lock();
 
-    LOGW_IF(result != NO_ERROR, "restoreRecord_l() error %d", result);
+    ALOGW_IF(result != NO_ERROR, "restoreRecord_l() error %d", result);
 
     return result;
 }
diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp
index 61d0dad..0ef1885 100644
--- a/media/libmedia/AudioSystem.cpp
+++ b/media/libmedia/AudioSystem.cpp
@@ -56,7 +56,7 @@
             binder = sm->getService(String16("media.audio_flinger"));
             if (binder != 0)
                 break;
-            LOGW("AudioFlinger not published, waiting...");
+            ALOGW("AudioFlinger not published, waiting...");
             usleep(500000); // 0.5 s
         } while(true);
         if (gAudioFlingerClient == NULL) {
@@ -383,7 +383,7 @@
     if (gAudioErrorCallback) {
         gAudioErrorCallback(DEAD_OBJECT);
     }
-    LOGW("AudioFlinger server died!");
+    ALOGW("AudioFlinger server died!");
 }
 
 void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, void *param2) {
@@ -419,7 +419,7 @@
         } break;
     case OUTPUT_CLOSED: {
         if (gOutputs.indexOfKey(ioHandle) < 0) {
-            LOGW("ioConfigChanged() closing unknow output! %d", ioHandle);
+            ALOGW("ioConfigChanged() closing unknow output! %d", ioHandle);
             break;
         }
         ALOGV("ioConfigChanged() output %d closed", ioHandle);
@@ -435,7 +435,7 @@
     case OUTPUT_CONFIG_CHANGED: {
         int index = gOutputs.indexOfKey(ioHandle);
         if (index < 0) {
-            LOGW("ioConfigChanged() modifying unknow output! %d", ioHandle);
+            ALOGW("ioConfigChanged() modifying unknow output! %d", ioHandle);
             break;
         }
         if (param2 == 0) break;
@@ -491,7 +491,7 @@
             binder = sm->getService(String16("media.audio_policy"));
             if (binder != 0)
                 break;
-            LOGW("AudioPolicyService not published, waiting...");
+            ALOGW("AudioPolicyService not published, waiting...");
             usleep(500000); // 0.5 s
         } while(true);
         if (gAudioPolicyServiceClient == NULL) {
@@ -747,7 +747,7 @@
     Mutex::Autolock _l(AudioSystem::gLock);
     AudioSystem::gAudioPolicyService.clear();
 
-    LOGW("AudioPolicyService server died!");
+    ALOGW("AudioPolicyService server died!");
 }
 
 }; // namespace android
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index e0c6ca5..891e331 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -883,7 +883,7 @@
                     // timing out when a loop has been set and we have already written upto loop end
                     // is a normal condition: no need to wake AudioFlinger up.
                     if (cblk->user < cblk->loopEnd) {
-                        LOGW(   "obtainBuffer timed out (is the CPU pegged?) %p "
+                        ALOGW(   "obtainBuffer timed out (is the CPU pegged?) %p "
                                 "user=%08x, server=%08x", this, cblk->user, cblk->server);
                         //unlock cblk mutex before calling mAudioTrack->start() (see issue #1617140)
                         cblk->lock.unlock();
@@ -895,7 +895,7 @@
                             result = restoreTrack_l(cblk, false);
                         }
                         if (result != NO_ERROR) {
-                            LOGW("obtainBuffer create Track error %d", result);
+                            ALOGW("obtainBuffer create Track error %d", result);
                             cblk->lock.unlock();
                             return result;
                         }
@@ -918,7 +918,7 @@
     // restart track if it was disabled by audioflinger due to previous underrun
     if (mActive && (cblk->flags & CBLK_DISABLED_MSK)) {
         android_atomic_and(~CBLK_DISABLED_ON, &cblk->flags);
-        LOGW("obtainBuffer() track %p disabled, restarting", this);
+        ALOGW("obtainBuffer() track %p disabled, restarting", this);
         mAudioTrack->start();
     }
 
@@ -1164,7 +1164,7 @@
     status_t result;
 
     if (!(android_atomic_or(CBLK_RESTORING_ON, &cblk->flags) & CBLK_RESTORING_MSK)) {
-        LOGW("dead IAudioTrack, creating a new one from %s TID %d",
+        ALOGW("dead IAudioTrack, creating a new one from %s TID %d",
              fromStart ? "start()" : "obtainBuffer()", gettid());
 
         // signal old cblk condition so that other threads waiting for available buffers stop
@@ -1220,7 +1220,7 @@
             }
             if (mActive) {
                 result = mAudioTrack->start();
-                LOGW_IF(result != NO_ERROR, "restoreTrack_l() start() failed status %d", result);
+                ALOGW_IF(result != NO_ERROR, "restoreTrack_l() start() failed status %d", result);
             }
             if (fromStart && result == NO_ERROR) {
                 mNewPosition = mCblk->server + mUpdatePeriod;
@@ -1228,7 +1228,7 @@
         }
         if (result != NO_ERROR) {
             android_atomic_and(~CBLK_RESTORING_ON, &cblk->flags);
-            LOGW_IF(result != NO_ERROR, "restoreTrack_l() failed status %d", result);
+            ALOGW_IF(result != NO_ERROR, "restoreTrack_l() failed status %d", result);
         }
         mRestoreStatus = result;
         // signal old cblk condition for other threads waiting for restore completion
@@ -1236,7 +1236,7 @@
         cblk->cv.broadcast();
     } else {
         if (!(cblk->flags & CBLK_RESTORED_MSK)) {
-            LOGW("dead IAudioTrack, waiting for a new one TID %d", gettid());
+            ALOGW("dead IAudioTrack, waiting for a new one TID %d", gettid());
             mLock.unlock();
             result = cblk->cv.waitRelative(cblk->lock, milliseconds(RESTORE_TIMEOUT_MS));
             if (result == NO_ERROR) {
@@ -1245,7 +1245,7 @@
             cblk->lock.unlock();
             mLock.lock();
         } else {
-            LOGW("dead IAudioTrack, already restored TID %d", gettid());
+            ALOGW("dead IAudioTrack, already restored TID %d", gettid());
             result = mRestoreStatus;
             cblk->lock.unlock();
         }
@@ -1259,7 +1259,7 @@
     }
     cblk->lock.lock();
 
-    LOGW_IF(result != NO_ERROR, "restoreTrack_l() error %d TID %d", result, gettid());
+    ALOGW_IF(result != NO_ERROR, "restoreTrack_l() error %d TID %d", result, gettid());
 
     return result;
 }
@@ -1328,7 +1328,7 @@
             bufferTimeoutMs = MAX_RUN_TIMEOUT_MS;
         }
     } else if (u > server) {
-        LOGW("stepServer occurred after track reset");
+        ALOGW("stepServer occurred after track reset");
         u = server;
     }
 
@@ -1349,7 +1349,7 @@
 bool audio_track_cblk_t::stepServer(uint32_t frameCount)
 {
     if (!tryLock()) {
-        LOGW("stepServer() could not lock cblk");
+        ALOGW("stepServer() could not lock cblk");
         return false;
     }
 
@@ -1367,13 +1367,13 @@
         // stepServer() is called After the flush() has reset u & s and
         // we have s > u
         if (s > user) {
-            LOGW("stepServer occurred after track reset");
+            ALOGW("stepServer occurred after track reset");
             s = user;
         }
     }
 
     if (s >= loopEnd) {
-        LOGW_IF(s > loopEnd, "stepServer: s %u > loopEnd %u", s, loopEnd);
+        ALOGW_IF(s > loopEnd, "stepServer: s %u > loopEnd %u", s, loopEnd);
         s = loopStart;
         if (--loopCount == 0) {
             loopEnd = UINT_MAX;
@@ -1428,7 +1428,7 @@
         } else {
             // do not block on mutex shared with client on AudioFlinger side
             if (!tryLock()) {
-                LOGW("framesReady() could not lock cblk");
+                ALOGW("framesReady() could not lock cblk");
                 return 0;
             }
             uint32_t frames = UINT_MAX;
diff --git a/media/libmedia/IAudioRecord.cpp b/media/libmedia/IAudioRecord.cpp
index ba0d55b..8c7a960 100644
--- a/media/libmedia/IAudioRecord.cpp
+++ b/media/libmedia/IAudioRecord.cpp
@@ -50,7 +50,7 @@
         if (status == NO_ERROR) {
             status = reply.readInt32();
         } else {
-            LOGW("start() error: %s", strerror(-status));
+            ALOGW("start() error: %s", strerror(-status));
         }
         return status;
     }
diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp
index bc8ff34..0b372f3 100644
--- a/media/libmedia/IAudioTrack.cpp
+++ b/media/libmedia/IAudioTrack.cpp
@@ -54,7 +54,7 @@
         if (status == NO_ERROR) {
             status = reply.readInt32();
         } else {
-            LOGW("start() error: %s", strerror(-status));
+            ALOGW("start() error: %s", strerror(-status));
         }
         return status;
     }
@@ -109,7 +109,7 @@
         if (status == NO_ERROR) {
             status = reply.readInt32();
         } else {
-            LOGW("attachAuxEffect() error: %s", strerror(-status));
+            ALOGW("attachAuxEffect() error: %s", strerror(-status));
         }
         return status;
     }
diff --git a/media/libmedia/IMediaDeathNotifier.cpp b/media/libmedia/IMediaDeathNotifier.cpp
index da33edb..08b2286 100644
--- a/media/libmedia/IMediaDeathNotifier.cpp
+++ b/media/libmedia/IMediaDeathNotifier.cpp
@@ -44,7 +44,7 @@
             if (binder != 0) {
                 break;
              }
-             LOGW("Media player service not published, waiting...");
+             ALOGW("Media player service not published, waiting...");
              usleep(500000); // 0.5 s
         } while(true);
 
@@ -76,7 +76,7 @@
 
 void
 IMediaDeathNotifier::DeathNotifier::binderDied(const wp<IBinder>& who) {
-    LOGW("media server died");
+    ALOGW("media server died");
 
     // Need to do this with the lock held
     SortedVector< wp<IMediaDeathNotifier> > list;
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index 7d2fbce..d2f5f71 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -407,7 +407,7 @@
 
 #define CHECK_INTERFACE(interface, data, reply) \
         do { if (!data.enforceInterface(interface::getInterfaceDescriptor())) { \
-            LOGW("Call incorrectly routed to " #interface); \
+            ALOGW("Call incorrectly routed to " #interface); \
             return PERMISSION_DENIED; \
         } } while (0)
 
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 109f294..c9e8bc2 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -620,7 +620,7 @@
             const char *defaultXmlFile = "/etc/media_profiles.xml";
             FILE *fp = fopen(defaultXmlFile, "r");
             if (fp == NULL) {
-                LOGW("could not find media config xml file");
+                ALOGW("could not find media config xml file");
                 sInstance = createDefaultInstance();
             } else {
                 fclose(fp);  // close the file first.
diff --git a/media/libmedia/MediaScanner.cpp b/media/libmedia/MediaScanner.cpp
index cda185f..79cab74 100644
--- a/media/libmedia/MediaScanner.cpp
+++ b/media/libmedia/MediaScanner.cpp
@@ -153,7 +153,7 @@
 
     DIR* dir = opendir(path);
     if (!dir) {
-        LOGW("Error opening directory '%s', skipping: %s.", path, strerror(errno));
+        ALOGW("Error opening directory '%s', skipping: %s.", path, strerror(errno));
         return MEDIA_SCAN_RESULT_SKIPPED;
     }
 
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 28b54b5..6a38ff1 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -950,7 +950,7 @@
     mLock.unlock();
 
     ALOGV_IF(lResult, "Tone started, time %d\n", (unsigned int)(systemTime()/1000000));
-    LOGW_IF(!lResult, "Tone start failed!!!, time %d\n", (unsigned int)(systemTime()/1000000));
+    ALOGW_IF(!lResult, "Tone start failed!!!, time %d\n", (unsigned int)(systemTime()/1000000));
 
     return lResult;
 }
@@ -1261,7 +1261,7 @@
                 // must reload lpToneDesc as prepareWave() may change mpToneDesc
                 lpToneDesc = lpToneGen->mpToneDesc;
             } else {
-                LOGW("Cbk restarting prepareWave() failed\n");
+                ALOGW("Cbk restarting prepareWave() failed\n");
                 lpToneGen->mState = TONE_IDLE;
                 lpToneGen->mpAudioTrack->stop();
                 // Force loop exit
diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp
index fd8c065..1658f41 100644
--- a/media/libmedia/mediametadataretriever.cpp
+++ b/media/libmedia/mediametadataretriever.cpp
@@ -43,7 +43,7 @@
             if (binder != 0) {
                 break;
             }
-            LOGW("MediaPlayerService not published, waiting...");
+            ALOGW("MediaPlayerService not published, waiting...");
             usleep(500000); // 0.5 s
         } while(true);
         if (sDeathNotifier == NULL) {
@@ -160,7 +160,7 @@
 void MediaMetadataRetriever::DeathNotifier::binderDied(const wp<IBinder>& who) {
     Mutex::Autolock lock(MediaMetadataRetriever::sServiceLock);
     MediaMetadataRetriever::sService.clear();
-    LOGW("MediaMetadataRetriever server died!");
+    ALOGW("MediaMetadataRetriever server died!");
 }
 
 MediaMetadataRetriever::DeathNotifier::~DeathNotifier()
diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp
index 695c4a8..6054749 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -417,10 +417,10 @@
     ALOGV("seekTo %d", msec);
     if ((mPlayer != 0) && ( mCurrentState & ( MEDIA_PLAYER_STARTED | MEDIA_PLAYER_PREPARED | MEDIA_PLAYER_PAUSED |  MEDIA_PLAYER_PLAYBACK_COMPLETE) ) ) {
         if ( msec < 0 ) {
-            LOGW("Attempt to seek to invalid position: %d", msec);
+            ALOGW("Attempt to seek to invalid position: %d", msec);
             msec = 0;
         } else if ((mDuration > 0) && (msec > mDuration)) {
-            LOGW("Attempt to seek to past end of file: request = %d, EOF = %d", msec, mDuration);
+            ALOGW("Attempt to seek to past end of file: request = %d, EOF = %d", msec, mDuration);
             msec = mDuration;
         }
         // cache duration
@@ -666,7 +666,7 @@
         // ext1: Media framework error code.
         // ext2: Implementation dependant error code.
         if (ext1 != MEDIA_INFO_VIDEO_TRACK_LAGGING) {
-            LOGW("info/warning (%d, %d)", ext1, ext2);
+            ALOGW("info/warning (%d, %d)", ext1, ext2);
         }
         break;
     case MEDIA_SEEK_COMPLETE:
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 487c433..91221ac 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -794,7 +794,7 @@
                 NATIVE_WINDOW_API_MEDIA);
 
         if (err != OK) {
-            LOGW("native_window_api_disconnect returned an error: %s (%d)",
+            ALOGW("native_window_api_disconnect returned an error: %s (%d)",
                     strerror(-err), err);
         }
     }
@@ -1772,7 +1772,7 @@
 
     } else if (params & kBatteryDataAudioFlingerStop) {
         if (mBatteryAudio.refCount <= 0) {
-            LOGW("Battery track warning: refCount is <= 0");
+            ALOGW("Battery track warning: refCount is <= 0");
             return;
         }
 
@@ -1825,7 +1825,7 @@
         }
     } else {
         if (info.refCount == 0) {
-            LOGW("Battery track warning: refCount is already 0");
+            ALOGW("Battery track warning: refCount is already 0");
             return;
         } else if (info.refCount < 0) {
             LOGE("Battery track error: refCount < 0");
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 2be0ae2..87305ee 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -382,7 +382,7 @@
 
     // This is meant for backward compatibility for MediaRecorder.java
     if (timeUs <= 0) {
-        LOGW("Max file duration is not positive: %lld us. Disabling duration limit.", timeUs);
+        ALOGW("Max file duration is not positive: %lld us. Disabling duration limit.", timeUs);
         timeUs = 0; // Disable the duration limit for zero or negative values.
     } else if (timeUs <= 100000LL) {  // XXX: 100 milli-seconds
         LOGE("Max file duration is too short: %lld us", timeUs);
@@ -390,7 +390,7 @@
     }
 
     if (timeUs <= 15 * 1000000LL) {
-        LOGW("Target duration (%lld us) too short to be respected", timeUs);
+        ALOGW("Target duration (%lld us) too short to be respected", timeUs);
     }
     mMaxFileDurationUs = timeUs;
     return OK;
@@ -401,7 +401,7 @@
 
     // This is meant for backward compatibility for MediaRecorder.java
     if (bytes <= 0) {
-        LOGW("Max file size is not positive: %lld bytes. "
+        ALOGW("Max file size is not positive: %lld bytes. "
              "Disabling file size limit.", bytes);
         bytes = 0; // Disable the file size limit for zero or negative values.
     } else if (bytes <= 1024) {  // XXX: 1 kB
@@ -410,7 +410,7 @@
     }
 
     if (bytes <= 100 * 1024) {
-        LOGW("Target file size (%lld bytes) is too small to be respected", bytes);
+        ALOGW("Target file size (%lld bytes) is too small to be respected", bytes);
     }
 
     mMaxFileSizeBytes = bytes;
@@ -1022,11 +1022,11 @@
     int maxFrameRate = mEncoderProfiles->getVideoEncoderParamByName(
                         "enc.vid.fps.max", mVideoEncoder);
     if (mFrameRate < minFrameRate && mFrameRate != -1) {
-        LOGW("Intended video encoding frame rate (%d fps) is too small"
+        ALOGW("Intended video encoding frame rate (%d fps) is too small"
              " and will be set to (%d fps)", mFrameRate, minFrameRate);
         mFrameRate = minFrameRate;
     } else if (mFrameRate > maxFrameRate) {
-        LOGW("Intended video encoding frame rate (%d fps) is too large"
+        ALOGW("Intended video encoding frame rate (%d fps) is too large"
              " and will be set to (%d fps)", mFrameRate, maxFrameRate);
         mFrameRate = maxFrameRate;
     }
@@ -1039,11 +1039,11 @@
     int maxBitRate = mEncoderProfiles->getVideoEncoderParamByName(
                         "enc.vid.bps.max", mVideoEncoder);
     if (mVideoBitRate < minBitRate) {
-        LOGW("Intended video encoding bit rate (%d bps) is too small"
+        ALOGW("Intended video encoding bit rate (%d bps) is too small"
              " and will be set to (%d bps)", mVideoBitRate, minBitRate);
         mVideoBitRate = minBitRate;
     } else if (mVideoBitRate > maxBitRate) {
-        LOGW("Intended video encoding bit rate (%d bps) is too large"
+        ALOGW("Intended video encoding bit rate (%d bps) is too large"
              " and will be set to (%d bps)", mVideoBitRate, maxBitRate);
         mVideoBitRate = maxBitRate;
     }
@@ -1056,11 +1056,11 @@
     int maxFrameWidth = mEncoderProfiles->getVideoEncoderParamByName(
                         "enc.vid.width.max", mVideoEncoder);
     if (mVideoWidth < minFrameWidth) {
-        LOGW("Intended video encoding frame width (%d) is too small"
+        ALOGW("Intended video encoding frame width (%d) is too small"
              " and will be set to (%d)", mVideoWidth, minFrameWidth);
         mVideoWidth = minFrameWidth;
     } else if (mVideoWidth > maxFrameWidth) {
-        LOGW("Intended video encoding frame width (%d) is too large"
+        ALOGW("Intended video encoding frame width (%d) is too large"
              " and will be set to (%d)", mVideoWidth, maxFrameWidth);
         mVideoWidth = maxFrameWidth;
     }
@@ -1151,7 +1151,7 @@
             mEncoderProfiles->getAudioEncoderParamByName(
                 "enc.aud.bps.min", mAudioEncoder);
     if (mAudioBitRate < minAudioBitRate) {
-        LOGW("Intended audio encoding bit rate (%d) is too small"
+        ALOGW("Intended audio encoding bit rate (%d) is too small"
             " and will be set to (%d)", mAudioBitRate, minAudioBitRate);
         mAudioBitRate = minAudioBitRate;
     }
@@ -1160,7 +1160,7 @@
             mEncoderProfiles->getAudioEncoderParamByName(
                 "enc.aud.bps.max", mAudioEncoder);
     if (mAudioBitRate > maxAudioBitRate) {
-        LOGW("Intended audio encoding bit rate (%d) is too large"
+        ALOGW("Intended audio encoding bit rate (%d) is too large"
             " and will be set to (%d)", mAudioBitRate, maxAudioBitRate);
         mAudioBitRate = maxAudioBitRate;
     }
@@ -1173,7 +1173,7 @@
             mEncoderProfiles->getAudioEncoderParamByName(
                 "enc.aud.hz.min", mAudioEncoder);
     if (mSampleRate < minSampleRate) {
-        LOGW("Intended audio sample rate (%d) is too small"
+        ALOGW("Intended audio sample rate (%d) is too small"
             " and will be set to (%d)", mSampleRate, minSampleRate);
         mSampleRate = minSampleRate;
     }
@@ -1182,7 +1182,7 @@
             mEncoderProfiles->getAudioEncoderParamByName(
                 "enc.aud.hz.max", mAudioEncoder);
     if (mSampleRate > maxSampleRate) {
-        LOGW("Intended audio sample rate (%d) is too large"
+        ALOGW("Intended audio sample rate (%d) is too large"
             " and will be set to (%d)", mSampleRate, maxSampleRate);
         mSampleRate = maxSampleRate;
     }
@@ -1195,7 +1195,7 @@
             mEncoderProfiles->getAudioEncoderParamByName(
                 "enc.aud.ch.min", mAudioEncoder);
     if (mAudioChannels < minChannels) {
-        LOGW("Intended number of audio channels (%d) is too small"
+        ALOGW("Intended number of audio channels (%d) is too small"
             " and will be set to (%d)", mAudioChannels, minChannels);
         mAudioChannels = minChannels;
     }
@@ -1204,7 +1204,7 @@
             mEncoderProfiles->getAudioEncoderParamByName(
                 "enc.aud.ch.max", mAudioEncoder);
     if (mAudioChannels > maxChannels) {
-        LOGW("Intended number of audio channels (%d) is too large"
+        ALOGW("Intended number of audio channels (%d) is too large"
             " and will be set to (%d)", mAudioChannels, maxChannels);
         mAudioChannels = maxChannels;
     }
@@ -1217,11 +1217,11 @@
     int maxFrameHeight = mEncoderProfiles->getVideoEncoderParamByName(
                         "enc.vid.height.max", mVideoEncoder);
     if (mVideoHeight < minFrameHeight) {
-        LOGW("Intended video encoding frame height (%d) is too small"
+        ALOGW("Intended video encoding frame height (%d) is too small"
              " and will be set to (%d)", mVideoHeight, minFrameHeight);
         mVideoHeight = minFrameHeight;
     } else if (mVideoHeight > maxFrameHeight) {
-        LOGW("Intended video encoding frame height (%d) is too large"
+        ALOGW("Intended video encoding frame height (%d) is too large"
              " and will be set to (%d)", mVideoHeight, maxFrameHeight);
         mVideoHeight = maxFrameHeight;
     }
@@ -1406,7 +1406,7 @@
             true /* createEncoder */, cameraSource,
             NULL, encoder_flags);
     if (encoder == NULL) {
-        LOGW("Failed to create the encoder");
+        ALOGW("Failed to create the encoder");
         // When the encoder fails to be created, we need
         // release the camera source due to the camera's lock
         // and unlock mechanism.
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index ebf5fab..8ca37b86 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -394,7 +394,7 @@
             if (portIndex == kPortIndexInput && i == 0) {
                 // Only log this warning once per allocation round.
 
-                LOGW("OMX.TI.DUCATI1.VIDEO.DECODER requires the use of "
+                ALOGW("OMX.TI.DUCATI1.VIDEO.DECODER requires the use of "
                      "OMX_AllocateBuffer instead of the preferred "
                      "OMX_UseBuffer. Vendor must fix this.");
             }
@@ -454,7 +454,7 @@
     OMX_U32 usage = 0;
     err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
     if (err != 0) {
-        LOGW("querying usage flags from OMX IL component failed: %d", err);
+        ALOGW("querying usage flags from OMX IL component failed: %d", err);
         // XXX: Currently this error is logged, but not fatal.
         usage = 0;
     }
@@ -734,7 +734,7 @@
                 &roleParams, sizeof(roleParams));
 
         if (err != OK) {
-            LOGW("[%s] Failed to set standard component role '%s'.",
+            ALOGW("[%s] Failed to set standard component role '%s'.",
                  mComponentName.c_str(), role);
         }
     }
diff --git a/media/libstagefright/AVIExtractor.cpp b/media/libstagefright/AVIExtractor.cpp
index 142fa5b..91555ba 100644
--- a/media/libstagefright/AVIExtractor.cpp
+++ b/media/libstagefright/AVIExtractor.cpp
@@ -625,7 +625,7 @@
         }
 
         if (mime == NULL) {
-            LOGW("Unsupported video format '%c%c%c%c'",
+            ALOGW("Unsupported video format '%c%c%c%c'",
                  (char)(handler >> 24),
                  (char)((handler >> 16) & 0xff),
                  (char)((handler >> 8) & 0xff),
@@ -705,7 +705,7 @@
         if (format == 0x55) {
             track->mMeta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG);
         } else {
-            LOGW("Unsupported audio format = 0x%04x", format);
+            ALOGW("Unsupported audio format = 0x%04x", format);
         }
 
         uint32_t numChannels = U16LE_AT(&data[2]);
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp
index 3fae957..2172cc0 100644
--- a/media/libstagefright/AudioSource.cpp
+++ b/media/libstagefright/AudioSource.cpp
@@ -37,7 +37,7 @@
             break;
         }
         case AudioRecord::EVENT_OVERRUN: {
-            LOGW("AudioRecord reported overrun!");
+            ALOGW("AudioRecord reported overrun!");
             break;
         }
         default:
@@ -259,7 +259,7 @@
     ALOGV("dataCallbackTimestamp: %lld us", timeUs);
     Mutex::Autolock autoLock(mLock);
     if (!mStarted) {
-        LOGW("Spurious callback from AudioRecord. Drop the audio data.");
+        ALOGW("Spurious callback from AudioRecord. Drop the audio data.");
         return OK;
     }
 
@@ -301,7 +301,7 @@
                     audioBuffer.i16, audioBuffer.size);
     } else {
         if (audioBuffer.size == 0) {
-            LOGW("Nothing is available from AudioRecord callback buffer");
+            ALOGW("Nothing is available from AudioRecord callback buffer");
             buffer->release();
             return OK;
         }
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 966b457..94d18fa8 100755
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -649,7 +649,7 @@
         if (NO_ERROR !=
             mFrameCompleteCondition.waitRelative(mLock,
                     mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) {
-            LOGW("Timed out waiting for outstanding frames being encoded: %d",
+            ALOGW("Timed out waiting for outstanding frames being encoded: %d",
                 mFramesBeingEncoded.size());
         }
     }
@@ -666,7 +666,7 @@
     }
 
     if (mNumGlitches > 0) {
-        LOGW("%d long delays between neighboring video frames", mNumGlitches);
+        ALOGW("%d long delays between neighboring video frames", mNumGlitches);
     }
 
     CHECK_EQ(mNumFramesReceived, mNumFramesEncoded + mNumFramesDropped);
@@ -744,10 +744,10 @@
                     mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) {
                 if (mCameraRecordingProxy != 0 &&
                     !mCameraRecordingProxy->asBinder()->isBinderAlive()) {
-                    LOGW("camera recording proxy is gone");
+                    ALOGW("camera recording proxy is gone");
                     return ERROR_END_OF_STREAM;
                 }
-                LOGW("Timed out waiting for incoming camera video frames: %lld us",
+                ALOGW("Timed out waiting for incoming camera video frames: %lld us",
                     mLastFrameTimestampUs);
             }
         }
diff --git a/media/libstagefright/DRMExtractor.cpp b/media/libstagefright/DRMExtractor.cpp
index 1f3d581..9452ab1 100644
--- a/media/libstagefright/DRMExtractor.cpp
+++ b/media/libstagefright/DRMExtractor.cpp
@@ -286,7 +286,7 @@
             *mimeType = String8("drm+es_based+") + decryptHandle->mimeType;
         } else if (decryptHandle->decryptApiType == DecryptApiType::WV_BASED) {
             *mimeType = MEDIA_MIMETYPE_CONTAINER_WVM;
-            LOGW("SniffWVM: found match\n");
+            ALOGW("SniffWVM: found match\n");
         }
         *confidence = 10.0f;
 
diff --git a/media/libstagefright/ESDS.cpp b/media/libstagefright/ESDS.cpp
index 1b225fa..4a0c35c 100644
--- a/media/libstagefright/ESDS.cpp
+++ b/media/libstagefright/ESDS.cpp
@@ -162,7 +162,7 @@
             offset -= 2;
             size += 2;
 
-            LOGW("Found malformed 'esds' atom, ignoring missing OCR_ES_Id.");
+            ALOGW("Found malformed 'esds' atom, ignoring missing OCR_ES_Id.");
         }
     }
 
diff --git a/media/libstagefright/FLACExtractor.cpp b/media/libstagefright/FLACExtractor.cpp
index a0c08e2..381a2d1 100644
--- a/media/libstagefright/FLACExtractor.cpp
+++ b/media/libstagefright/FLACExtractor.cpp
@@ -366,7 +366,7 @@
         }
         break;
     default:
-        LOGW("FLACParser::metadataCallback unexpected type %u", metadata->type);
+        ALOGW("FLACParser::metadataCallback unexpected type %u", metadata->type);
         break;
     }
 }
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 26b8a42..43bd1ac 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1519,7 +1519,7 @@
     } else if (a00 == -kFixedOne && a01 == 0 && a10 == 0 && a11 == -kFixedOne) {
         rotationDegrees = 180;
     } else {
-        LOGW("We only support 0,90,180,270 degree rotation matrices");
+        ALOGW("We only support 0,90,180,270 degree rotation matrices");
         rotationDegrees = 0;
     }
 
@@ -2422,7 +2422,7 @@
     }
 
     if (LegacySniffMPEG4(source, mimeType, confidence)) {
-        LOGW("Identified supported mpeg4 through LegacySniffMPEG4.");
+        ALOGW("Identified supported mpeg4 through LegacySniffMPEG4.");
         return true;
     }
 
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index b808cc0..8b270cb 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -443,7 +443,7 @@
         // If file size is set to be larger than the 32 bit file
         // size limit, treat it as an error.
         if (mMaxFileSizeLimitBytes > kMax32BitFileSize) {
-            LOGW("32-bit file size limit (%lld bytes) too big. "
+            ALOGW("32-bit file size limit (%lld bytes) too big. "
                  "It is changed to %lld bytes",
                 mMaxFileSizeLimitBytes, kMax32BitFileSize);
             mMaxFileSizeLimitBytes = kMax32BitFileSize;
@@ -1173,7 +1173,7 @@
         size_t sampleCount, int32_t duration) {
 
     if (duration == 0) {
-        LOGW("0-duration samples found: %d", sampleCount);
+        ALOGW("0-duration samples found: %d", sampleCount);
     }
     SttsTableEntry sttsEntry(sampleCount, duration);
     mSttsTableEntries.push_back(sttsEntry);
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 2dc19fd..2244c6d 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -484,7 +484,7 @@
                 // For OMX.SEC.* decoders we can enable a special mode that
                 // gives the client access to the framebuffer contents.
 
-                LOGW("Component '%s' does not give the client access to "
+                ALOGW("Component '%s' does not give the client access to "
                      "the framebuffer contents. Skipping.",
                      componentName);
 
@@ -1093,7 +1093,7 @@
             mNode, OMX_IndexParamVideoErrorCorrection,
             &errorCorrectionType, sizeof(errorCorrectionType));
     if (err != OK) {
-        LOGW("Error correction param query is not supported");
+        ALOGW("Error correction param query is not supported");
         return OK;  // Optional feature. Ignore this failure
     }
 
@@ -1107,7 +1107,7 @@
             mNode, OMX_IndexParamVideoErrorCorrection,
             &errorCorrectionType, sizeof(errorCorrectionType));
     if (err != OK) {
-        LOGW("Error correction param configuration is not supported");
+        ALOGW("Error correction param configuration is not supported");
     }
 
     // Optional feature. Ignore the failure.
@@ -1579,7 +1579,7 @@
                 &roleParams, sizeof(roleParams));
 
         if (err != OK) {
-            LOGW("Failed to set standard component role '%s'.", role);
+            ALOGW("Failed to set standard component role '%s'.", role);
         }
     }
 }
@@ -1863,7 +1863,7 @@
     OMX_U32 usage = 0;
     err = mOMX->getGraphicBufferUsage(mNode, kPortIndexOutput, &usage);
     if (err != 0) {
-        LOGW("querying usage flags from OMX IL component failed: %d", err);
+        ALOGW("querying usage flags from OMX IL component failed: %d", err);
         // XXX: Currently this error is logged, but not fatal.
         usage = 0;
     }
@@ -2214,7 +2214,7 @@
 
 void OMXCodec::on_message(const omx_message &msg) {
     if (mState == ERROR) {
-        LOGW("Dropping OMX message - we're in ERROR state.");
+        ALOGW("Dropping OMX message - we're in ERROR state.");
         return;
     }
 
@@ -2242,7 +2242,7 @@
 
             CHECK(i < buffers->size());
             if ((*buffers)[i].mStatus != OWNED_BY_COMPONENT) {
-                LOGW("We already own input buffer %p, yet received "
+                ALOGW("We already own input buffer %p, yet received "
                      "an EMPTY_BUFFER_DONE.", buffer);
             }
 
@@ -2302,7 +2302,7 @@
             BufferInfo *info = &buffers->editItemAt(i);
 
             if (info->mStatus != OWNED_BY_COMPONENT) {
-                LOGW("We already own output buffer %p, yet received "
+                ALOGW("We already own output buffer %p, yet received "
                      "a FILL_BUFFER_DONE.", buffer);
             }
 
@@ -3556,7 +3556,7 @@
 
 status_t OMXCodec::setAACFormat(int32_t numChannels, int32_t sampleRate, int32_t bitRate) {
     if (numChannels > 2)
-        LOGW("Number of channels: (%d) \n", numChannels);
+        ALOGW("Number of channels: (%d) \n", numChannels);
 
     if (mIsEncoder) {
         //////////////// input port ////////////////////
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index 2634da0..8875af0 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -127,7 +127,7 @@
 
     status_t err = decoder->start();
     if (err != OK) {
-        LOGW("OMXCodec::start returned error %d (0x%08x)\n", err, err);
+        ALOGW("OMXCodec::start returned error %d (0x%08x)\n", err, err);
         return NULL;
     }
 
diff --git a/media/libstagefright/TimedEventQueue.cpp b/media/libstagefright/TimedEventQueue.cpp
index 43511ec..12c9c36 100644
--- a/media/libstagefright/TimedEventQueue.cpp
+++ b/media/libstagefright/TimedEventQueue.cpp
@@ -265,7 +265,7 @@
                 static int64_t kMaxTimeoutUs = 10000000ll;  // 10 secs
                 bool timeoutCapped = false;
                 if (delay_us > kMaxTimeoutUs) {
-                    LOGW("delay_us exceeds max timeout: %lld us", delay_us);
+                    ALOGW("delay_us exceeds max timeout: %lld us", delay_us);
 
                     // We'll never block for more than 10 secs, instead
                     // we will split up the full timeout into chunks of
@@ -315,7 +315,7 @@
         }
     }
 
-    LOGW("Event %d was not found in the queue, already cancelled?", id);
+    ALOGW("Event %d was not found in the queue, already cancelled?", id);
 
     return NULL;
 }
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.cpp b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
index c408b2c..f3283a4 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
@@ -326,7 +326,7 @@
                 mUpsamplingFactor = mConfig->aacPlusUpsamplingFactor;
                 // Check on the sampling rate to see whether it is changed.
                 if (mConfig->samplingRate != prevSamplingRate) {
-                    LOGW("Sample rate was %d Hz, but now is %d Hz",
+                    ALOGW("Sample rate was %d Hz, but now is %d Hz",
                             prevSamplingRate, mConfig->samplingRate);
 
                     // We'll hold onto the input buffer and will decode
@@ -341,7 +341,7 @@
                     mConfig->extendedAudioObjectType == MP4AUDIO_LTP) {
                     if (mUpsamplingFactor == 2) {
                         // The stream turns out to be not aacPlus mode anyway
-                        LOGW("Disable AAC+/eAAC+ since extended audio object "
+                        ALOGW("Disable AAC+/eAAC+ since extended audio object "
                              "type is %d",
                              mConfig->extendedAudioObjectType);
                         mConfig->aacPlusEnabled = 0;
@@ -351,7 +351,7 @@
                         // aacPlus mode does not buy us anything, but to cause
                         // 1. CPU load to increase, and
                         // 2. a half speed of decoding
-                        LOGW("Disable AAC+/eAAC+ since upsampling factor is 1");
+                        ALOGW("Disable AAC+/eAAC+ since upsampling factor is 1");
                         mConfig->aacPlusEnabled = 0;
                     }
                 }
@@ -367,7 +367,7 @@
             inHeader->nFilledLen -= mConfig->inputBufferUsedLength;
             inHeader->nOffset += mConfig->inputBufferUsedLength;
         } else {
-            LOGW("AAC decoder returned error %d, substituting silence",
+            ALOGW("AAC decoder returned error %d, substituting silence",
                  decoderErr);
 
             memset(outHeader->pBuffer + outHeader->nOffset, 0, numOutBytes);
diff --git a/media/libstagefright/codecs/aacenc/AACEncoder.cpp b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
index 2b15b75..a94ccab 100644
--- a/media/libstagefright/codecs/aacenc/AACEncoder.cpp
+++ b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
@@ -135,7 +135,7 @@
 
 status_t AACEncoder::start(MetaData *params) {
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
@@ -177,7 +177,7 @@
     }
 
     if (!mStarted) {
-        LOGW("Call stop() when encoder has not started");
+        ALOGW("Call stop() when encoder has not started");
         return ERROR_END_OF_STREAM;
     }
 
diff --git a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
index d361ef4..2f158b6 100644
--- a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
+++ b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
@@ -71,7 +71,7 @@
 
 status_t AMRNBEncoder::start(MetaData *params) {
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
@@ -105,7 +105,7 @@
 
 status_t AMRNBEncoder::stop() {
     if (!mStarted) {
-        LOGW("Call stop() when encoder has not started.");
+        ALOGW("Call stop() when encoder has not started.");
         return OK;
     }
 
diff --git a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
index 5eacc16..ebc2e5d 100644
--- a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
+++ b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
@@ -125,7 +125,7 @@
 
 status_t AMRWBEncoder::start(MetaData *params) {
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
@@ -150,7 +150,7 @@
 
 status_t AMRWBEncoder::stop() {
     if (!mStarted) {
-        LOGW("Call stop() when encoder has not started");
+        ALOGW("Call stop() when encoder has not started");
         return OK;
     }
 
diff --git a/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp
index 37df634..40f6f1a 100644
--- a/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp
+++ b/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp
@@ -336,7 +336,7 @@
     }
 
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
@@ -368,7 +368,7 @@
 status_t AVCEncoder::stop() {
     ALOGV("stop");
     if (!mStarted) {
-        LOGW("Call stop() when encoder has not started");
+        ALOGW("Call stop() when encoder has not started");
         return OK;
     }
 
diff --git a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
index bedfc58..be669f2 100644
--- a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
+++ b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
@@ -371,7 +371,7 @@
                     mHandle, vol_data, &vol_size, 1, mWidth, mHeight, mode);
 
             if (!success) {
-                LOGW("PVInitVideoDecoder failed. Unsupported content?");
+                ALOGW("PVInitVideoDecoder failed. Unsupported content?");
 
                 notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
                 mSignalledError = true;
diff --git a/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp b/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp
index 1188780..2c4b63d 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp
@@ -46,7 +46,7 @@
                     LOGE("Unsupported level (%d) for H263", omxLevel);
                     return BAD_VALUE;
                 } else {
-                    LOGW("PV does not support level configuration for H263");
+                    ALOGW("PV does not support level configuration for H263");
                     profileLevel = CORE_PROFILE_LEVEL2;
                     break;
                 }
@@ -314,7 +314,7 @@
     }
 
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
@@ -341,7 +341,7 @@
 status_t M4vH263Encoder::stop() {
     ALOGV("stop");
     if (!mStarted) {
-        LOGW("Call stop() when encoder has not started");
+        ALOGW("Call stop() when encoder has not started");
         return OK;
     }
 
diff --git a/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp b/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
index 47dbd5c..74e893f 100644
--- a/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
+++ b/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
@@ -353,7 +353,7 @@
 
         int err = vorbis_dsp_synthesis(mState, &pack, 1);
         if (err != 0) {
-            LOGW("vorbis_dsp_synthesis returned %d", err);
+            ALOGW("vorbis_dsp_synthesis returned %d", err);
         } else {
             numFrames = vorbis_dsp_pcmout(
                     mState, (int16_t *)outHeader->pBuffer,
diff --git a/media/libstagefright/colorconversion/SoftwareRenderer.cpp b/media/libstagefright/colorconversion/SoftwareRenderer.cpp
index 3246021..e892f92 100644
--- a/media/libstagefright/colorconversion/SoftwareRenderer.cpp
+++ b/media/libstagefright/colorconversion/SoftwareRenderer.cpp
@@ -135,7 +135,7 @@
     ANativeWindowBuffer *buf;
     int err;
     if ((err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf)) != 0) {
-        LOGW("Surface::dequeueBuffer returned error %d", err);
+        ALOGW("Surface::dequeueBuffer returned error %d", err);
         return;
     }
 
@@ -225,7 +225,7 @@
     CHECK_EQ(0, mapper.unlock(buf->handle));
 
     if ((err = mNativeWindow->queueBuffer(mNativeWindow.get(), buf)) != 0) {
-        LOGW("Surface::queueBuffer returned error %d", err);
+        ALOGW("Surface::queueBuffer returned error %d", err);
     }
     buf = NULL;
 }
diff --git a/media/libstagefright/foundation/AHierarchicalStateMachine.cpp b/media/libstagefright/foundation/AHierarchicalStateMachine.cpp
index 3b3f786..40c5a3c 100644
--- a/media/libstagefright/foundation/AHierarchicalStateMachine.cpp
+++ b/media/libstagefright/foundation/AHierarchicalStateMachine.cpp
@@ -63,7 +63,7 @@
         return;
     }
 
-    LOGW("Warning message %s unhandled in root state.",
+    ALOGW("Warning message %s unhandled in root state.",
          msg->debugString().c_str());
 }
 
diff --git a/media/libstagefright/foundation/ALooperRoster.cpp b/media/libstagefright/foundation/ALooperRoster.cpp
index e399f2f..dff931d 100644
--- a/media/libstagefright/foundation/ALooperRoster.cpp
+++ b/media/libstagefright/foundation/ALooperRoster.cpp
@@ -82,7 +82,7 @@
     ssize_t index = mHandlers.indexOfKey(msg->target());
 
     if (index < 0) {
-        LOGW("failed to post message. Target handler not registered.");
+        ALOGW("failed to post message. Target handler not registered.");
         return -ENOENT;
     }
 
@@ -91,7 +91,7 @@
     sp<ALooper> looper = info.mLooper.promote();
 
     if (looper == NULL) {
-        LOGW("failed to post message. "
+        ALOGW("failed to post message. "
              "Target handler %d still registered, but object gone.",
              msg->target());
 
@@ -113,7 +113,7 @@
         ssize_t index = mHandlers.indexOfKey(msg->target());
 
         if (index < 0) {
-            LOGW("failed to deliver message. Target handler not registered.");
+            ALOGW("failed to deliver message. Target handler not registered.");
             return;
         }
 
@@ -121,7 +121,7 @@
         handler = info.mHandler.promote();
 
         if (handler == NULL) {
-            LOGW("failed to deliver message. "
+            ALOGW("failed to deliver message. "
                  "Target handler %d registered, but object gone.",
                  msg->target());
 
diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp
index 05c87fd..7fd99a8 100644
--- a/media/libstagefright/mpeg2ts/ESQueue.cpp
+++ b/media/libstagefright/mpeg2ts/ESQueue.cpp
@@ -408,7 +408,7 @@
     if (timeUs >= 0) {
         accessUnit->meta()->setInt64("timeUs", timeUs);
     } else {
-        LOGW("no time for AAC access unit");
+        ALOGW("no time for AAC access unit");
     }
 
     return accessUnit;
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index 802c429..31b1a2f 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -742,7 +742,7 @@
     }
 
     if (!found) {
-        LOGW("Attempt to remove an active buffer we know nothing about...");
+        ALOGW("Attempt to remove an active buffer we know nothing about...");
     }
 }
 
diff --git a/media/libstagefright/rtsp/ARTPConnection.cpp b/media/libstagefright/rtsp/ARTPConnection.cpp
index 853ea14..8c9dd8d 100644
--- a/media/libstagefright/rtsp/ARTPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTPConnection.cpp
@@ -294,7 +294,7 @@
             if (err == -ECONNRESET) {
                 // socket failure, this stream is dead, Jim.
 
-                LOGW("failed to receive RTP/RTCP datagram.");
+                ALOGW("failed to receive RTP/RTCP datagram.");
                 it = mStreams.erase(it);
                 continue;
             }
@@ -347,7 +347,7 @@
                 } while (n < 0 && errno == EINTR);
 
                 if (n <= 0) {
-                    LOGW("failed to send RTCP receiver report (%s).",
+                    ALOGW("failed to send RTCP receiver report (%s).",
                          n == 0 ? "connection gone" : strerror(errno));
 
                     it = mStreams.erase(it);
@@ -561,7 +561,7 @@
 
             default:
             {
-                LOGW("Unknown RTCP packet type %u of size %d",
+                ALOGW("Unknown RTCP packet type %u of size %d",
                      (unsigned)data[1], headerLength);
                 break;
             }
diff --git a/media/libstagefright/rtsp/ARTPSource.cpp b/media/libstagefright/rtsp/ARTPSource.cpp
index dc5f17e..ed68790 100644
--- a/media/libstagefright/rtsp/ARTPSource.cpp
+++ b/media/libstagefright/rtsp/ARTPSource.cpp
@@ -147,7 +147,7 @@
     }
 
     if (it != mQueue.end() && (uint32_t)(*it)->int32Data() == seqNum) {
-        LOGW("Discarding duplicate buffer");
+        ALOGW("Discarding duplicate buffer");
         return false;
     }
 
@@ -174,7 +174,7 @@
     mLastFIRRequestUs = nowUs;
 
     if (buffer->size() + 20 > buffer->capacity()) {
-        LOGW("RTCP buffer too small to accomodate FIR.");
+        ALOGW("RTCP buffer too small to accomodate FIR.");
         return;
     }
 
@@ -212,7 +212,7 @@
 
 void ARTPSource::addReceiverReport(const sp<ABuffer> &buffer) {
     if (buffer->size() + 32 > buffer->capacity()) {
-        LOGW("RTCP buffer too small to accomodate RR.");
+        ALOGW("RTCP buffer too small to accomodate RR.");
         return;
     }
 
diff --git a/media/libstagefright/rtsp/ARTSPConnection.cpp b/media/libstagefright/rtsp/ARTSPConnection.cpp
index 12cca13..b5d2e9f 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTSPConnection.cpp
@@ -615,7 +615,7 @@
             notify->setObject("buffer", buffer);
             notify->post();
         } else {
-            LOGW("received binary data, but no one cares.");
+            ALOGW("received binary data, but no one cares.");
         }
 
         return true;
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index 53691d1..cda787e 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -264,7 +264,7 @@
         if (!GetAttribute(transport.c_str(),
                           "source",
                           &source)) {
-            LOGW("Missing 'source' field in Transport response. Using "
+            ALOGW("Missing 'source' field in Transport response. Using "
                  "RTSP endpoint address.");
 
             struct hostent *ent = gethostbyname(mSessionHost.c_str());
@@ -300,7 +300,7 @@
         }
 
         if (rtpPort & 1) {
-            LOGW("Server picked an odd RTP port, it should've picked an "
+            ALOGW("Server picked an odd RTP port, it should've picked an "
                  "even one, we'll let it pass for now, but this may break "
                  "in the future.");
         }
@@ -450,7 +450,7 @@
                                 // it with the absolute session URL to get
                                 // something usable...
 
-                                LOGW("Server specified a non-absolute base URL"
+                                ALOGW("Server specified a non-absolute base URL"
                                      ", combining it with the session URL to "
                                      "get something usable...");
 
@@ -468,7 +468,7 @@
                                 // The first "track" is merely session meta
                                 // data.
 
-                                LOGW("Session doesn't contain any playable "
+                                ALOGW("Session doesn't contain any playable "
                                      "tracks. Aborting.");
                                 result = ERROR_UNSUPPORTED;
                             } else {
@@ -527,12 +527,12 @@
                                 strtoul(timeoutStr.c_str(), &end, 10);
 
                             if (end == timeoutStr.c_str() || *end != '\0') {
-                                LOGW("server specified malformed timeout '%s'",
+                                ALOGW("server specified malformed timeout '%s'",
                                      timeoutStr.c_str());
 
                                 mKeepAliveTimeoutUs = kDefaultKeepAliveTimeoutUs;
                             } else if (timeoutSecs < 15) {
-                                LOGW("server specified too short a timeout "
+                                ALOGW("server specified too short a timeout "
                                      "(%lu secs), using default.",
                                      timeoutSecs);
 
@@ -884,7 +884,7 @@
             case 'seek':
             {
                 if (!mSeekable) {
-                    LOGW("This is a live stream, ignoring seek request.");
+                    ALOGW("This is a live stream, ignoring seek request.");
 
                     sp<AMessage> msg = mNotify->dup();
                     msg->setInt32("what", kWhatSeekDone);
@@ -1017,7 +1017,7 @@
             {
                 if (!mReceivedFirstRTCPPacket) {
                     if (mReceivedFirstRTPPacket && !mTryFakeRTCP) {
-                        LOGW("We received RTP packets but no RTCP packets, "
+                        ALOGW("We received RTP packets but no RTCP packets, "
                              "using fake timestamps.");
 
                         mTryFakeRTCP = true;
@@ -1026,7 +1026,7 @@
 
                         fakeTimestamps();
                     } else if (!mReceivedFirstRTPPacket && !mTryTCPInterleaving) {
-                        LOGW("Never received any data, switching transports.");
+                        ALOGW("Never received any data, switching transports.");
 
                         mTryTCPInterleaving = true;
 
@@ -1034,7 +1034,7 @@
                         msg->setInt32("reconnect", true);
                         msg->post();
                     } else {
-                        LOGW("Never received any data, disconnecting.");
+                        ALOGW("Never received any data, disconnecting.");
                         (new AMessage('abor', id()))->post();
                     }
                 }
@@ -1233,7 +1233,7 @@
             new APacketSource(mSessionDesc, index);
 
         if (source->initCheck() != OK) {
-            LOGW("Unsupported format. Ignoring track #%d.", index);
+            ALOGW("Unsupported format. Ignoring track #%d.", index);
 
             sp<AMessage> reply = new AMessage('setu', id());
             reply->setSize("index", index);
diff --git a/opengl/libagl/TextureObjectManager.cpp b/opengl/libagl/TextureObjectManager.cpp
index 022de09..6a006aa 100644
--- a/opengl/libagl/TextureObjectManager.cpp
+++ b/opengl/libagl/TextureObjectManager.cpp
@@ -195,7 +195,7 @@
                 return NO_MEMORY;
         }
 
-        LOGW_IF(level-1 >= mNumExtraLod,
+        ALOGW_IF(level-1 >= mNumExtraLod,
                 "specifying mipmap level %d, but # of level is %d",
                 level, mNumExtraLod+1);
 
diff --git a/opengl/libs/EGL/egl_cache.cpp b/opengl/libs/EGL/egl_cache.cpp
index c4a7466..ae314b4 100644
--- a/opengl/libs/EGL/egl_cache.cpp
+++ b/opengl/libs/EGL/egl_cache.cpp
@@ -133,7 +133,7 @@
     Mutex::Autolock lock(mMutex);
 
     if (keySize < 0 || valueSize < 0) {
-        LOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
+        ALOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
         return;
     }
 
@@ -172,7 +172,7 @@
     Mutex::Autolock lock(mMutex);
 
     if (keySize < 0 || valueSize < 0) {
-        LOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
+        ALOGW("EGL_ANDROID_blob_cache set: negative sizes are not allowed");
         return 0;
     }
 
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index ad5bdfc..53eaf9a 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -201,7 +201,7 @@
                     EGL_CLIENT_APIS);
 
         } else {
-            LOGW("%d: eglInitialize(%p) failed (%s)", i, idpy,
+            ALOGW("%d: eglInitialize(%p) failed (%s)", i, idpy,
                     egl_tls_t::egl_strerror(cnx->egl.eglGetError()));
         }
     }
@@ -309,7 +309,7 @@
         egl_connection_t* const cnx = &gEGLImpl[i];
         if (cnx->dso && disp[i].state == egl_display_t::INITIALIZED) {
             if (cnx->egl.eglTerminate(disp[i].dpy) == EGL_FALSE) {
-                LOGW("%d: eglTerminate(%p) failed (%s)", i, disp[i].dpy,
+                ALOGW("%d: eglTerminate(%p) failed (%s)", i, disp[i].dpy,
                         egl_tls_t::egl_strerror(cnx->egl.eglGetError()));
             }
             // REVISIT: it's unclear what to do if eglTerminate() fails
@@ -327,7 +327,7 @@
     // there are no reference to them, it which case, we're free to
     // delete them.
     size_t count = objects.size();
-    LOGW_IF(count, "eglTerminate() called w/ %d objects remaining", count);
+    ALOGW_IF(count, "eglTerminate() called w/ %d objects remaining", count);
     for (size_t i=0 ; i<count ; i++) {
         egl_object_t* o = objects.itemAt(i);
         o->destroy();
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
index df1b261..64737c8 100644
--- a/opengl/libs/EGL/egl_object.h
+++ b/opengl/libs/EGL/egl_object.h
@@ -131,7 +131,7 @@
         if (window != NULL) {
             native_window_set_buffers_format(window, 0);
             if (native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL)) {
-                LOGW("EGLNativeWindowType %p disconnect failed", window);
+                ALOGW("EGLNativeWindowType %p disconnect failed", window);
             }
         }
     }
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ab94bb8..7bef5a9 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -122,7 +122,7 @@
         defaultServiceManager()->getService(String16("media.player"));
     sp<IMediaPlayerService> service = interface_cast<IMediaPlayerService>(binder);
     if (service.get() == NULL) {
-        LOGW("Cannot connect to the MediaPlayerService for battery tracking");
+        ALOGW("Cannot connect to the MediaPlayerService for battery tracking");
         return;
     }
 
@@ -484,7 +484,7 @@
     Mutex::Autolock _l(mLock);
     PlaybackThread *thread = checkPlaybackThread_l(output);
     if (thread == NULL) {
-        LOGW("sampleRate() unknown thread %d", output);
+        ALOGW("sampleRate() unknown thread %d", output);
         return 0;
     }
     return thread->sampleRate();
@@ -495,7 +495,7 @@
     Mutex::Autolock _l(mLock);
     PlaybackThread *thread = checkPlaybackThread_l(output);
     if (thread == NULL) {
-        LOGW("channelCount() unknown thread %d", output);
+        ALOGW("channelCount() unknown thread %d", output);
         return 0;
     }
     return thread->channelCount();
@@ -506,7 +506,7 @@
     Mutex::Autolock _l(mLock);
     PlaybackThread *thread = checkPlaybackThread_l(output);
     if (thread == NULL) {
-        LOGW("format() unknown thread %d", output);
+        ALOGW("format() unknown thread %d", output);
         return 0;
     }
     return thread->format();
@@ -517,7 +517,7 @@
     Mutex::Autolock _l(mLock);
     PlaybackThread *thread = checkPlaybackThread_l(output);
     if (thread == NULL) {
-        LOGW("frameCount() unknown thread %d", output);
+        ALOGW("frameCount() unknown thread %d", output);
         return 0;
     }
     return thread->frameCount();
@@ -528,7 +528,7 @@
     Mutex::Autolock _l(mLock);
     PlaybackThread *thread = checkPlaybackThread_l(output);
     if (thread == NULL) {
-        LOGW("latency() unknown thread %d", output);
+        ALOGW("latency() unknown thread %d", output);
         return 0;
     }
     return thread->latency();
@@ -576,7 +576,7 @@
         return PERMISSION_DENIED;
     }
     if ((mode < 0) || (mode >= AUDIO_MODE_CNT)) {
-        LOGW("Illegal value: setMode(%d)", mode);
+        ALOGW("Illegal value: setMode(%d)", mode);
         return BAD_VALUE;
     }
 
@@ -1180,7 +1180,7 @@
         sp<IBinder> binder =
             defaultServiceManager()->checkService(String16("power"));
         if (binder == 0) {
-            LOGW("Thread %s cannot connect to the power manager service", mName);
+            ALOGW("Thread %s cannot connect to the power manager service", mName);
         } else {
             mPowerManager = interface_cast<IPowerManager>(binder);
             binder->linkToDeath(mDeathRecipient);
@@ -1228,7 +1228,7 @@
     if (thread != 0) {
         thread->clearPowerManager();
     }
-    LOGW("power manager service died !!!");
+    ALOGW("power manager service died !!!");
 }
 
 void AudioFlinger::ThreadBase::setEffectSuspended(
@@ -1561,7 +1561,7 @@
         // invalidate track immediately if the stream type was moved to another thread since
         // createTrack() was called by the client process.
         if (!mStreamTypes[streamType].valid) {
-            LOGW("createTrack_l() on thread %p: invalidating track on stream %d",
+            ALOGW("createTrack_l() on thread %p: invalidating track on stream %d",
                  this, streamType);
             android_atomic_or(CBLK_INVALID_ON, &track->mCblk->flags);
         }
@@ -2038,7 +2038,7 @@
             if (!mStandby && delta > maxPeriod) {
                 mNumDelayedWrites++;
                 if ((now - lastWarning) > kWarningThrottleNs) {
-                    LOGW("write blocked for %llu msecs, %d delayed writes, thread %p",
+                    ALOGW("write blocked for %llu msecs, %d delayed writes, thread %p",
                             ns2ms(delta), mNumDelayedWrites, this);
                     lastWarning = now;
                 }
@@ -2147,7 +2147,7 @@
                 if (chain != 0) {
                     tracksWithEffect++;
                 } else {
-                    LOGW("prepareTracks_l(): track %d attached to effect but no chain found on session %d",
+                    ALOGW("prepareTracks_l(): track %d attached to effect but no chain found on session %d",
                             name, track->sessionId());
                 }
             }
@@ -3164,7 +3164,7 @@
     for (size_t i = 0; i < outputTracks.size(); i++) {
         sp <ThreadBase> thread = outputTracks[i]->thread().promote();
         if (thread == 0) {
-            LOGW("DuplicatingThread::outputsReady() could not promote thread on output track %p", outputTracks[i].get());
+            ALOGW("DuplicatingThread::outputsReady() could not promote thread on output track %p", outputTracks[i].get());
             return false;
         }
         PlaybackThread *playbackThread = (PlaybackThread *)thread.get();
@@ -3795,7 +3795,7 @@
                 mCblk, mBuffer, mCblk->buffers,
                 mCblk->frameCount, mCblk->sampleRate, mChannelMask, mBufferEnd);
     } else {
-        LOGW("Error creating output track on thread %p", playbackThread);
+        ALOGW("Error creating output track on thread %p", playbackThread);
     }
 }
 
@@ -3850,7 +3850,7 @@
                     memset(pInBuffer->raw, 0, startFrames * channelCount * sizeof(int16_t));
                     mBufferQueue.add(pInBuffer);
                 } else {
-                    LOGW ("OutputTrack::write() %p no more buffers in queue", this);
+                    ALOGW ("OutputTrack::write() %p no more buffers in queue", this);
                 }
             }
         }
@@ -3917,7 +3917,7 @@
                 mBufferQueue.add(pInBuffer);
                 ALOGV("OutputTrack::write() %p thread %p adding overflow buffer %d", this, mThread.unsafe_get(), mBufferQueue.size());
             } else {
-                LOGW("OutputTrack::write() %p thread %p no more overflow buffers", mThread.unsafe_get(), this);
+                ALOGW("OutputTrack::write() %p thread %p no more overflow buffers", mThread.unsafe_get(), this);
             }
         }
     }
@@ -4260,7 +4260,7 @@
 status_t AudioFlinger::RecordThread::readyToRun()
 {
     status_t status = initCheck();
-    LOGW_IF(status != NO_ERROR,"RecordThread %p could not initialize", this);
+    ALOGW_IF(status != NO_ERROR,"RecordThread %p could not initialize", this);
     return status;
 }
 
@@ -4426,7 +4426,7 @@
                 if (!mActiveTrack->setOverflow()) {
                     nsecs_t now = systemTime();
                     if ((now - lastWarning) > kWarningThrottleNs) {
-                        LOGW("RecordThread: buffer overflow");
+                        ALOGW("RecordThread: buffer overflow");
                         lastWarning = now;
                     }
                 }
@@ -4967,7 +4967,7 @@
     MixerThread *thread2 = checkMixerThread_l(output2);
 
     if (thread1 == NULL || thread2 == NULL) {
-        LOGW("openDuplicateOutput() wrong output mixer type for output %d or %d", output1, output2);
+        ALOGW("openDuplicateOutput() wrong output mixer type for output %d or %d", output1, output2);
         return 0;
     }
 
@@ -5163,7 +5163,7 @@
     Mutex::Autolock _l(mLock);
     MixerThread *dstThread = checkMixerThread_l(output);
     if (dstThread == NULL) {
-        LOGW("setStreamOutput() bad output id %d", output);
+        ALOGW("setStreamOutput() bad output id %d", output);
         return BAD_VALUE;
     }
 
@@ -5232,7 +5232,7 @@
             return;
         }
     }
-    LOGW("session id %d not found for pid %d", audioSession, caller);
+    ALOGW("session id %d not found for pid %d", audioSession, caller);
 }
 
 void AudioFlinger::purgeStaleEffects_l() {
@@ -5443,14 +5443,14 @@
             // if uuid is specified, request effect descriptor
             lStatus = EffectGetDescriptor(&pDesc->uuid, &desc);
             if (lStatus < 0) {
-                LOGW("createEffect() error %d from EffectGetDescriptor", lStatus);
+                ALOGW("createEffect() error %d from EffectGetDescriptor", lStatus);
                 goto Exit;
             }
         } else {
             // if uuid is not specified, look for an available implementation
             // of the required type in effect factory
             if (EffectIsNullUuid(&pDesc->type)) {
-                LOGW("createEffect() no effect type");
+                ALOGW("createEffect() no effect type");
                 lStatus = BAD_VALUE;
                 goto Exit;
             }
@@ -5461,13 +5461,13 @@
 
             lStatus = EffectQueryNumberEffects(&numEffects);
             if (lStatus < 0) {
-                LOGW("createEffect() error %d from EffectQueryNumberEffects", lStatus);
+                ALOGW("createEffect() error %d from EffectQueryNumberEffects", lStatus);
                 goto Exit;
             }
             for (uint32_t i = 0; i < numEffects; i++) {
                 lStatus = EffectQueryEffect(i, &desc);
                 if (lStatus < 0) {
-                    LOGW("createEffect() error %d from EffectQueryEffect", lStatus);
+                    ALOGW("createEffect() error %d from EffectQueryEffect", lStatus);
                     continue;
                 }
                 if (memcmp(&desc.type, &pDesc->type, sizeof(effect_uuid_t)) == 0) {
@@ -5484,7 +5484,7 @@
             }
             if (!found) {
                 lStatus = BAD_VALUE;
-                LOGW("createEffect() effect not found");
+                ALOGW("createEffect() effect not found");
                 goto Exit;
             }
             // For same effect type, chose auxiliary version over insert version if
@@ -5581,17 +5581,17 @@
             sessionId, srcOutput, dstOutput);
     Mutex::Autolock _l(mLock);
     if (srcOutput == dstOutput) {
-        LOGW("moveEffects() same dst and src outputs %d", dstOutput);
+        ALOGW("moveEffects() same dst and src outputs %d", dstOutput);
         return NO_ERROR;
     }
     PlaybackThread *srcThread = checkPlaybackThread_l(srcOutput);
     if (srcThread == NULL) {
-        LOGW("moveEffects() bad srcOutput %d", srcOutput);
+        ALOGW("moveEffects() bad srcOutput %d", srcOutput);
         return BAD_VALUE;
     }
     PlaybackThread *dstThread = checkPlaybackThread_l(dstOutput);
     if (dstThread == NULL) {
-        LOGW("moveEffects() bad dstOutput %d", dstOutput);
+        ALOGW("moveEffects() bad dstOutput %d", dstOutput);
         return BAD_VALUE;
     }
 
@@ -5613,7 +5613,7 @@
 
     sp<EffectChain> chain = srcThread->getEffectChain_l(sessionId);
     if (chain == 0) {
-        LOGW("moveEffectChain_l() effect chain for session %d not on source thread %p",
+        ALOGW("moveEffectChain_l() effect chain for session %d not on source thread %p",
                 sessionId, srcThread);
         return INVALID_OPERATION;
     }
@@ -5643,7 +5643,7 @@
         if (dstChain == 0) {
             dstChain = effect->chain().promote();
             if (dstChain == 0) {
-                LOGW("moveEffectChain_l() cannot get chain from effect %p", effect.get());
+                ALOGW("moveEffectChain_l() cannot get chain from effect %p", effect.get());
                 srcThread->addEffect_l(effect);
                 return NO_INIT;
             }
@@ -5685,14 +5685,14 @@
 
     lStatus = initCheck();
     if (lStatus != NO_ERROR) {
-        LOGW("createEffect_l() Audio driver not initialized.");
+        ALOGW("createEffect_l() Audio driver not initialized.");
         goto Exit;
     }
 
     // Do not allow effects with session ID 0 on direct output or duplicating threads
     // TODO: add rule for hw accelerated effects on direct outputs with non PCM format
     if (sessionId == AUDIO_SESSION_OUTPUT_MIX && mType != MIXER) {
-        LOGW("createEffect_l() Cannot add auxiliary effect %s to session %d",
+        ALOGW("createEffect_l() Cannot add auxiliary effect %s to session %d",
                 desc->name, sessionId);
         lStatus = BAD_VALUE;
         goto Exit;
@@ -5702,7 +5702,7 @@
             (desc->flags & EFFECT_FLAG_TYPE_MASK) != EFFECT_FLAG_TYPE_PRE_PROC) ||
             (mType != RECORD &&
                     (desc->flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_PRE_PROC)) {
-        LOGW("createEffect_l() effect %s (flags %08x) created on wrong thread type %d",
+        ALOGW("createEffect_l() effect %s (flags %08x) created on wrong thread type %d",
                 desc->name, desc->flags, mType);
         lStatus = BAD_VALUE;
         goto Exit;
@@ -5811,7 +5811,7 @@
     ALOGV("addEffect_l() %p chain %p effect %p", this, chain.get(), effect.get());
 
     if (chain->getEffectFromId_l(effect->id()) != 0) {
-        LOGW("addEffect_l() %p effect %s already present in chain %p",
+        ALOGW("addEffect_l() %p effect %s already present in chain %p",
                 this, effect->desc().name, chain.get());
         return BAD_VALUE;
     }
@@ -5844,7 +5844,7 @@
             removeEffectChain_l(chain);
         }
     } else {
-        LOGW("removeEffect_l() %p cannot promote chain for effect %p", this, effect.get());
+        ALOGW("removeEffect_l() %p cannot promote chain for effect %p", this, effect.get());
     }
 }
 
@@ -6066,7 +6066,7 @@
 size_t AudioFlinger::RecordThread::removeEffectChain_l(const sp<EffectChain>& chain)
 {
     ALOGV("removeEffectChain_l() %p from thread %p", chain.get(), this);
-    LOGW_IF(mEffectChains.size() != 1,
+    ALOGW_IF(mEffectChains.size() != 1,
             "removeEffectChain_l() %p invalid chain size %d on thread %p",
             chain.get(), mEffectChains.size(), this);
     if (mEffectChains.size() == 1) {
@@ -6963,12 +6963,12 @@
             int *p = (int *)(mBuffer + mCblk->serverIndex);
             int size = *p++;
             if (((uint8_t *)p + size) > mBuffer + mCblk->clientIndex) {
-                LOGW("command(): invalid parameter block size");
+                ALOGW("command(): invalid parameter block size");
                 break;
             }
             effect_param_t *param = (effect_param_t *)p;
             if (param->psize == 0 || param->vsize == 0) {
-                LOGW("command(): null parameter or value size");
+                ALOGW("command(): null parameter or value size");
                 mCblk->serverIndex += size;
                 continue;
             }
@@ -7144,7 +7144,7 @@
 {
     sp<ThreadBase> thread = mThread.promote();
     if (thread == 0) {
-        LOGW("process_l(): cannot promote mixer thread");
+        ALOGW("process_l(): cannot promote mixer thread");
         return;
     }
     bool isGlobalSession = (mSessionId == AUDIO_SESSION_OUTPUT_MIX) ||
@@ -7240,7 +7240,7 @@
                 // check invalid effect chaining combinations
                 if (insertPref == EFFECT_FLAG_INSERT_EXCLUSIVE ||
                     iPref == EFFECT_FLAG_INSERT_EXCLUSIVE) {
-                    LOGW("addEffect_l() could not insert effect %s: exclusive conflict with %s", desc.name, d.name);
+                    ALOGW("addEffect_l() could not insert effect %s: exclusive conflict with %s", desc.name, d.name);
                     return INVALID_OPERATION;
                 }
                 // remember position of first insert effect and by default
@@ -7476,7 +7476,7 @@
         }
         desc = mSuspendedEffects.valueAt(index);
         if (desc->mRefCount <= 0) {
-            LOGW("setEffectSuspended_l() restore refcount should not be 0 %d", desc->mRefCount);
+            ALOGW("setEffectSuspended_l() restore refcount should not be 0 %d", desc->mRefCount);
             desc->mRefCount = 1;
         }
         if (--desc->mRefCount == 0) {
@@ -7523,7 +7523,7 @@
         }
         desc = mSuspendedEffects.valueAt(index);
         if (desc->mRefCount <= 0) {
-            LOGW("setEffectSuspendedAll_l() restore refcount should not be 0 %d", desc->mRefCount);
+            ALOGW("setEffectSuspendedAll_l() restore refcount should not be 0 %d", desc->mRefCount);
             desc->mRefCount = 1;
         }
         if (--desc->mRefCount == 0) {
@@ -7603,7 +7603,7 @@
             setEffectSuspended_l(&effect->desc().type, enabled);
             index = mSuspendedEffects.indexOfKey(effect->desc().type.timeLow);
             if (index < 0) {
-                LOGW("checkSuspendOnEffectEnabled() Fx should be suspended here!");
+                ALOGW("checkSuspendOnEffectEnabled() Fx should be suspended here!");
                 return;
             }
         }
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index c9c61a5..b8e456f 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -365,7 +365,7 @@
 
 void AudioMixer::process__validate(state_t* state)
 {
-    LOGW_IF(!state->needsChanged,
+    ALOGW_IF(!state->needsChanged,
         "in process__validate() but nothing's invalid");
 
     uint32_t changed = state->needsChanged;
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index d99f66a..144f04e 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -338,7 +338,7 @@
         sp<AudioEffect> fx = new AudioEffect(NULL, &effect->mUuid, -1, 0, 0, audioSession, input);
         status_t status = fx->initCheck();
         if (status != NO_ERROR && status != ALREADY_EXISTS) {
-            LOGW("Failed to create Fx %s on input %d", effect->mName, input);
+            ALOGW("Failed to create Fx %s on input %d", effect->mName, input);
             // fx goes out of scope and strong ref on AudioEffect is released
             continue;
         }
@@ -533,7 +533,7 @@
 }
 
 void AudioPolicyService::binderDied(const wp<IBinder>& who) {
-    LOGW("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(),
+    ALOGW("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(),
             IPCThreadState::self()->getCallingPid());
 }
 
@@ -726,7 +726,7 @@
                     delete data;
                     }break;
                 default:
-                    LOGW("AudioCommandThread() unknown command %d", command->mCommand);
+                    ALOGW("AudioCommandThread() unknown command %d", command->mCommand);
                 }
                 delete command;
                 waitTime = INT64_MAX;
@@ -1134,7 +1134,7 @@
         ALOGV("readParamValue() reading string %s", param + *curSize - len);
         return len;
     }
-    LOGW("readParamValue() unknown param type %s", node->name);
+    ALOGW("readParamValue() unknown param type %s", node->name);
     return 0;
 }
 
@@ -1155,7 +1155,7 @@
             // Note: that a pair of random strings is read as 0 0
             int *ptr = (int *)fx_param->data;
             int *ptr2 = (int *)((char *)param + sizeof(effect_param_t));
-            LOGW("loadEffectParameter() ptr %p ptr2 %p", ptr, ptr2);
+            ALOGW("loadEffectParameter() ptr %p ptr2 %p", ptr, ptr2);
             *ptr++ = atoi(param->name);
             *ptr = atoi(param->value);
             fx_param->psize = sizeof(int);
@@ -1164,7 +1164,7 @@
         }
     }
     if (param == NULL || value == NULL) {
-        LOGW("loadEffectParameter() invalid parameter description %s", root->name);
+        ALOGW("loadEffectParameter() invalid parameter description %s", root->name);
         goto error;
     }
 
@@ -1223,7 +1223,7 @@
 {
     cnode *node = root->first_child;
     if (node == NULL) {
-        LOGW("loadInputSource() empty element %s", root->name);
+        ALOGW("loadInputSource() empty element %s", root->name);
         return NULL;
     }
     InputSourceDesc *source = new InputSourceDesc();
@@ -1247,7 +1247,7 @@
         node = node->next;
     }
     if (source->mEffects.size() == 0) {
-        LOGW("loadInputSource() no valid effects found in source %s", root->name);
+        ALOGW("loadInputSource() no valid effects found in source %s", root->name);
         delete source;
         return NULL;
     }
@@ -1264,7 +1264,7 @@
     while (node) {
         audio_source_t source = inputSourceNameToEnum(node->name);
         if (source == AUDIO_SOURCE_CNT) {
-            LOGW("loadInputSources() invalid input source %s", node->name);
+            ALOGW("loadInputSources() invalid input source %s", node->name);
             node = node->next;
             continue;
         }
@@ -1288,7 +1288,7 @@
     }
     effect_uuid_t uuid;
     if (AudioEffect::stringToGuid(node->value, &uuid) != NO_ERROR) {
-        LOGW("loadEffect() invalid uuid %s", node->value);
+        ALOGW("loadEffect() invalid uuid %s", node->value);
         return NULL;
     }
     EffectDesc *effect = new EffectDesc();
@@ -1354,7 +1354,7 @@
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
     if (af == NULL) {
-        LOGW("%s: could not get AudioFlinger", __func__);
+        ALOGW("%s: could not get AudioFlinger", __func__);
         return 0;
     }
 
@@ -1368,7 +1368,7 @@
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
     if (af == NULL) {
-        LOGW("%s: could not get AudioFlinger", __func__);
+        ALOGW("%s: could not get AudioFlinger", __func__);
         return 0;
     }
     return af->openDuplicateOutput(output1, output2);
@@ -1387,7 +1387,7 @@
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
     if (af == NULL) {
-        LOGW("%s: could not get AudioFlinger", __func__);
+        ALOGW("%s: could not get AudioFlinger", __func__);
         return PERMISSION_DENIED;
     }
 
@@ -1398,7 +1398,7 @@
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
     if (af == NULL) {
-        LOGW("%s: could not get AudioFlinger", __func__);
+        ALOGW("%s: could not get AudioFlinger", __func__);
         return PERMISSION_DENIED;
     }
 
@@ -1414,7 +1414,7 @@
 {
     sp<IAudioFlinger> af = AudioSystem::get_audio_flinger();
     if (af == NULL) {
-        LOGW("%s: could not get AudioFlinger", __func__);
+        ALOGW("%s: could not get AudioFlinger", __func__);
         return 0;
     }
 
diff --git a/services/audioflinger/AudioResamplerCubic.cpp b/services/audioflinger/AudioResamplerCubic.cpp
index 4d721f6..587c7be 100644
--- a/services/audioflinger/AudioResamplerCubic.cpp
+++ b/services/audioflinger/AudioResamplerCubic.cpp
@@ -68,7 +68,7 @@
         provider->getNextBuffer(&mBuffer);
         if (mBuffer.raw == NULL)
             return;
-        // LOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
+        // ALOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
     }
     int16_t *in = mBuffer.i16;
 
@@ -99,7 +99,7 @@
                 if (mBuffer.raw == NULL)
                     goto save_state;  // ugly, but efficient
                 in = mBuffer.i16;
-                // LOGW("New buffer: offset=%p, frames=%d\n", mBuffer.raw, mBuffer.frameCount);
+                // ALOGW("New buffer: offset=%p, frames=%d\n", mBuffer.raw, mBuffer.frameCount);
             }
 
             // advance sample state
@@ -109,7 +109,7 @@
     }
 
 save_state:
-    // LOGW("Done: index=%d, fraction=%u", inputIndex, phaseFraction);
+    // ALOGW("Done: index=%d, fraction=%u", inputIndex, phaseFraction);
     mInputIndex = inputIndex;
     mPhaseFraction = phaseFraction;
 }
@@ -133,7 +133,7 @@
         provider->getNextBuffer(&mBuffer);
         if (mBuffer.raw == NULL)
             return;
-        // LOGW("New buffer: offset=%p, frames=%d\n", mBuffer.raw, mBuffer.frameCount);
+        // ALOGW("New buffer: offset=%p, frames=%d\n", mBuffer.raw, mBuffer.frameCount);
     }
     int16_t *in = mBuffer.i16;
 
@@ -163,7 +163,7 @@
                 provider->getNextBuffer(&mBuffer);
                 if (mBuffer.raw == NULL)
                     goto save_state;  // ugly, but efficient
-                // LOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
+                // ALOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
                 in = mBuffer.i16;
             }
 
@@ -173,7 +173,7 @@
     }
 
 save_state:
-    // LOGW("Done: index=%d, fraction=%u", inputIndex, phaseFraction);
+    // ALOGW("Done: index=%d, fraction=%u", inputIndex, phaseFraction);
     mInputIndex = inputIndex;
     mPhaseFraction = phaseFraction;
 }
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 7b4b4ac..f841ec7 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -176,7 +176,7 @@
                     callingPid);
                 return client;
             } else {
-                LOGW("CameraService::connect X (pid %d) rejected (existing client).",
+                ALOGW("CameraService::connect X (pid %d) rejected (existing client).",
                     callingPid);
                 return NULL;
             }
@@ -185,7 +185,7 @@
     }
 
     if (mBusy[cameraId]) {
-        LOGW("CameraService::connect X (pid %d) rejected"
+        ALOGW("CameraService::connect X (pid %d) rejected"
              " (camera %d is still busy).", callingPid, cameraId);
         return NULL;
     }
@@ -390,7 +390,7 @@
     int callingPid = getCallingPid();
     if (callingPid == mClientPid) return NO_ERROR;
 
-    LOGW("attempt to use a locked camera from a different process"
+    ALOGW("attempt to use a locked camera from a different process"
          " (old pid %d, new pid %d)", mClientPid, callingPid);
     return EBUSY;
 }
@@ -448,7 +448,7 @@
     Mutex::Autolock lock(mLock);
 
     if (mClientPid != 0 && checkPid() != NO_ERROR) {
-        LOGW("Tried to connect to a locked camera (old pid %d, new pid %d)",
+        ALOGW("Tried to connect to a locked camera (old pid %d, new pid %d)",
                 mClientPid, callingPid);
         return EBUSY;
     }
@@ -471,7 +471,7 @@
         status_t result = native_window_api_disconnect(window.get(),
                 NATIVE_WINDOW_API_CAMERA);
         if (result != NO_ERROR) {
-            LOGW("native_window_api_disconnect failed: %s (%d)", strerror(-result),
+            ALOGW("native_window_api_disconnect failed: %s (%d)", strerror(-result),
                     result);
         }
     }
@@ -483,7 +483,7 @@
     Mutex::Autolock lock(mLock);
 
     if (checkPid() != NO_ERROR) {
-        LOGW("different client - don't disconnect");
+        ALOGW("different client - don't disconnect");
         return;
     }
 
@@ -917,7 +917,7 @@
         }
         usleep(CHECK_MESSAGE_INTERVAL * 1000);
     }
-    LOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType);
+    ALOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType);
     return false;
 }
 
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 85ff964..4c28a16 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -246,7 +246,7 @@
         if (device && test_bit(axis, device->absBitmask)) {
             struct input_absinfo info;
             if(ioctl(device->fd, EVIOCGABS(axis), &info)) {
-                LOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
+                ALOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
                      axis, device->identifier.name.string(), device->fd, errno);
                 return -errno;
             }
@@ -355,7 +355,7 @@
         if (device && test_bit(axis, device->absBitmask)) {
             struct input_absinfo info;
             if(ioctl(device->fd, EVIOCGABS(axis), &info)) {
-                LOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
+                ALOGW("Error reading absolute controller %d for device %s fd %d, errno=%d",
                      axis, device->identifier.name.string(), device->fd, errno);
                 return -errno;
             }
@@ -614,7 +614,7 @@
                 if (eventItem.events & EPOLLIN) {
                     mPendingINotify = true;
                 } else {
-                    LOGW("Received unexpected epoll event 0x%08x for INotify.", eventItem.events);
+                    ALOGW("Received unexpected epoll event 0x%08x for INotify.", eventItem.events);
                 }
                 continue;
             }
@@ -629,7 +629,7 @@
                         nRead = read(mWakeReadPipeFd, buffer, sizeof(buffer));
                     } while ((nRead == -1 && errno == EINTR) || nRead == sizeof(buffer));
                 } else {
-                    LOGW("Received unexpected epoll event 0x%08x for wake read pipe.",
+                    ALOGW("Received unexpected epoll event 0x%08x for wake read pipe.",
                             eventItem.events);
                 }
                 continue;
@@ -637,7 +637,7 @@
 
             ssize_t deviceIndex = mDevices.indexOfKey(eventItem.data.u32);
             if (deviceIndex < 0) {
-                LOGW("Received unexpected epoll event 0x%08x for unknown device id %d.",
+                ALOGW("Received unexpected epoll event 0x%08x for unknown device id %d.",
                         eventItem.events, eventItem.data.u32);
                 continue;
             }
@@ -648,13 +648,13 @@
                         sizeof(struct input_event) * capacity);
                 if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
                     // Device was removed before INotify noticed.
-                    LOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d capacity: %d errno: %d)\n",
+                    ALOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d capacity: %d errno: %d)\n",
                          device->fd, readSize, bufferSize, capacity, errno);
                     deviceChanged = true;
                     closeDeviceLocked(device);
                 } else if (readSize < 0) {
                     if (errno != EAGAIN && errno != EINTR) {
-                        LOGW("could not get event (errno=%d)", errno);
+                        ALOGW("could not get event (errno=%d)", errno);
                     }
                 } else if ((readSize % sizeof(struct input_event)) != 0) {
                     LOGE("could not get event (wrong size: %d)", readSize);
@@ -710,7 +710,7 @@
                     }
                 }
             } else {
-                LOGW("Received unexpected epoll event 0x%08x for device %s.",
+                ALOGW("Received unexpected epoll event 0x%08x for device %s.",
                         eventItem.events, device->identifier.name.string());
             }
         }
@@ -768,7 +768,7 @@
             // Sleep after errors to avoid locking up the system.
             // Hopefully the error is transient.
             if (errno != EINTR) {
-                LOGW("poll failed (errno=%d)\n", errno);
+                ALOGW("poll failed (errno=%d)\n", errno);
                 usleep(100000);
             }
         } else {
@@ -803,7 +803,7 @@
     } while (nWrite == -1 && errno == EINTR);
 
     if (nWrite != 1 && errno != EAGAIN) {
-        LOGW("Could not write wake signal, errno=%d", errno);
+        ALOGW("Could not write wake signal, errno=%d", errno);
     }
 }
 
@@ -1175,13 +1175,13 @@
          device->fd, device->classes);
 
     if (device->id == mBuiltInKeyboardId) {
-        LOGW("built-in keyboard device %s (id=%d) is closing! the apps will not like this",
+        ALOGW("built-in keyboard device %s (id=%d) is closing! the apps will not like this",
                 device->path.string(), mBuiltInKeyboardId);
         mBuiltInKeyboardId = -1;
     }
 
     if (epoll_ctl(mEpollFd, EPOLL_CTL_DEL, device->fd, NULL)) {
-        LOGW("Could not remove device fd from epoll instance.  errno=%d", errno);
+        ALOGW("Could not remove device fd from epoll instance.  errno=%d", errno);
     }
 
     mDevices.removeItem(device->id);
@@ -1231,7 +1231,7 @@
     if(res < (int)sizeof(*event)) {
         if(errno == EINTR)
             return 0;
-        LOGW("could not get event, %s\n", strerror(errno));
+        ALOGW("could not get event, %s\n", strerror(errno));
         return -1;
     }
     //printf("got %d bytes of event information\n", res);
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index b896a82..1b6d54a 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -1770,13 +1770,13 @@
                     || windowHandle->getInfo()->ownerUid != injectionState->injectorUid)
             && !hasInjectionPermission(injectionState->injectorPid, injectionState->injectorUid)) {
         if (windowHandle != NULL) {
-            LOGW("Permission denied: injecting event from pid %d uid %d to window %s "
+            ALOGW("Permission denied: injecting event from pid %d uid %d to window %s "
                     "owned by uid %d",
                     injectionState->injectorPid, injectionState->injectorUid,
                     windowHandle->getName().string(),
                     windowHandle->getInfo()->ownerUid);
         } else {
-            LOGW("Permission denied: injecting event from pid %d uid %d",
+            ALOGW("Permission denied: injecting event from pid %d uid %d",
                     injectionState->injectorPid, injectionState->injectorUid);
         }
         return false;
@@ -2409,7 +2409,7 @@
         sp<Connection> connection = d->mConnectionsByReceiveFd.valueAt(connectionIndex);
         if (!(events & (ALOOPER_EVENT_ERROR | ALOOPER_EVENT_HANGUP))) {
             if (!(events & ALOOPER_EVENT_INPUT)) {
-                LOGW("channel '%s' ~ Received spurious callback for unhandled poll event.  "
+                ALOGW("channel '%s' ~ Received spurious callback for unhandled poll event.  "
                         "events=0x%x", connection->getInputChannelName(), events);
                 return 1;
             }
@@ -2432,7 +2432,7 @@
             // about them.
             notify = !connection->monitor;
             if (notify) {
-                LOGW("channel '%s' ~ Consumer closed input channel or an error occurred.  "
+                ALOGW("channel '%s' ~ Consumer closed input channel or an error occurred.  "
                         "events=0x%x", connection->getInputChannelName(), events);
             }
         }
@@ -2547,7 +2547,7 @@
         // different pointer ids than we expected based on the previous ACTION_DOWN
         // or ACTION_POINTER_DOWN events that caused us to decide to split the pointers
         // in this way.
-        LOGW("Dropping split motion event because the pointer count is %d but "
+        ALOGW("Dropping split motion event because the pointer count is %d but "
                 "we expected there to be %d pointers.  This probably means we received "
                 "a broken sequence of pointer ids from the input device.",
                 splitPointerCount, pointerIds.count());
@@ -3086,7 +3086,7 @@
     }
 
     default:
-        LOGW("Cannot inject event of type %d", event->getType());
+        ALOGW("Cannot inject event of type %d", event->getType());
         return INPUT_EVENT_INJECTION_FAILED;
     }
 
@@ -3187,13 +3187,13 @@
                 ALOGV("Asynchronous input event injection succeeded.");
                 break;
             case INPUT_EVENT_INJECTION_FAILED:
-                LOGW("Asynchronous input event injection failed.");
+                ALOGW("Asynchronous input event injection failed.");
                 break;
             case INPUT_EVENT_INJECTION_PERMISSION_DENIED:
-                LOGW("Asynchronous input event injection permission denied.");
+                ALOGW("Asynchronous input event injection permission denied.");
                 break;
             case INPUT_EVENT_INJECTION_TIMED_OUT:
-                LOGW("Asynchronous input event injection timed out.");
+                ALOGW("Asynchronous input event injection timed out.");
                 break;
             }
         }
@@ -3635,7 +3635,7 @@
         AutoMutex _l(mLock);
 
         if (getConnectionIndexLocked(inputChannel) >= 0) {
-            LOGW("Attempted to register already registered input channel '%s'",
+            ALOGW("Attempted to register already registered input channel '%s'",
                     inputChannel->getName().string());
             return BAD_VALUE;
         }
@@ -3686,7 +3686,7 @@
         bool notify) {
     ssize_t connectionIndex = getConnectionIndexLocked(inputChannel);
     if (connectionIndex < 0) {
-        LOGW("Attempted to unregister already unregistered input channel '%s'",
+        ALOGW("Attempted to unregister already unregistered input channel '%s'",
                 inputChannel->getName().string());
         return BAD_VALUE;
     }
diff --git a/services/input/InputManager.cpp b/services/input/InputManager.cpp
index 5dfa5d5..29c5884 100644
--- a/services/input/InputManager.cpp
+++ b/services/input/InputManager.cpp
@@ -71,12 +71,12 @@
 status_t InputManager::stop() {
     status_t result = mReaderThread->requestExitAndWait();
     if (result) {
-        LOGW("Could not stop InputReader thread due to error %d.", result);
+        ALOGW("Could not stop InputReader thread due to error %d.", result);
     }
 
     result = mDispatcherThread->requestExitAndWait();
     if (result) {
-        LOGW("Could not stop InputDispatcher thread due to error %d.", result);
+        ALOGW("Could not stop InputDispatcher thread due to error %d.", result);
     }
 
     return OK;
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp
index 6f19950..bc17272 100644
--- a/services/input/InputReader.cpp
+++ b/services/input/InputReader.cpp
@@ -359,7 +359,7 @@
     if (deviceIndex < 0) {
         mDevices.add(deviceId, device);
     } else {
-        LOGW("Ignoring spurious device added event for deviceId %d.", deviceId);
+        ALOGW("Ignoring spurious device added event for deviceId %d.", deviceId);
         delete device;
         return;
     }
@@ -372,7 +372,7 @@
         device = mDevices.valueAt(deviceIndex);
         mDevices.removeItemsAt(deviceIndex, 1);
     } else {
-        LOGW("Ignoring spurious device removed event for deviceId %d.", deviceId);
+        ALOGW("Ignoring spurious device removed event for deviceId %d.", deviceId);
         return;
     }
 
@@ -446,7 +446,7 @@
         const RawEvent* rawEvents, size_t count) {
     ssize_t deviceIndex = mDevices.indexOfKey(deviceId);
     if (deviceIndex < 0) {
-        LOGW("Discarding event for unknown deviceId %d.", deviceId);
+        ALOGW("Discarding event for unknown deviceId %d.", deviceId);
         return;
     }
 
@@ -1554,7 +1554,7 @@
         if (mCurrentSlot < 0 || size_t(mCurrentSlot) >= mSlotCount) {
 #if DEBUG_POINTERS
             if (newSlot) {
-                LOGW("MultiTouch device emitted invalid slot index %d but it "
+                ALOGW("MultiTouch device emitted invalid slot index %d but it "
                         "should be between 0 and %d; ignoring this slot.",
                         mCurrentSlot, mSlotCount - 1);
             }
@@ -2121,7 +2121,7 @@
         if (cursorModeString == "navigation") {
             mParameters.mode = Parameters::MODE_NAVIGATION;
         } else if (cursorModeString != "pointer" && cursorModeString != "default") {
-            LOGW("Invalid value for cursor.mode: '%s'", cursorModeString.string());
+            ALOGW("Invalid value for cursor.mode: '%s'", cursorModeString.string());
         }
     }
 
@@ -2530,7 +2530,7 @@
         } else if (gestureModeString == "spots") {
             mParameters.gestureMode = Parameters::GESTURE_MODE_SPOTS;
         } else if (gestureModeString != "default") {
-            LOGW("Invalid value for touch.gestureMode: '%s'", gestureModeString.string());
+            ALOGW("Invalid value for touch.gestureMode: '%s'", gestureModeString.string());
         }
     }
 
@@ -2560,7 +2560,7 @@
         } else if (deviceTypeString == "pointer") {
             mParameters.deviceType = Parameters::DEVICE_TYPE_POINTER;
         } else if (deviceTypeString != "default") {
-            LOGW("Invalid value for touch.deviceType: '%s'", deviceTypeString.string());
+            ALOGW("Invalid value for touch.deviceType: '%s'", deviceTypeString.string());
         }
     }
 
@@ -2654,7 +2654,7 @@
 
     // Ensure we have valid X and Y axes.
     if (!mRawPointerAxes.x.valid || !mRawPointerAxes.y.valid) {
-        LOGW(INDENT "Touch device '%s' did not report support for X or Y axis!  "
+        ALOGW(INDENT "Touch device '%s' did not report support for X or Y axis!  "
                 "The device will be inoperable.", getDeviceName().string());
         mDeviceMode = DEVICE_MODE_DISABLED;
         return;
@@ -3010,7 +3010,7 @@
         uint32_t flags;
         if (getEventHub()->mapKey(getDeviceId(), virtualKey.scanCode,
                 & keyCode, & flags)) {
-            LOGW(INDENT "VirtualKey %d: could not obtain key code, ignoring",
+            ALOGW(INDENT "VirtualKey %d: could not obtain key code, ignoring",
                     virtualKey.scanCode);
             mVirtualKeys.pop(); // drop the key
             continue;
@@ -3066,7 +3066,7 @@
         } else if (sizeCalibrationString == "area") {
             out.sizeCalibration = Calibration::SIZE_CALIBRATION_AREA;
         } else if (sizeCalibrationString != "default") {
-            LOGW("Invalid value for touch.size.calibration: '%s'",
+            ALOGW("Invalid value for touch.size.calibration: '%s'",
                     sizeCalibrationString.string());
         }
     }
@@ -3089,7 +3089,7 @@
         } else if (pressureCalibrationString == "amplitude") {
             out.pressureCalibration = Calibration::PRESSURE_CALIBRATION_AMPLITUDE;
         } else if (pressureCalibrationString != "default") {
-            LOGW("Invalid value for touch.pressure.calibration: '%s'",
+            ALOGW("Invalid value for touch.pressure.calibration: '%s'",
                     pressureCalibrationString.string());
         }
     }
@@ -3108,7 +3108,7 @@
         } else if (orientationCalibrationString == "vector") {
             out.orientationCalibration = Calibration::ORIENTATION_CALIBRATION_VECTOR;
         } else if (orientationCalibrationString != "default") {
-            LOGW("Invalid value for touch.orientation.calibration: '%s'",
+            ALOGW("Invalid value for touch.orientation.calibration: '%s'",
                     orientationCalibrationString.string());
         }
     }
@@ -3122,7 +3122,7 @@
         } else if (distanceCalibrationString == "scaled") {
             out.distanceCalibration = Calibration::DISTANCE_CALIBRATION_SCALED;
         } else if (distanceCalibrationString != "default") {
-            LOGW("Invalid value for touch.distance.calibration: '%s'",
+            ALOGW("Invalid value for touch.distance.calibration: '%s'",
                     distanceCalibrationString.string());
         }
     }
@@ -5686,7 +5686,7 @@
             && mRawPointerAxes.slot.minValue == 0 && mRawPointerAxes.slot.maxValue > 0) {
         size_t slotCount = mRawPointerAxes.slot.maxValue + 1;
         if (slotCount > MAX_SLOTS) {
-            LOGW("MultiTouch Device %s reported %d slots but the framework "
+            ALOGW("MultiTouch Device %s reported %d slots but the framework "
                     "only supports a maximum of %d slots at this time.",
                     getDeviceName().string(), slotCount, MAX_SLOTS);
             slotCount = MAX_SLOTS;
diff --git a/services/jni/com_android_server_BatteryService.cpp b/services/jni/com_android_server_BatteryService.cpp
index 2ceb535..6082fc7 100644
--- a/services/jni/com_android_server_BatteryService.cpp
+++ b/services/jni/com_android_server_BatteryService.cpp
@@ -93,7 +93,7 @@
         case 'U': return gConstants.statusUnknown;          // Unknown
             
         default: {
-            LOGW("Unknown battery status '%s'", status);
+            ALOGW("Unknown battery status '%s'", status);
             return gConstants.statusUnknown;
         }
     }
@@ -111,7 +111,7 @@
             } else if (strcmp(status, "Over voltage") == 0) {
                 return gConstants.healthOverVoltage;
             }
-            LOGW("Unknown battery health[1] '%s'", status);
+            ALOGW("Unknown battery health[1] '%s'", status);
             return gConstants.healthUnknown;
         }
         
@@ -125,7 +125,7 @@
         }
             
         default: {
-            LOGW("Unknown battery health[2] '%s'", status);
+            ALOGW("Unknown battery health[2] '%s'", status);
             return gConstants.healthUnknown;
         }
     }
diff --git a/services/jni/com_android_server_InputManager.cpp b/services/jni/com_android_server_InputManager.cpp
index b8b5d77..5116785 100644
--- a/services/jni/com_android_server_InputManager.cpp
+++ b/services/jni/com_android_server_InputManager.cpp
@@ -1068,7 +1068,7 @@
 
 static void android_server_InputManager_handleInputChannelDisposed(JNIEnv* env,
         jobject inputChannelObj, const sp<InputChannel>& inputChannel, void* data) {
-    LOGW("Input channel object '%s' was disposed without first being unregistered with "
+    ALOGW("Input channel object '%s' was disposed without first being unregistered with "
             "the input manager!", inputChannel->getName().string());
 
     if (gNativeInputManager != NULL) {
diff --git a/services/sensorservice/Fusion.cpp b/services/sensorservice/Fusion.cpp
index d76f19c..b724ce2 100644
--- a/services/sensorservice/Fusion.cpp
+++ b/services/sensorservice/Fusion.cpp
@@ -338,7 +338,7 @@
 
     if (!isPositiveSemidefinite(P[0][0], SYMMETRY_TOLERANCE) ||
         !isPositiveSemidefinite(P[1][1], SYMMETRY_TOLERANCE)) {
-        LOGW("Sensor fusion diverged; resetting state.");
+        ALOGW("Sensor fusion diverged; resetting state.");
         P = 0;
     }
 }
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 3e4a2f5..a1070d07 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -286,7 +286,7 @@
         }
     } while (count >= 0 || Thread::exitPending());
 
-    LOGW("Exiting SensorService::threadLoop => aborting...");
+    ALOGW("Exiting SensorService::threadLoop => aborting...");
     abort();
     return false;
 }
@@ -594,7 +594,7 @@
     if (size == -EAGAIN) {
         // the destination doesn't accept events anymore, it's probably
         // full. For now, we just drop the events on the floor.
-        //LOGW("dropping %d events on the floor", count);
+        //ALOGW("dropping %d events on the floor", count);
         return size;
     }
 
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index 2ffbd1e..82c5295 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -173,7 +173,7 @@
     char property[PROPERTY_VALUE_MAX];
     if (property_get("debug.sf.hw", property, NULL) > 0) {
         if (atoi(property) == 0) {
-            LOGW("H/W composition disabled");
+            ALOGW("H/W composition disabled");
             attribs[2] = EGL_CONFIG_CAVEAT;
             attribs[3] = EGL_SLOW_CONFIG;
         }
@@ -231,7 +231,7 @@
      */
     if (property_get("qemu.sf.lcd_density", property, NULL) <= 0) {
         if (property_get("ro.sf.lcd_density", property, NULL) <= 0) {
-            LOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
+            ALOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
             strcpy(property, "160");
         }
     } else {
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
index 174dcd7..f4afeea 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
@@ -76,7 +76,7 @@
       err = read(fd, &buf, 1);
     } while (err < 0 && errno == EINTR);
     close(fd);
-    LOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_SLEEP failed (%s)", strerror(errno));
+    ALOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_SLEEP failed (%s)", strerror(errno));
     if (err >= 0) {
         sp<SurfaceFlinger> flinger = mFlinger.promote();
         ALOGD("About to give-up screen, flinger = %p", flinger.get());
@@ -91,7 +91,7 @@
       err = read(fd, &buf, 1);
     } while (err < 0 && errno == EINTR);
     close(fd);
-    LOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_WAKE failed (%s)", strerror(errno));
+    ALOGW_IF(err<0, "ANDROID_WAIT_FOR_FB_WAKE failed (%s)", strerror(errno));
     if (err >= 0) {
         sp<SurfaceFlinger> flinger = mFlinger.promote();
         ALOGD("Screen about to return, flinger = %p", flinger.get());
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index be9b226..68a5a2c 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -44,7 +44,7 @@
       mDpy(EGL_NO_DISPLAY), mSur(EGL_NO_SURFACE)
 {
     int err = hw_get_module(HWC_HARDWARE_MODULE_ID, &mModule);
-    LOGW_IF(err, "%s module not found", HWC_HARDWARE_MODULE_ID);
+    ALOGW_IF(err, "%s module not found", HWC_HARDWARE_MODULE_ID);
     if (err == 0) {
         err = hwc_open(mModule, &mHwc);
         LOGE_IF(err, "%s device failed to initialize (%s)",
diff --git a/services/surfaceflinger/LayerScreenshot.cpp b/services/surfaceflinger/LayerScreenshot.cpp
index 68e6660..c127fa6 100644
--- a/services/surfaceflinger/LayerScreenshot.cpp
+++ b/services/surfaceflinger/LayerScreenshot.cpp
@@ -93,7 +93,7 @@
             // we're going from hidden to visible
             status_t err = captureLocked();
             if (err != NO_ERROR) {
-                LOGW("createScreenshotSurface failed (%s)", strerror(-err));
+                ALOGW("createScreenshotSurface failed (%s)", strerror(-err));
             }
         }
     } else if (curr.flags & ISurfaceComposer::eLayerHidden) {
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index e77f08f..cb67385 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -458,7 +458,7 @@
 {
     // this should never happen. we do the flip anyways so we don't
     // risk to cause a deadlock with hwc
-    LOGW_IF(mSwapRegion.isEmpty(), "mSwapRegion is empty");
+    ALOGW_IF(mSwapRegion.isEmpty(), "mSwapRegion is empty");
     const DisplayHardware& hw(graphicPlane(0).displayHardware());
     const nsecs_t now = systemTime();
     mDebugInSwapBuffers = now;
@@ -1220,7 +1220,7 @@
             mCurrentState.orientation = orientation;
             transactionFlags |= eTransactionNeeded;
         } else if (orientation != eOrientationUnchanged) {
-            LOGW("setTransactionState: ignoring unrecognized orientation: %d",
+            ALOGW("setTransactionState: ignoring unrecognized orientation: %d",
                     orientation);
         }
     }
@@ -1246,7 +1246,7 @@
             if (CC_UNLIKELY(err != NO_ERROR)) {
                 // just in case something goes wrong in SF, return to the
                 // called after a few seconds.
-                LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!");
+                ALOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!");
                 mTransationPending = false;
                 break;
             }
diff --git a/tools/aapt/ZipEntry.cpp b/tools/aapt/ZipEntry.cpp
index 1f3c93c..b575988 100644
--- a/tools/aapt/ZipEntry.cpp
+++ b/tools/aapt/ZipEntry.cpp
@@ -90,7 +90,7 @@
      * prefer the CDE values.)
      */
     if (!hasDD && !compareHeaders()) {
-        LOGW("warning: header mismatch\n");
+        ALOGW("warning: header mismatch\n");
         // keep going?
     }
 
diff --git a/tools/aapt/ZipFile.cpp b/tools/aapt/ZipFile.cpp
index a2d5b80..6428e9d 100644
--- a/tools/aapt/ZipFile.cpp
+++ b/tools/aapt/ZipFile.cpp
@@ -603,7 +603,7 @@
     if (copyPartialFpToFp(mZipFp, pSourceZip->mZipFp, copyLen, NULL)
         != NO_ERROR)
     {
-        LOGW("copy of '%s' failed\n", pEntry->mCDE.mFileName);
+        ALOGW("copy of '%s' failed\n", pEntry->mCDE.mFileName);
         result = UNKNOWN_ERROR;
         goto bail;
     }
@@ -931,7 +931,7 @@
      * of wasted space at the end of the file.  Remove it now.
      */
     if (ftruncate(fileno(mZipFp), ftell(mZipFp)) != 0) {
-        LOGW("ftruncate failed %ld: %s\n", ftell(mZipFp), strerror(errno));
+        ALOGW("ftruncate failed %ld: %s\n", ftell(mZipFp), strerror(errno));
         // not fatal
     }
 
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp
index 270b494..8f968ff 100644
--- a/voip/jni/rtp/AudioGroup.cpp
+++ b/voip/jni/rtp/AudioGroup.cpp
@@ -907,7 +907,7 @@
         }
 
         if (chances <= 0) {
-            LOGW("device loop timeout");
+            ALOGW("device loop timeout");
             while (recv(deviceSocket, &c, 1, MSG_DONTWAIT) == 1);
         }