Merge "By convention const goes before the type specifier"
diff --git a/camera/Camera.cpp b/camera/Camera.cpp
index eef1dd2..ee458f1 100644
--- a/camera/Camera.cpp
+++ b/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) {
@@ -56,7 +56,7 @@
         binder->linkToDeath(mDeathNotifier);
         mCameraService = interface_cast<ICameraService>(binder);
     }
-    LOGE_IF(mCameraService==0, "no CameraService!?");
+    ALOGE_IF(mCameraService==0, "no CameraService!?");
     return mCameraService;
 }
 
@@ -72,7 +72,7 @@
 {
      ALOGV("create");
      if (camera == 0) {
-         LOGE("camera remote is a NULL pointer");
+         ALOGE("camera remote is a NULL pointer");
          return 0;
      }
 
@@ -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/camera/CameraParameters.cpp b/camera/CameraParameters.cpp
index 209d84a..059a8a5 100644
--- a/camera/CameraParameters.cpp
+++ b/camera/CameraParameters.cpp
@@ -231,12 +231,12 @@
 {
     // XXX i think i can do this with strspn()
     if (strchr(key, '=') || strchr(key, ';')) {
-        //XXX LOGE("Key \"%s\"contains invalid character (= or ;)", key);
+        //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key);
         return;
     }
 
     if (strchr(value, '=') || strchr(key, ';')) {
-        //XXX LOGE("Value \"%s\"contains invalid character (= or ;)", value);
+        //XXX ALOGE("Value \"%s\"contains invalid character (= or ;)", value);
         return;
     }
 
@@ -294,7 +294,7 @@
     int w = (int)strtol(str, &end, 10);
     // If a delimeter does not immediately follow, give up.
     if (*end != delim) {
-        LOGE("Cannot find delimeter (%c) in str=%s", delim, str);
+        ALOGE("Cannot find delimeter (%c) in str=%s", delim, str);
         return -1;
     }
 
@@ -324,7 +324,7 @@
         int success = parse_pair(sizeStartPtr, &width, &height, 'x',
                                  &sizeStartPtr);
         if (success == -1 || (*sizeStartPtr != ',' && *sizeStartPtr != '\0')) {
-            LOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr);
+            ALOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr);
             return;
         }
         sizes.push(Size(width, height));
diff --git a/cmds/stagefright/record.cpp b/cmds/stagefright/record.cpp
index b718299..613435d 100644
--- a/cmds/stagefright/record.cpp
+++ b/cmds/stagefright/record.cpp
@@ -96,7 +96,7 @@
         ++mNumFramesOutput;
 
         // printf("DummySource::read - returning buffer\n");
-        // LOGI("DummySource::read - returning buffer");
+        // ALOGI("DummySource::read - returning buffer");
         return OK;
     }
 
diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp
index 7551d31..ae80f88 100644
--- a/cmds/stagefright/sf2.cpp
+++ b/cmds/stagefright/sf2.cpp
@@ -454,7 +454,7 @@
 
                 if (sizeNeeded > sizeLeft) {
                     if (outBuffer->size() == 0) {
-                        LOGE("Unable to fit even a single input buffer of size %d.",
+                        ALOGE("Unable to fit even a single input buffer of size %d.",
                              sizeNeeded);
                     }
                     CHECK_GT(outBuffer->size(), 0u);
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp
index 24403dc..0d6c738 100644
--- a/cmds/stagefright/stream.cpp
+++ b/cmds/stagefright/stream.cpp
@@ -90,7 +90,7 @@
 
 #if 0
     if (mNumPacketsSent >= 20000) {
-        LOGI("signalling discontinuity now");
+        ALOGI("signalling discontinuity now");
 
         off64_t offset = 0;
         CHECK((offset % 188) == 0);
diff --git a/drm/common/ReadWriteUtils.cpp b/drm/common/ReadWriteUtils.cpp
index c16214e..fd17e98 100644
--- a/drm/common/ReadWriteUtils.cpp
+++ b/drm/common/ReadWriteUtils.cpp
@@ -85,7 +85,7 @@
         int size = data.size();
         if (FAILURE != ftruncate(fd, size)) {
             if (size != write(fd, data.string(), size)) {
-                LOGE("Failed to write the data to: %s", filePath.string());
+                ALOGE("Failed to write the data to: %s", filePath.string());
             }
         }
         fclose(file);
@@ -101,7 +101,7 @@
 
         int size = data.size();
         if (size != write(fd, data.string(), size)) {
-            LOGE("Failed to write the data to: %s", filePath.string());
+            ALOGE("Failed to write the data to: %s", filePath.string());
         }
         fclose(file);
     }
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/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
index 7799040..0273a4b 100644
--- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
+++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp
@@ -92,12 +92,12 @@
         case FwdLockConv_Status_InvalidArgument:
         case FwdLockConv_Status_UnsupportedFileFormat:
         case FwdLockConv_Status_UnsupportedContentTransferEncoding:
-            LOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. "
+            ALOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. "
                   "Returning STATUS_INPUTDATA_ERROR", status);
             retStatus = DrmConvertedStatus::STATUS_INPUTDATA_ERROR;
             break;
         default:
-            LOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. "
+            ALOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. "
                   "Returning STATUS_ERROR", status);
             retStatus = DrmConvertedStatus::STATUS_ERROR;
             break;
@@ -139,7 +139,7 @@
     if (FwdLockGlue_InitializeKeyEncryption()) {
         LOG_VERBOSE("FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption succeeded");
     } else {
-        LOGE("FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption failed:"
+        ALOGE("FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption failed:"
              "errno = %d", errno);
     }
 
@@ -351,7 +351,7 @@
             convertSessionMap.addValue(convertId, newSession);
             result = DRM_NO_ERROR;
         } else {
-            LOGE("FwdLockEngine::onOpenConvertSession -- FwdLockConv_OpenSession failed.");
+            ALOGE("FwdLockEngine::onOpenConvertSession -- FwdLockConv_OpenSession failed.");
             delete newSession;
         }
     }
@@ -448,7 +448,7 @@
         (!decodeSessionMap.isCreated(decryptHandle->decryptId))) {
         fileDesc = dup(fd);
     } else {
-        LOGE("FwdLockEngine::onOpenDecryptSession parameter error");
+        ALOGE("FwdLockEngine::onOpenDecryptSession parameter error");
         return result;
     }
 
@@ -550,13 +550,13 @@
                                                 DecryptHandle* decryptHandle,
                                                 int decryptUnitId,
                                                 const DrmBuffer* headerInfo) {
-    LOGE("FwdLockEngine::onInitializeDecryptUnit is not supported for this DRM scheme");
+    ALOGE("FwdLockEngine::onInitializeDecryptUnit is not supported for this DRM scheme");
     return DRM_ERROR_UNKNOWN;
 }
 
 status_t FwdLockEngine::onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId,
             const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) {
-    LOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme");
+    ALOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme");
     return DRM_ERROR_UNKNOWN;
 }
 
@@ -565,14 +565,14 @@
                                   int decryptUnitId,
                                   const DrmBuffer* encBuffer,
                                   DrmBuffer** decBuffer) {
-    LOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme");
+    ALOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme");
     return DRM_ERROR_UNKNOWN;
 }
 
 status_t FwdLockEngine::onFinalizeDecryptUnit(int uniqueId,
                                               DecryptHandle* decryptHandle,
                                               int decryptUnitId) {
-    LOGE("FwdLockEngine::onFinalizeDecryptUnit is not supported for this DRM scheme");
+    ALOGE("FwdLockEngine::onFinalizeDecryptUnit is not supported for this DRM scheme");
     return DRM_ERROR_UNKNOWN;
 }
 
@@ -650,11 +650,11 @@
         if (((off_t)-1) != decoderSession->offset) {
             bytesRead = onRead(uniqueId, decryptHandle, buffer, numBytes);
             if (bytesRead < 0) {
-                LOGE("FwdLockEngine::onPread error reading");
+                ALOGE("FwdLockEngine::onPread error reading");
             }
         }
     } else {
-        LOGE("FwdLockEngine::onPread decryptId not found");
+        ALOGE("FwdLockEngine::onPread decryptId not found");
     }
 
     return bytesRead;
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index b106042..98b2c70 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -445,6 +445,7 @@
             status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount);
             audio_io_handle_t getOutput_l();
             status_t restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart);
+            bool stopped_l() const { return !mActive; }
 
     sp<IAudioTrack>         mAudioTrack;
     sp<IMemory>             mCblkMemory;
@@ -464,7 +465,7 @@
     status_t                mStatus;
     uint32_t                mLatency;
 
-    volatile int32_t        mActive;
+    bool                    mActive;                // protected by mLock
 
     callback_t              mCbf;
     void*                   mUserData;
@@ -481,7 +482,7 @@
     uint32_t                mFlags;
     int                     mSessionId;
     int                     mAuxEffectId;
-    Mutex                   mLock;
+    mutable Mutex           mLock;
     status_t                mRestoreStatus;
     int                     mPreviousPriority;          // before start()
     int                     mPreviousSchedulingGroup;
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..e988e06 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);
@@ -616,7 +616,7 @@
         case PREPROC_EFFECT_STATE_CREATED:
         case PREPROC_EFFECT_STATE_ACTIVE:
         case PREPROC_EFFECT_STATE_CONFIG:
-            LOGE("Effect_SetState invalid transition");
+            ALOGE("Effect_SetState invalid transition");
             status = -ENOSYS;
             break;
         default:
@@ -626,7 +626,7 @@
     case PREPROC_EFFECT_STATE_CONFIG:
         switch(effect->state) {
         case PREPROC_EFFECT_STATE_INIT:
-            LOGE("Effect_SetState invalid transition");
+            ALOGE("Effect_SetState invalid transition");
             status = -ENOSYS;
             break;
         case PREPROC_EFFECT_STATE_ACTIVE:
@@ -645,7 +645,7 @@
         case PREPROC_EFFECT_STATE_INIT:
         case PREPROC_EFFECT_STATE_CREATED:
         case PREPROC_EFFECT_STATE_ACTIVE:
-            LOGE("Effect_SetState invalid transition");
+            ALOGE("Effect_SetState invalid transition");
             status = -ENOSYS;
             break;
         case PREPROC_EFFECT_STATE_CONFIG:
@@ -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..6639d06 100644
--- a/media/libmedia/AudioEffect.cpp
+++ b/media/libmedia/AudioEffect.cpp
@@ -101,18 +101,18 @@
     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;
     }
 
     const sp<IAudioFlinger>& audioFlinger = AudioSystem::get_audio_flinger();
     if (audioFlinger == 0) {
-        LOGE("set(): Could not get audioflinger");
+        ALOGE("set(): Could not get audioflinger");
         return NO_INIT;
     }
 
     if (type == NULL && uuid == NULL) {
-        LOGW("Must specify at least type or uuid");
+        ALOGW("Must specify at least type or uuid");
         return BAD_VALUE;
     }
 
@@ -138,7 +138,7 @@
             mIEffectClient, priority, io, mSessionId, &mStatus, &mId, &enabled);
 
     if (iEffect == 0 || (mStatus != NO_ERROR && mStatus != ALREADY_EXISTS)) {
-        LOGE("set(): AudioFlinger could not create effect, status: %d", mStatus);
+        ALOGE("set(): AudioFlinger could not create effect, status: %d", mStatus);
         return mStatus;
     }
 
@@ -148,7 +148,7 @@
     cblk = iEffect->getCblk();
     if (cblk == 0) {
         mStatus = NO_INIT;
-        LOGE("Could not get control block");
+        ALOGE("Could not get control block");
         return mStatus;
     }
 
@@ -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..2674070 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -54,12 +54,12 @@
     size_t size = 0;
     if (AudioSystem::getInputBufferSize(sampleRate, format, channelCount, &size)
             != NO_ERROR) {
-        LOGE("AudioSystem could not query the input buffer size.");
+        ALOGE("AudioSystem could not query the input buffer size.");
         return NO_INIT;
     }
 
     if (size == 0) {
-        LOGE("Unsupported configuration: sampleRate %d, format %d, channelCount %d",
+        ALOGE("Unsupported configuration: sampleRate %d, format %d, channelCount %d",
             sampleRate, format, channelCount);
         return BAD_VALUE;
     }
@@ -153,7 +153,7 @@
     }
     // validate parameters
     if (!audio_is_valid_format(format)) {
-        LOGE("Invalid format");
+        ALOGE("Invalid format");
         return BAD_VALUE;
     }
 
@@ -177,7 +177,7 @@
                                                     (audio_in_acoustics_t)flags,
                                                     mSessionId);
     if (input == 0) {
-        LOGE("Could not get audio input for record source %d", inputSource);
+        ALOGE("Could not get audio input for record source %d", inputSource);
         return BAD_VALUE;
     }
 
@@ -292,7 +292,7 @@
     if (t != 0) {
         if (t->exitPending()) {
             if (t->requestExitAndWait() == WOULD_BLOCK) {
-                LOGE("AudioRecord::start called from thread");
+                ALOGE("AudioRecord::start called from thread");
                 return WOULD_BLOCK;
             }
         }
@@ -472,12 +472,12 @@
                                                        &status);
 
     if (record == 0) {
-        LOGE("AudioFlinger could not create record track, status: %d", status);
+        ALOGE("AudioFlinger could not create record track, status: %d", status);
         return status;
     }
     sp<IMemory> cblk = record->getCblk();
     if (cblk == 0) {
-        LOGE("Could not get control block");
+        ALOGE("Could not get control block");
         return NO_INIT;
     }
     mAudioRecord.clear();
@@ -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;
                     }
@@ -626,7 +626,7 @@
 
     if (ssize_t(userSize) < 0) {
         // sanity-check. user is most-likely passing an error code.
-        LOGE("AudioRecord::read(buffer=%p, size=%u (%d)",
+        ALOGE("AudioRecord::read(buffer=%p, size=%u (%d)",
                 buffer, userSize, userSize);
         return BAD_VALUE;
     }
@@ -709,7 +709,7 @@
         status_t err = obtainBuffer(&audioBuffer, 1);
         if (err < NO_ERROR) {
             if (err != TIMED_OUT) {
-                LOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up.");
+                ALOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up.");
                 return false;
             }
             break;
@@ -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..f7f129c 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) {
@@ -70,7 +70,7 @@
         gAudioFlinger = interface_cast<IAudioFlinger>(binder);
         gAudioFlinger->registerClient(gAudioFlingerClient);
     }
-    LOGE_IF(gAudioFlinger==0, "no AudioFlinger!?");
+    ALOGE_IF(gAudioFlinger==0, "no AudioFlinger!?");
 
     return gAudioFlinger;
 }
@@ -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..191fbaf 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -158,7 +158,7 @@
 
     AutoMutex lock(mLock);
     if (mAudioTrack != 0) {
-        LOGE("Track already in use");
+        ALOGE("Track already in use");
         return INVALID_OPERATION;
     }
 
@@ -188,7 +188,7 @@
 
     // validate parameters
     if (!audio_is_valid_format(format)) {
-        LOGE("Invalid format");
+        ALOGE("Invalid format");
         return BAD_VALUE;
     }
 
@@ -198,7 +198,7 @@
     }
 
     if (!audio_is_output_channel(channelMask)) {
-        LOGE("Invalid channel mask");
+        ALOGE("Invalid channel mask");
         return BAD_VALUE;
     }
     uint32_t channelCount = popcount(channelMask);
@@ -209,7 +209,7 @@
                                     (audio_policy_output_flags_t)flags);
 
     if (output == 0) {
-        LOGE("Could not get audio output for stream type %d", streamType);
+        ALOGE("Could not get audio output for stream type %d", streamType);
         return BAD_VALUE;
     }
 
@@ -239,7 +239,7 @@
     if (cbf != 0) {
         mAudioTrackThread = new AudioTrackThread(*this, threadCanCallJava);
         if (mAudioTrackThread == 0) {
-          LOGE("Could not create callback thread");
+          ALOGE("Could not create callback thread");
           return NO_INIT;
         }
     }
@@ -252,7 +252,7 @@
     mChannelCount = channelCount;
     mSharedBuffer = sharedBuffer;
     mMuted = false;
-    mActive = 0;
+    mActive = false;
     mCbf = cbf;
     mUserData = user;
     mLoopCount = 0;
@@ -324,7 +324,7 @@
     if (t != 0) {
         if (t->exitPending()) {
             if (t->requestExitAndWait() == WOULD_BLOCK) {
-                LOGE("AudioTrack::start called from thread");
+                ALOGE("AudioTrack::start called from thread");
                 return;
             }
         }
@@ -338,9 +338,9 @@
     sp <IMemory> iMem = mCblkMemory;
     audio_track_cblk_t* cblk = mCblk;
 
-    if (mActive == 0) {
+    if (!mActive) {
         mFlushed = false;
-        mActive = 1;
+        mActive = true;
         mNewPosition = cblk->server + mUpdatePeriod;
         cblk->lock.lock();
         cblk->bufferTimeoutMs = MAX_STARTUP_TIMEOUT_MS;
@@ -369,7 +369,7 @@
         cblk->lock.unlock();
         if (status != NO_ERROR) {
             ALOGV("start() failed");
-            mActive = 0;
+            mActive = false;
             if (t != 0) {
                 t->requestExit();
             } else {
@@ -394,8 +394,8 @@
     }
 
     AutoMutex lock(mLock);
-    if (mActive == 1) {
-        mActive = 0;
+    if (mActive) {
+        mActive = false;
         mCblk->cv.signal();
         mAudioTrack->stop();
         // Cancel loops (If we are in the middle of a loop, playback
@@ -424,7 +424,8 @@
 
 bool AudioTrack::stopped() const
 {
-    return !mActive;
+    AutoMutex lock(mLock);
+    return stopped_l();
 }
 
 void AudioTrack::flush()
@@ -456,8 +457,8 @@
 {
     ALOGV("pause");
     AutoMutex lock(mLock);
-    if (mActive == 1) {
-        mActive = 0;
+    if (mActive) {
+        mActive = false;
         mAudioTrack->pause();
     }
 }
@@ -566,12 +567,12 @@
     if (loopStart >= loopEnd ||
         loopEnd - loopStart > cblk->frameCount ||
         cblk->server > loopStart) {
-        LOGE("setLoop invalid value: loopStart %d, loopEnd %d, loopCount %d, framecount %d, user %d", loopStart, loopEnd, loopCount, cblk->frameCount, cblk->user);
+        ALOGE("setLoop invalid value: loopStart %d, loopEnd %d, loopCount %d, framecount %d, user %d", loopStart, loopEnd, loopCount, cblk->frameCount, cblk->user);
         return BAD_VALUE;
     }
 
     if ((mSharedBuffer != 0) && (loopEnd > cblk->frameCount)) {
-        LOGE("setLoop invalid value: loop markers beyond data: loopStart %d, loopEnd %d, framecount %d",
+        ALOGE("setLoop invalid value: loop markers beyond data: loopStart %d, loopEnd %d, framecount %d",
             loopStart, loopEnd, cblk->frameCount);
         return BAD_VALUE;
     }
@@ -647,9 +648,10 @@
 status_t AudioTrack::setPosition(uint32_t position)
 {
     AutoMutex lock(mLock);
-    Mutex::Autolock _l(mCblk->lock);
 
-    if (!stopped()) return INVALID_OPERATION;
+    if (!stopped_l()) return INVALID_OPERATION;
+
+    Mutex::Autolock _l(mCblk->lock);
 
     if (position > mCblk->user) return BAD_VALUE;
 
@@ -672,7 +674,7 @@
 {
     AutoMutex lock(mLock);
 
-    if (!stopped()) return INVALID_OPERATION;
+    if (!stopped_l()) return INVALID_OPERATION;
 
     flush_l();
 
@@ -726,7 +728,7 @@
     status_t status;
     const sp<IAudioFlinger>& audioFlinger = AudioSystem::get_audio_flinger();
     if (audioFlinger == 0) {
-       LOGE("Could not get audioflinger");
+       ALOGE("Could not get audioflinger");
        return NO_INIT;
     }
 
@@ -769,7 +771,7 @@
             }
             if (frameCount < minFrameCount) {
                 if (enforceFrameCount) {
-                    LOGE("Invalid buffer size: minFrameCount %d, frameCount %d", minFrameCount, frameCount);
+                    ALOGE("Invalid buffer size: minFrameCount %d, frameCount %d", minFrameCount, frameCount);
                     return BAD_VALUE;
                 } else {
                     frameCount = minFrameCount;
@@ -779,7 +781,7 @@
             // Ensure that buffer alignment matches channelcount
             int channelCount = popcount(channelMask);
             if (((uint32_t)sharedBuffer->pointer() & (channelCount | 1)) != 0) {
-                LOGE("Invalid buffer alignement: address %p, channelCount %d", sharedBuffer->pointer(), channelCount);
+                ALOGE("Invalid buffer alignement: address %p, channelCount %d", sharedBuffer->pointer(), channelCount);
                 return BAD_VALUE;
             }
             frameCount = sharedBuffer->size()/channelCount/sizeof(int16_t);
@@ -799,12 +801,12 @@
                                                       &status);
 
     if (track == 0) {
-        LOGE("AudioFlinger could not create track, status: %d", status);
+        ALOGE("AudioFlinger could not create track, status: %d", status);
         return status;
     }
     sp<IMemory> cblk = track->getCblk();
     if (cblk == 0) {
-        LOGE("Could not get control block");
+        ALOGE("Could not get control block");
         return NO_INIT;
     }
     mAudioTrack = track;
@@ -832,7 +834,7 @@
 status_t AudioTrack::obtainBuffer(Buffer* audioBuffer, int32_t waitCount)
 {
     AutoMutex lock(mLock);
-    int active;
+    bool active;
     status_t result = NO_ERROR;
     audio_track_cblk_t* cblk = mCblk;
     uint32_t framesReq = audioBuffer->frameCount;
@@ -868,7 +870,7 @@
                 result = cblk->cv.waitRelative(cblk->lock, milliseconds(waitTimeMs));
                 cblk->lock.unlock();
                 mLock.lock();
-                if (mActive == 0) {
+                if (!mActive) {
                     return status_t(STOPPED);
                 }
                 cblk->lock.lock();
@@ -883,7 +885,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 +897,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 +920,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();
     }
 
@@ -964,7 +966,7 @@
 
     if (ssize_t(userSize) < 0) {
         // sanity-check. user is most-likely passing an error code.
-        LOGE("AudioTrack::write(buffer=%p, size=%u (%d)",
+        ALOGE("AudioTrack::write(buffer=%p, size=%u (%d)",
                 buffer, userSize, userSize);
         return BAD_VALUE;
     }
@@ -1035,10 +1037,11 @@
     sp <IAudioTrack> audioTrack = mAudioTrack;
     sp <IMemory> iMem = mCblkMemory;
     audio_track_cblk_t* cblk = mCblk;
+    bool active = mActive;
     mLock.unlock();
 
     // Manage underrun callback
-    if (mActive && (cblk->framesAvailable() == cblk->frameCount)) {
+    if (active && (cblk->framesAvailable() == cblk->frameCount)) {
         ALOGV("Underrun user: %x, server: %x, flags %04x", cblk->user, cblk->server, cblk->flags);
         if (!(android_atomic_or(CBLK_UNDERRUN_ON, &cblk->flags) & CBLK_UNDERRUN_MSK)) {
             mCbf(EVENT_UNDERRUN, mUserData, 0);
@@ -1096,7 +1099,7 @@
         status_t err = obtainBuffer(&audioBuffer, waitCount);
         if (err < NO_ERROR) {
             if (err != TIMED_OUT) {
-                LOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up.");
+                ALOGE_IF(err != status_t(NO_MORE_BUFFERS), "Error obtaining an audio buffer, giving up.");
                 return false;
             }
             break;
@@ -1164,7 +1167,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 +1223,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 +1231,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 +1239,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 +1248,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 +1262,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 +1331,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 +1352,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 +1370,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 +1431,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/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp
index bedf8d3..abd491f 100644
--- a/media/libmedia/IAudioFlinger.cpp
+++ b/media/libmedia/IAudioFlinger.cpp
@@ -112,7 +112,7 @@
         data.writeInt32(lSessionId);
         status_t lStatus = remote()->transact(CREATE_TRACK, data, &reply);
         if (lStatus != NO_ERROR) {
-            LOGE("createTrack error: %s", strerror(-lStatus));
+            ALOGE("createTrack error: %s", strerror(-lStatus));
         } else {
             lSessionId = reply.readInt32();
             if (sessionId != NULL) {
@@ -155,7 +155,7 @@
         data.writeInt32(lSessionId);
         status_t lStatus = remote()->transact(OPEN_RECORD, data, &reply);
         if (lStatus != NO_ERROR) {
-            LOGE("openRecord error: %s", strerror(-lStatus));
+            ALOGE("openRecord error: %s", strerror(-lStatus));
         } else {
             lSessionId = reply.readInt32();
             if (sessionId != NULL) {
@@ -632,7 +632,7 @@
 
         status_t lStatus = remote()->transact(CREATE_EFFECT, data, &reply);
         if (lStatus != NO_ERROR) {
-            LOGE("createEffect error: %s", strerror(-lStatus));
+            ALOGE("createEffect error: %s", strerror(-lStatus));
         } else {
             lStatus = reply.readInt32();
             int tmp = reply.readInt32();
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..8525482 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);
 
@@ -54,7 +54,7 @@
     binder->linkToDeath(sDeathNotifier);
     sMediaPlayerService = interface_cast<IMediaPlayerService>(binder);
     }
-    LOGE_IF(sMediaPlayerService == 0, "no media player service!?");
+    ALOGE_IF(sMediaPlayerService == 0, "no media player service!?");
     return sMediaPlayerService;
 }
 
@@ -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/JetPlayer.cpp b/media/libmedia/JetPlayer.cpp
index afa84b7..188e582 100644
--- a/media/libmedia/JetPlayer.cpp
+++ b/media/libmedia/JetPlayer.cpp
@@ -68,21 +68,21 @@
     if (pLibConfig == NULL)
         pLibConfig = EAS_Config();
     if (pLibConfig == NULL) {
-        LOGE("JetPlayer::init(): EAS library configuration could not be retrieved, aborting.");
+        ALOGE("JetPlayer::init(): EAS library configuration could not be retrieved, aborting.");
         return EAS_FAILURE;
     }
 
     // init the EAS library
     result = EAS_Init(&mEasData);
     if( result != EAS_SUCCESS) {
-        LOGE("JetPlayer::init(): Error initializing Sonivox EAS library, aborting.");
+        ALOGE("JetPlayer::init(): Error initializing Sonivox EAS library, aborting.");
         mState = EAS_STATE_ERROR;
         return result;
     }
     // init the JET library with the default app event controller range
     result = JET_Init(mEasData, NULL, sizeof(S_JET_CONFIG));
     if( result != EAS_SUCCESS) {
-        LOGE("JetPlayer::init(): Error initializing JET library, aborting.");
+        ALOGE("JetPlayer::init(): Error initializing JET library, aborting.");
         mState = EAS_STATE_ERROR;
         return result;
     }
@@ -109,7 +109,7 @@
         ALOGV("JetPlayer::init(): render thread(%d) successfully started.", mTid);
         mState = EAS_STATE_READY;
     } else {
-        LOGE("JetPlayer::init(): failed to start render thread.");
+        ALOGE("JetPlayer::init(): failed to start render thread.");
         mState = EAS_STATE_ERROR;
         return EAS_FAILURE;
     }
@@ -169,7 +169,7 @@
     mAudioBuffer = 
         new EAS_PCM[pLibConfig->mixBufferSize * pLibConfig->numChannels * MIX_NUM_BUFFERS];
     if (!mAudioBuffer) {
-        LOGE("JetPlayer::render(): mAudioBuffer allocate failed");
+        ALOGE("JetPlayer::render(): mAudioBuffer allocate failed");
         goto threadExit;
     }
 
@@ -210,7 +210,7 @@
         for (int i = 0; i < MIX_NUM_BUFFERS; i++) {
             result = EAS_Render(mEasData, p, pLibConfig->mixBufferSize, &count);
             if (result != EAS_SUCCESS) {
-                LOGE("JetPlayer::render(): EAS_Render returned error %ld", result);
+                ALOGE("JetPlayer::render(): EAS_Render returned error %ld", result);
             }
             p += count * pLibConfig->numChannels;
             num_output += count * pLibConfig->numChannels * sizeof(EAS_PCM);
@@ -229,14 +229,14 @@
 
         // check audio output track
         if (mAudioTrack == NULL) {
-            LOGE("JetPlayer::render(): output AudioTrack was not created");
+            ALOGE("JetPlayer::render(): output AudioTrack was not created");
             goto threadExit;
         }
 
         // Write data to the audio hardware
         //ALOGV("JetPlayer::render(): writing to audio output");
         if ((temp = mAudioTrack->write(mAudioBuffer, num_output)) < 0) {
-            LOGE("JetPlayer::render(): Error in writing:%d",temp);
+            ALOGE("JetPlayer::render(): Error in writing:%d",temp);
             return temp;
         }
 
@@ -469,7 +469,7 @@
 //-------------------------------------------------------------------------------------------------
 void JetPlayer::dump()
 {
-    LOGE("JetPlayer dump: JET file=%s", mEasJetFileLoc->path);
+    ALOGE("JetPlayer dump: JET file=%s", mEasJetFileLoc->path);
 }
 
 void JetPlayer::dumpJetStatus(S_JET_STATUS* pJetStatus)
@@ -479,7 +479,7 @@
                 pJetStatus->currentUserID, pJetStatus->segmentRepeatCount,
                 pJetStatus->numQueuedSegments, pJetStatus->paused);
     else
-        LOGE(">> JET player status is NULL");
+        ALOGE(">> JET player status is NULL");
 }
 
 
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 109f294..c905762 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.
@@ -903,7 +903,7 @@
       expat is not compiled with -DXML_DTD. We don't have DTD parsing support.
 
       if (!::XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS)) {
-          LOGE("failed to enable DTD support in the xml file");
+          ALOGE("failed to enable DTD support in the xml file");
           return UNKNOWN_ERROR;
       }
 
@@ -913,7 +913,7 @@
     for (;;) {
         void *buff = ::XML_GetBuffer(parser, BUFF_SIZE);
         if (buff == NULL) {
-            LOGE("failed to in call to XML_GetBuffer()");
+            ALOGE("failed to in call to XML_GetBuffer()");
             delete profiles;
             profiles = NULL;
             goto exit;
@@ -921,7 +921,7 @@
 
         int bytes_read = ::fread(buff, 1, BUFF_SIZE, fp);
         if (bytes_read < 0) {
-            LOGE("failed in call to read");
+            ALOGE("failed in call to read");
             delete profiles;
             profiles = NULL;
             goto exit;
@@ -963,7 +963,7 @@
         }
     }
     if (index == -1) {
-        LOGE("The given video encoder %d is not found", codec);
+        ALOGE("The given video encoder %d is not found", codec);
         return -1;
     }
 
@@ -976,7 +976,7 @@
     if (!strcmp("enc.vid.fps.min", name)) return mVideoEncoders[index]->mMinFrameRate;
     if (!strcmp("enc.vid.fps.max", name)) return mVideoEncoders[index]->mMaxFrameRate;
 
-    LOGE("The given video encoder param name %s is not found", name);
+    ALOGE("The given video encoder param name %s is not found", name);
     return -1;
 }
 int MediaProfiles::getVideoEditorExportParamByName(
@@ -993,7 +993,7 @@
         }
     }
     if (index == -1) {
-        LOGE("The given video decoder %d is not found", codec);
+        ALOGE("The given video decoder %d is not found", codec);
         return -1;
     }
     if (!strcmp("videoeditor.export.profile", name))
@@ -1001,7 +1001,7 @@
     if (!strcmp("videoeditor.export.level", name))
         return exportProfile->mLevel;
 
-    LOGE("The given video editor export param name %s is not found", name);
+    ALOGE("The given video editor export param name %s is not found", name);
     return -1;
 }
 int MediaProfiles::getVideoEditorCapParamByName(const char *name) const
@@ -1009,7 +1009,7 @@
     ALOGV("getVideoEditorCapParamByName: %s", name);
 
     if (mVideoEditorCap == NULL) {
-        LOGE("The mVideoEditorCap is not created, then create default cap.");
+        ALOGE("The mVideoEditorCap is not created, then create default cap.");
         createDefaultVideoEditorCap(sInstance);
     }
 
@@ -1024,7 +1024,7 @@
     if (!strcmp("maxPrefetchYUVFrames", name))
         return mVideoEditorCap->mMaxPrefetchYUVFrames;
 
-    LOGE("The given video editor param name %s is not found", name);
+    ALOGE("The given video editor param name %s is not found", name);
     return -1;
 }
 
@@ -1048,7 +1048,7 @@
         }
     }
     if (index == -1) {
-        LOGE("The given audio encoder %d is not found", codec);
+        ALOGE("The given audio encoder %d is not found", codec);
         return -1;
     }
 
@@ -1059,7 +1059,7 @@
     if (!strcmp("enc.aud.hz.min", name)) return mAudioEncoders[index]->mMinSampleRate;
     if (!strcmp("enc.aud.hz.max", name)) return mAudioEncoders[index]->mMaxSampleRate;
 
-    LOGE("The given audio encoder param name %s is not found", name);
+    ALOGE("The given audio encoder param name %s is not found", name);
     return -1;
 }
 
@@ -1103,7 +1103,7 @@
 
     int index = getCamcorderProfileIndex(cameraId, quality);
     if (index == -1) {
-        LOGE("The given camcorder profile camera %d quality %d is not found",
+        ALOGE("The given camcorder profile camera %d quality %d is not found",
              cameraId, quality);
         return -1;
     }
@@ -1120,7 +1120,7 @@
     if (!strcmp("aud.ch", name)) return mCamcorderProfiles[index]->mAudioCodec->mChannels;
     if (!strcmp("aud.hz", name)) return mCamcorderProfiles[index]->mAudioCodec->mSampleRate;
 
-    LOGE("The given camcorder profile param id %d name %s is not found", cameraId, name);
+    ALOGE("The given camcorder profile param id %d name %s is not found", cameraId, name);
     return -1;
 }
 
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/MediaScannerClient.cpp b/media/libmedia/MediaScannerClient.cpp
index 629b165..40b8188 100644
--- a/media/libmedia/MediaScannerClient.cpp
+++ b/media/libmedia/MediaScannerClient.cpp
@@ -142,12 +142,12 @@
 
         UConverter *conv = ucnv_open(enc, &status);
         if (U_FAILURE(status)) {
-            LOGE("could not create UConverter for %s\n", enc);
+            ALOGE("could not create UConverter for %s\n", enc);
             return;
         }
         UConverter *utf8Conv = ucnv_open("UTF-8", &status);
         if (U_FAILURE(status)) {
-            LOGE("could not create UConverter for UTF-8\n");
+            ALOGE("could not create UConverter for UTF-8\n");
             ucnv_close(conv);
             return;
         }
@@ -180,7 +180,7 @@
             ucnv_convertEx(utf8Conv, conv, &target, target + targetLength,
                     &source, (const char *)dest, NULL, NULL, NULL, NULL, TRUE, TRUE, &status);
             if (U_FAILURE(status)) {
-                LOGE("ucnv_convertEx failed: %d\n", status);
+                ALOGE("ucnv_convertEx failed: %d\n", status);
                 mValues->setEntry(i, "???");
             } else {
                 // zero terminate
diff --git a/media/libmedia/Metadata.cpp b/media/libmedia/Metadata.cpp
index 8eeebbb..546a9b0 100644
--- a/media/libmedia/Metadata.cpp
+++ b/media/libmedia/Metadata.cpp
@@ -135,7 +135,7 @@
 {
     if (key < FIRST_SYSTEM_ID ||
         (LAST_SYSTEM_ID < key && key < FIRST_CUSTOM_ID)) {
-        LOGE("Bad key %d", key);
+        ALOGE("Bad key %d", key);
         return false;
     }
     size_t curr = mData->dataPosition();
@@ -152,7 +152,7 @@
             break;
         }
         if (mData->readInt32() == key) {
-            LOGE("Key exists already %d", key);
+            ALOGE("Key exists already %d", key);
             error = true;
             break;
         }
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 28b54b5..35dfbb8 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -805,7 +805,7 @@
     mState = TONE_IDLE;
 
     if (AudioSystem::getOutputSamplingRate(&mSamplingRate, streamType) != NO_ERROR) {
-        LOGE("Unable to marshal AudioFlinger");
+        ALOGE("Unable to marshal AudioFlinger");
         return;
     }
     mThreadCanCallJava = threadCanCallJava;
@@ -906,7 +906,7 @@
         ALOGV("Start waiting for previous tone to stop");
         lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3));
         if (lStatus != NO_ERROR) {
-            LOGE("--- start wait for stop timed out, status %d", lStatus);
+            ALOGE("--- start wait for stop timed out, status %d", lStatus);
             mState = TONE_IDLE;
             mLock.unlock();
             return lResult;
@@ -925,7 +925,7 @@
                 ALOGV("Wait for start callback");
                 lStatus = mWaitCbkCond.waitRelative(mLock, seconds(3));
                 if (lStatus != NO_ERROR) {
-                    LOGE("--- Immediate start timed out, status %d", lStatus);
+                    ALOGE("--- Immediate start timed out, status %d", lStatus);
                     mState = TONE_IDLE;
                     lResult = false;
                 }
@@ -943,14 +943,14 @@
             }
             ALOGV("cond received");
         } else {
-            LOGE("--- Delayed start timed out, status %d", lStatus);
+            ALOGE("--- Delayed start timed out, status %d", lStatus);
             mState = TONE_IDLE;
         }
     }
     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;
 }
@@ -979,7 +979,7 @@
         if (lStatus == NO_ERROR) {
             ALOGV("track stop complete, time %d", (unsigned int)(systemTime()/1000000));
         } else {
-            LOGE("--- Stop timed out");
+            ALOGE("--- Stop timed out");
             mState = TONE_IDLE;
             mpAudioTrack->stop();
         }
@@ -1018,7 +1018,7 @@
    // Open audio track in mono, PCM 16bit, default sampling rate, default buffer size
     mpAudioTrack = new AudioTrack();
     if (mpAudioTrack == 0) {
-        LOGE("AudioTrack allocation failed");
+        ALOGE("AudioTrack allocation failed");
         goto initAudioTrack_exit;
     }
     ALOGV("Create Track: %p\n", mpAudioTrack);
@@ -1036,7 +1036,7 @@
                       mThreadCanCallJava);
 
     if (mpAudioTrack->initCheck() != NO_ERROR) {
-        LOGE("AudioTrack->initCheck failed");
+        ALOGE("AudioTrack->initCheck failed");
         goto initAudioTrack_exit;
     }
 
@@ -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/Visualizer.cpp b/media/libmedia/Visualizer.cpp
index de40f98..d08ffa5 100644
--- a/media/libmedia/Visualizer.cpp
+++ b/media/libmedia/Visualizer.cpp
@@ -61,7 +61,7 @@
         if (enabled) {
             if (t->exitPending()) {
                 if (t->requestExitAndWait() == WOULD_BLOCK) {
-                    LOGE("Visualizer::enable() called from thread");
+                    ALOGE("Visualizer::enable() called from thread");
                     return INVALID_OPERATION;
                 }
             }
@@ -116,7 +116,7 @@
     if (cbk != NULL) {
         mCaptureThread = new CaptureThread(*this, rate, ((flags & CAPTURE_CALL_JAVA) != 0));
         if (mCaptureThread == 0) {
-            LOGE("Could not create callback thread");
+            ALOGE("Could not create callback thread");
             return NO_INIT;
         }
     }
diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp
index fd8c065..88e269f 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) {
@@ -52,7 +52,7 @@
         binder->linkToDeath(sDeathNotifier);
         sService = interface_cast<IMediaPlayerService>(binder);
     }
-    LOGE_IF(sService == 0, "no MediaPlayerService!?");
+    ALOGE_IF(sService == 0, "no MediaPlayerService!?");
     return sService;
 }
 
@@ -61,12 +61,12 @@
     ALOGV("constructor");
     const sp<IMediaPlayerService>& service(getService());
     if (service == 0) {
-        LOGE("failed to obtain MediaMetadataRetrieverService");
+        ALOGE("failed to obtain MediaMetadataRetrieverService");
         return;
     }
     sp<IMediaMetadataRetriever> retriever(service->createMetadataRetriever(getpid()));
     if (retriever == 0) {
-        LOGE("failed to create IMediaMetadataRetriever object from server");
+        ALOGE("failed to create IMediaMetadataRetriever object from server");
     }
     mRetriever = retriever;
 }
@@ -98,11 +98,11 @@
     ALOGV("setDataSource");
     Mutex::Autolock _l(mLock);
     if (mRetriever == 0) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return INVALID_OPERATION;
     }
     if (srcUrl == NULL) {
-        LOGE("data source is a null pointer");
+        ALOGE("data source is a null pointer");
         return UNKNOWN_ERROR;
     }
     ALOGV("data source (%s)", srcUrl);
@@ -114,11 +114,11 @@
     ALOGV("setDataSource(%d, %lld, %lld)", fd, offset, length);
     Mutex::Autolock _l(mLock);
     if (mRetriever == 0) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return INVALID_OPERATION;
     }
     if (fd < 0 || offset < 0 || length < 0) {
-        LOGE("Invalid negative argument");
+        ALOGE("Invalid negative argument");
         return UNKNOWN_ERROR;
     }
     return mRetriever->setDataSource(fd, offset, length);
@@ -129,7 +129,7 @@
     ALOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option);
     Mutex::Autolock _l(mLock);
     if (mRetriever == 0) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return NULL;
     }
     return mRetriever->getFrameAtTime(timeUs, option);
@@ -140,7 +140,7 @@
     ALOGV("extractMetadata(%d)", keyCode);
     Mutex::Autolock _l(mLock);
     if (mRetriever == 0) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return NULL;
     }
     return mRetriever->extractMetadata(keyCode);
@@ -151,7 +151,7 @@
     ALOGV("extractAlbumArt");
     Mutex::Autolock _l(mLock);
     if (mRetriever == 0) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return NULL;
     }
     return mRetriever->extractAlbumArt();
@@ -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..2284927 100644
--- a/media/libmedia/mediaplayer.cpp
+++ b/media/libmedia/mediaplayer.cpp
@@ -115,7 +115,7 @@
 
         if ( !( (mCurrentState & MEDIA_PLAYER_IDLE) ||
                 (mCurrentState == MEDIA_PLAYER_STATE_ERROR ) ) ) {
-            LOGE("attachNewPlayer called in state %d", mCurrentState);
+            ALOGE("attachNewPlayer called in state %d", mCurrentState);
             return INVALID_OPERATION;
         }
 
@@ -126,7 +126,7 @@
             mCurrentState = MEDIA_PLAYER_INITIALIZED;
             err = NO_ERROR;
         } else {
-            LOGE("Unable to to create media player");
+            ALOGE("Unable to to create media player");
         }
     }
 
@@ -195,7 +195,7 @@
          ALOGV("invoke %d", request.dataSize());
          return  mPlayer->invoke(request, reply);
     }
-    LOGE("invoke failed: wrong state %X", mCurrentState);
+    ALOGE("invoke failed: wrong state %X", mCurrentState);
     return INVALID_OPERATION;
 }
 
@@ -236,7 +236,7 @@
         mCurrentState = MEDIA_PLAYER_PREPARING;
         return mPlayer->prepareAsync();
     }
-    LOGE("prepareAsync called in state %d", mCurrentState);
+    ALOGE("prepareAsync called in state %d", mCurrentState);
     return INVALID_OPERATION;
 }
 
@@ -298,7 +298,7 @@
         }
         return ret;
     }
-    LOGE("start called in state %d", mCurrentState);
+    ALOGE("start called in state %d", mCurrentState);
     return INVALID_OPERATION;
 }
 
@@ -317,7 +317,7 @@
         }
         return ret;
     }
-    LOGE("stop called in state %d", mCurrentState);
+    ALOGE("stop called in state %d", mCurrentState);
     return INVALID_OPERATION;
 }
 
@@ -336,7 +336,7 @@
         }
         return ret;
     }
-    LOGE("pause called in state %d", mCurrentState);
+    ALOGE("pause called in state %d", mCurrentState);
     return INVALID_OPERATION;
 }
 
@@ -348,7 +348,7 @@
         mPlayer->isPlaying(&temp);
         ALOGV("isPlaying: %d", temp);
         if ((mCurrentState & MEDIA_PLAYER_STARTED) && ! temp) {
-            LOGE("internal/external state mismatch corrected");
+            ALOGE("internal/external state mismatch corrected");
             mCurrentState = MEDIA_PLAYER_PAUSED;
         }
         return temp;
@@ -402,7 +402,7 @@
             *msec = mDuration;
         return ret;
     }
-    LOGE("Attempt to call getDuration without a valid mediaplayer");
+    ALOGE("Attempt to call getDuration without a valid mediaplayer");
     return INVALID_OPERATION;
 }
 
@@ -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
@@ -435,7 +435,7 @@
             return NO_ERROR;
         }
     }
-    LOGE("Attempt to perform seekTo in wrong state: mPlayer=%p, mCurrentState=%u", mPlayer.get(), mCurrentState);
+    ALOGE("Attempt to perform seekTo in wrong state: mPlayer=%p, mCurrentState=%u", mPlayer.get(), mCurrentState);
     return INVALID_OPERATION;
 }
 
@@ -457,7 +457,7 @@
     if (mPlayer != 0) {
         status_t ret = mPlayer->reset();
         if (ret != NO_ERROR) {
-            LOGE("reset() failed with return code (%d)", ret);
+            ALOGE("reset() failed with return code (%d)", ret);
             mCurrentState = MEDIA_PLAYER_STATE_ERROR;
         } else {
             mCurrentState = MEDIA_PLAYER_IDLE;
@@ -486,7 +486,7 @@
     if (mCurrentState & ( MEDIA_PLAYER_PREPARED | MEDIA_PLAYER_STARTED |
                 MEDIA_PLAYER_PAUSED | MEDIA_PLAYER_PLAYBACK_COMPLETE ) ) {
         // Can't change the stream type after prepare
-        LOGE("setAudioStream called in state %d", mCurrentState);
+        ALOGE("setAudioStream called in state %d", mCurrentState);
         return INVALID_OPERATION;
     }
     // cache
@@ -532,7 +532,7 @@
     ALOGV("MediaPlayer::setAudioSessionId(%d)", sessionId);
     Mutex::Autolock _l(mLock);
     if (!(mCurrentState & MEDIA_PLAYER_IDLE)) {
-        LOGE("setAudioSessionId called in state %d", mCurrentState);
+        ALOGE("setAudioSessionId called in state %d", mCurrentState);
         return INVALID_OPERATION;
     }
     if (sessionId < 0) {
@@ -570,7 +570,7 @@
     if (mPlayer == 0 ||
         (mCurrentState & MEDIA_PLAYER_IDLE) ||
         (mCurrentState == MEDIA_PLAYER_STATE_ERROR )) {
-        LOGE("attachAuxEffect called in state %d", mCurrentState);
+        ALOGE("attachAuxEffect called in state %d", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -641,7 +641,7 @@
     case MEDIA_PLAYBACK_COMPLETE:
         ALOGV("playback complete");
         if (mCurrentState == MEDIA_PLAYER_IDLE) {
-            LOGE("playback complete in idle state");
+            ALOGE("playback complete in idle state");
         }
         if (!mLoop) {
             mCurrentState = MEDIA_PLAYER_PLAYBACK_COMPLETE;
@@ -651,7 +651,7 @@
         // Always log errors.
         // ext1: Media framework error code.
         // ext2: Implementation dependant error code.
-        LOGE("error (%d, %d)", ext1, ext2);
+        ALOGE("error (%d, %d)", ext1, ext2);
         mCurrentState = MEDIA_PLAYER_STATE_ERROR;
         if (mPrepareSync)
         {
@@ -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:
@@ -717,7 +717,7 @@
     if (service != 0) {
         p = service->decode(url, pSampleRate, pNumChannels, pFormat);
     } else {
-        LOGE("Unable to locate media service");
+        ALOGE("Unable to locate media service");
     }
     return p;
 
@@ -737,7 +737,7 @@
     if (service != 0) {
         p = service->decode(fd, offset, length, pSampleRate, pNumChannels, pFormat);
     } else {
-        LOGE("Unable to locate media service");
+        ALOGE("Unable to locate media service");
     }
     return p;
 
diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp
index ec62978..8d947d8 100644
--- a/media/libmedia/mediarecorder.cpp
+++ b/media/libmedia/mediarecorder.cpp
@@ -33,11 +33,11 @@
 {
     ALOGV("setCamera(%p,%p)", camera.get(), proxy.get());
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_IDLE)) {
-        LOGE("setCamera called in an invalid state(%d)", mCurrentState);
+        ALOGE("setCamera called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -54,15 +54,15 @@
 {
     ALOGV("setPreviewSurface(%p)", surface.get());
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setPreviewSurface called in an invalid state(%d)", mCurrentState);
+        ALOGE("setPreviewSurface called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
     if (!mIsVideoSourceSet) {
-        LOGE("try to set preview surface without setting the video source first");
+        ALOGE("try to set preview surface without setting the video source first");
         return INVALID_OPERATION;
     }
 
@@ -79,11 +79,11 @@
 {
     ALOGV("init");
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_IDLE)) {
-        LOGE("init called in an invalid state(%d)", mCurrentState);
+        ALOGE("init called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -109,11 +109,11 @@
 {
     ALOGV("setVideoSource(%d)", vs);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (mIsVideoSourceSet) {
-        LOGE("video source has already been set");
+        ALOGE("video source has already been set");
         return INVALID_OPERATION;
     }
     if (mCurrentState & MEDIA_RECORDER_IDLE) {
@@ -124,7 +124,7 @@
         }
     }
     if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) {
-        LOGE("setVideoSource called in an invalid state(%d)", mCurrentState);
+        ALOGE("setVideoSource called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -144,7 +144,7 @@
 {
     ALOGV("setAudioSource(%d)", as);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (mCurrentState & MEDIA_RECORDER_IDLE) {
@@ -155,11 +155,11 @@
         }
     }
     if (mIsAudioSourceSet) {
-        LOGE("audio source has already been set");
+        ALOGE("audio source has already been set");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) {
-        LOGE("setAudioSource called in an invalid state(%d)", mCurrentState);
+        ALOGE("setAudioSource called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -177,21 +177,21 @@
 {
     ALOGV("setOutputFormat(%d)", of);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) {
-        LOGE("setOutputFormat called in an invalid state: %d", mCurrentState);
+        ALOGE("setOutputFormat called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
     if (mIsVideoSourceSet && of >= OUTPUT_FORMAT_AUDIO_ONLY_START && of != OUTPUT_FORMAT_RTP_AVP && of != OUTPUT_FORMAT_MPEG2TS) { //first non-video output format
-        LOGE("output format (%d) is meant for audio recording only and incompatible with video recording", of);
+        ALOGE("output format (%d) is meant for audio recording only and incompatible with video recording", of);
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->setOutputFormat(of);
     if (OK != ret) {
-        LOGE("setOutputFormat failed: %d", ret);
+        ALOGE("setOutputFormat failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -203,19 +203,19 @@
 {
     ALOGV("setVideoEncoder(%d)", ve);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!mIsVideoSourceSet) {
-        LOGE("try to set the video encoder without setting the video source first");
+        ALOGE("try to set the video encoder without setting the video source first");
         return INVALID_OPERATION;
     }
     if (mIsVideoEncoderSet) {
-        LOGE("video encoder has already been set");
+        ALOGE("video encoder has already been set");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setVideoEncoder called in an invalid state(%d)", mCurrentState);
+        ALOGE("setVideoEncoder called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -233,19 +233,19 @@
 {
     ALOGV("setAudioEncoder(%d)", ae);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!mIsAudioSourceSet) {
-        LOGE("try to set the audio encoder without setting the audio source first");
+        ALOGE("try to set the audio encoder without setting the audio source first");
         return INVALID_OPERATION;
     }
     if (mIsAudioEncoderSet) {
-        LOGE("audio encoder has already been set");
+        ALOGE("audio encoder has already been set");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setAudioEncoder called in an invalid state(%d)", mCurrentState);
+        ALOGE("setAudioEncoder called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -263,15 +263,15 @@
 {
     ALOGV("setOutputFile(%s)", path);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (mIsOutputFileSet) {
-        LOGE("output file has already been set");
+        ALOGE("output file has already been set");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setOutputFile called in an invalid state(%d)", mCurrentState);
+        ALOGE("setOutputFile called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -289,15 +289,15 @@
 {
     ALOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (mIsOutputFileSet) {
-        LOGE("output file has already been set");
+        ALOGE("output file has already been set");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setOutputFile called in an invalid state(%d)", mCurrentState);
+        ALOGE("setOutputFile called in an invalid state(%d)", mCurrentState);
         return INVALID_OPERATION;
     }
 
@@ -308,7 +308,7 @@
     // this issue by checking the file descriptor first before passing
     // it through binder call.
     if (fd < 0) {
-        LOGE("Invalid file descriptor: %d", fd);
+        ALOGE("Invalid file descriptor: %d", fd);
         return BAD_VALUE;
     }
 
@@ -326,21 +326,21 @@
 {
     ALOGV("setVideoSize(%d, %d)", width, height);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setVideoSize called in an invalid state: %d", mCurrentState);
+        ALOGE("setVideoSize called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
     if (!mIsVideoSourceSet) {
-        LOGE("Cannot set video size without setting video source first");
+        ALOGE("Cannot set video size without setting video source first");
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->setVideoSize(width, height);
     if (OK != ret) {
-        LOGE("setVideoSize failed: %d", ret);
+        ALOGE("setVideoSize failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -358,7 +358,7 @@
     mSurfaceMediaSource =
             mMediaRecorder->querySurfaceMediaSource();
     if (mSurfaceMediaSource == NULL) {
-        LOGE("SurfaceMediaSource could not be initialized!");
+        ALOGE("SurfaceMediaSource could not be initialized!");
     }
     return mSurfaceMediaSource;
 }
@@ -369,21 +369,21 @@
 {
     ALOGV("setVideoFrameRate(%d)", frames_per_second);
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("setVideoFrameRate called in an invalid state: %d", mCurrentState);
+        ALOGE("setVideoFrameRate called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
     if (!mIsVideoSourceSet) {
-        LOGE("Cannot set video frame rate without setting video source first");
+        ALOGE("Cannot set video frame rate without setting video source first");
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->setVideoFrameRate(frames_per_second);
     if (OK != ret) {
-        LOGE("setVideoFrameRate failed: %d", ret);
+        ALOGE("setVideoFrameRate failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -393,7 +393,7 @@
 status_t MediaRecorder::setParameters(const String8& params) {
     ALOGV("setParameters(%s)", params.string());
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
 
@@ -402,13 +402,13 @@
                             MEDIA_RECORDER_RECORDING |
                             MEDIA_RECORDER_ERROR));
     if (isInvalidState) {
-        LOGE("setParameters is called in an invalid state: %d", mCurrentState);
+        ALOGE("setParameters is called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->setParameters(params);
     if (OK != ret) {
-        LOGE("setParameters(%s) failed: %d", params.string(), ret);
+        ALOGE("setParameters(%s) failed: %d", params.string(), ret);
         // Do not change our current state to MEDIA_RECORDER_ERROR, failures
         // of the only currently supported parameters, "max-duration" and
         // "max-filesize" are _not_ fatal.
@@ -421,34 +421,34 @@
 {
     ALOGV("prepare");
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_DATASOURCE_CONFIGURED)) {
-        LOGE("prepare called in an invalid state: %d", mCurrentState);
+        ALOGE("prepare called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
     if (mIsAudioSourceSet != mIsAudioEncoderSet) {
         if (mIsAudioSourceSet) {
-            LOGE("audio source is set, but audio encoder is not set");
+            ALOGE("audio source is set, but audio encoder is not set");
         } else {  // must not happen, since setAudioEncoder checks this already
-            LOGE("audio encoder is set, but audio source is not set");
+            ALOGE("audio encoder is set, but audio source is not set");
         }
         return INVALID_OPERATION;
     }
 
     if (mIsVideoSourceSet != mIsVideoEncoderSet) {
         if (mIsVideoSourceSet) {
-            LOGE("video source is set, but video encoder is not set");
+            ALOGE("video source is set, but video encoder is not set");
         } else {  // must not happen, since setVideoEncoder checks this already
-            LOGE("video encoder is set, but video source is not set");
+            ALOGE("video encoder is set, but video source is not set");
         }
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->prepare();
     if (OK != ret) {
-        LOGE("prepare failed: %d", ret);
+        ALOGE("prepare failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -460,17 +460,17 @@
 {
     ALOGV("getMaxAmplitude");
     if(mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (mCurrentState & MEDIA_RECORDER_ERROR) {
-        LOGE("getMaxAmplitude called in an invalid state: %d", mCurrentState);
+        ALOGE("getMaxAmplitude called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->getMaxAmplitude(max);
     if (OK != ret) {
-        LOGE("getMaxAmplitude failed: %d", ret);
+        ALOGE("getMaxAmplitude failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -481,17 +481,17 @@
 {
     ALOGV("start");
     if (mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_PREPARED)) {
-        LOGE("start called in an invalid state: %d", mCurrentState);
+        ALOGE("start called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->start();
     if (OK != ret) {
-        LOGE("start failed: %d", ret);
+        ALOGE("start failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -503,17 +503,17 @@
 {
     ALOGV("stop");
     if (mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
     if (!(mCurrentState & MEDIA_RECORDER_RECORDING)) {
-        LOGE("stop called in an invalid state: %d", mCurrentState);
+        ALOGE("stop called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
 
     status_t ret = mMediaRecorder->stop();
     if (OK != ret) {
-        LOGE("stop failed: %d", ret);
+        ALOGE("stop failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     }
@@ -531,7 +531,7 @@
 {
     ALOGV("reset");
     if (mMediaRecorder == NULL) {
-        LOGE("media recorder is not initialized yet");
+        ALOGE("media recorder is not initialized yet");
         return INVALID_OPERATION;
     }
 
@@ -556,7 +556,7 @@
             break;
 
         default: {
-            LOGE("Unexpected non-existing state: %d", mCurrentState);
+            ALOGE("Unexpected non-existing state: %d", mCurrentState);
             break;
         }
     }
@@ -567,12 +567,12 @@
 {
     ALOGV("close");
     if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) {
-        LOGE("close called in an invalid state: %d", mCurrentState);
+        ALOGE("close called in an invalid state: %d", mCurrentState);
         return INVALID_OPERATION;
     }
     status_t ret = mMediaRecorder->close();
     if (OK != ret) {
-        LOGE("close failed: %d", ret);
+        ALOGE("close failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return UNKNOWN_ERROR;
     } else {
@@ -586,7 +586,7 @@
     ALOGV("doReset");
     status_t ret = mMediaRecorder->reset();
     if (OK != ret) {
-        LOGE("doReset failed: %d", ret);
+        ALOGE("doReset failed: %d", ret);
         mCurrentState = MEDIA_RECORDER_ERROR;
         return ret;
     } else {
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 487c433..f5cb019 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -112,14 +112,14 @@
     int32_t val;
     if (p.readInt32(&val) != OK)
     {
-        LOGE("Failed to read filter's length");
+        ALOGE("Failed to read filter's length");
         *status = NOT_ENOUGH_DATA;
         return false;
     }
 
     if( val > kMaxFilterSize || val < 0)
     {
-        LOGE("Invalid filter len %d", val);
+        ALOGE("Invalid filter len %d", val);
         *status = BAD_VALUE;
         return false;
     }
@@ -134,7 +134,7 @@
 
     if (p.dataAvail() < size)
     {
-        LOGE("Filter too short expected %d but got %d", size, p.dataAvail());
+        ALOGE("Filter too short expected %d but got %d", size, p.dataAvail());
         *status = NOT_ENOUGH_DATA;
         return false;
     }
@@ -144,7 +144,7 @@
 
     if (NULL == data)
     {
-        LOGE("Filter had no data");
+        ALOGE("Filter had no data");
         *status = BAD_VALUE;
         return false;
     }
@@ -184,7 +184,7 @@
 #endif
     if (getpid() == IPCThreadState::self()->getCallingPid()) return true;
     bool ok = checkCallingPermission(String16(permissionString));
-    if (!ok) LOGE("Request requires %s", permissionString);
+    if (!ok) ALOGE("Request requires %s", permissionString);
     return ok;
 }
 
@@ -630,7 +630,7 @@
             p = new TestPlayerStub();
             break;
         default:
-            LOGE("Unknown player type: %d", playerType);
+            ALOGE("Unknown player type: %d", playerType);
             return NULL;
     }
     if (p != NULL) {
@@ -641,7 +641,7 @@
         }
     }
     if (p == NULL) {
-        LOGE("Failed to create player object");
+        ALOGE("Failed to create player object");
     }
     return p;
 }
@@ -688,7 +688,7 @@
         int fd = android::openContentProviderFile(url16);
         if (fd < 0)
         {
-            LOGE("Couldn't open fd for %s", url);
+            ALOGE("Couldn't open fd for %s", url);
             return UNKNOWN_ERROR;
         }
         setDataSource(fd, 0, 0x7fffffffffLL); // this sets mStatus
@@ -713,7 +713,7 @@
         if (mStatus == NO_ERROR) {
             mPlayer = p;
         } else {
-            LOGE("  error: %d", mStatus);
+            ALOGE("  error: %d", mStatus);
         }
         return mStatus;
     }
@@ -725,7 +725,7 @@
     struct stat sb;
     int ret = fstat(fd, &sb);
     if (ret != 0) {
-        LOGE("fstat(%d) failed: %d, %s", fd, ret, strerror(errno));
+        ALOGE("fstat(%d) failed: %d, %s", fd, ret, strerror(errno));
         return UNKNOWN_ERROR;
     }
 
@@ -736,7 +736,7 @@
     ALOGV("st_size = %llu", sb.st_size);
 
     if (offset >= sb.st_size) {
-        LOGE("offset error");
+        ALOGE("offset error");
         ::close(fd);
         return UNKNOWN_ERROR;
     }
@@ -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);
         }
     }
@@ -821,7 +821,7 @@
                 NATIVE_WINDOW_API_MEDIA);
 
         if (err != OK) {
-            LOGE("setVideoSurfaceTexture failed: %d", err);
+            ALOGE("setVideoSurfaceTexture failed: %d", err);
             // Note that we must do the reset before disconnecting from the ANW.
             // Otherwise queue/dequeue calls could be made on the disconnected
             // ANW, which may result in errors.
@@ -905,7 +905,7 @@
 
     if (status != OK) {
         metadata.resetParcel();
-        LOGE("getMetadata failed %d", status);
+        ALOGE("getMetadata failed %d", status);
         return status;
     }
 
@@ -975,7 +975,7 @@
     if (ret == NO_ERROR) {
         ALOGV("[%d] getCurrentPosition = %d", mConnId, *msec);
     } else {
-        LOGE("getCurrentPosition returned %d", ret);
+        ALOGE("getCurrentPosition returned %d", ret);
     }
     return ret;
 }
@@ -989,7 +989,7 @@
     if (ret == NO_ERROR) {
         ALOGV("[%d] getDuration = %d", mConnId, *msec);
     } else {
-        LOGE("getDuration returned %d", ret);
+        ALOGE("getDuration returned %d", ret);
     }
     return ret;
 }
@@ -1394,7 +1394,7 @@
     }
 
     if ((t == 0) || (t->initCheck() != NO_ERROR)) {
-        LOGE("Unable to create audio track");
+        ALOGE("Unable to create audio track");
         delete t;
         return NO_INIT;
     }
@@ -1652,7 +1652,7 @@
     p += mSize;
     ALOGV("memcpy(%p, %p, %u)", p, buffer, size);
     if (mSize + size > mHeap->getSize()) {
-        LOGE("Heap size overflow! req size: %d, max size: %d", (mSize + size), mHeap->getSize());
+        ALOGE("Heap size overflow! req size: %d, max size: %d", (mSize + size), mHeap->getSize());
         size = mHeap->getSize() - mSize;
     }
     memcpy(p, buffer, size);
@@ -1687,7 +1687,7 @@
     switch (msg)
     {
     case MEDIA_ERROR:
-        LOGE("Error %d, %d occurred", ext1, ext2);
+        ALOGE("Error %d, %d occurred", ext1, ext2);
         p->mError = ext1;
         break;
     case MEDIA_PREPARED:
@@ -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;
         }
 
@@ -1807,7 +1807,7 @@
         info.refCount = 0;
 
         if (mBatteryData.add(uid, info) == NO_MEMORY) {
-            LOGE("Battery track error: no memory for new app");
+            ALOGE("Battery track error: no memory for new app");
             return;
         }
     }
@@ -1825,10 +1825,10 @@
         }
     } 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");
+            ALOGE("Battery track error: refCount < 0");
             mBatteryData.removeItem(uid);
             return;
         }
diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp
index ca92c77..d219fc2 100644
--- a/media/libmediaplayerservice/MediaRecorderClient.cpp
+++ b/media/libmediaplayerservice/MediaRecorderClient.cpp
@@ -54,7 +54,7 @@
 #endif
     if (getpid() == IPCThreadState::self()->getCallingPid()) return true;
     bool ok = checkCallingPermission(String16(permissionString));
-    if (!ok) LOGE("Request requires %s", permissionString);
+    if (!ok) ALOGE("Request requires %s", permissionString);
     return ok;
 }
 
@@ -64,7 +64,7 @@
     ALOGV("Query SurfaceMediaSource");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NULL;
     }
     return mRecorder->querySurfaceMediaSource();
@@ -78,7 +78,7 @@
     ALOGV("setCamera");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setCamera(camera, proxy);
@@ -89,7 +89,7 @@
     ALOGV("setPreviewSurface");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setPreviewSurface(surface);
@@ -103,7 +103,7 @@
     }
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL)	{
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setVideoSource((video_source)vs);
@@ -117,7 +117,7 @@
     }
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL)  {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setAudioSource((audio_source_t)as);
@@ -128,7 +128,7 @@
     ALOGV("setOutputFormat(%d)", of);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setOutputFormat((output_format)of);
@@ -139,7 +139,7 @@
     ALOGV("setVideoEncoder(%d)", ve);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setVideoEncoder((video_encoder)ve);
@@ -150,7 +150,7 @@
     ALOGV("setAudioEncoder(%d)", ae);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setAudioEncoder((audio_encoder)ae);
@@ -161,7 +161,7 @@
     ALOGV("setOutputFile(%s)", path);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setOutputFile(path);
@@ -172,7 +172,7 @@
     ALOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setOutputFile(fd, offset, length);
@@ -183,7 +183,7 @@
     ALOGV("setVideoSize(%dx%d)", width, height);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setVideoSize(width, height);
@@ -194,7 +194,7 @@
     ALOGV("setVideoFrameRate(%d)", frames_per_second);
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setVideoFrameRate(frames_per_second);
@@ -204,7 +204,7 @@
     ALOGV("setParameters(%s)", params.string());
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setParameters(params);
@@ -215,7 +215,7 @@
     ALOGV("prepare");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->prepare();
@@ -227,7 +227,7 @@
     ALOGV("getMaxAmplitude");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->getMaxAmplitude(max);
@@ -238,7 +238,7 @@
     ALOGV("start");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->start();
@@ -250,7 +250,7 @@
     ALOGV("stop");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->stop();
@@ -261,7 +261,7 @@
     ALOGV("init");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->init();
@@ -272,7 +272,7 @@
     ALOGV("close");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->close();
@@ -284,7 +284,7 @@
     ALOGV("reset");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->reset();
@@ -322,7 +322,7 @@
     ALOGV("setListener");
     Mutex::Autolock lock(mLock);
     if (mRecorder == NULL) {
-        LOGE("recorder is not initialized");
+        ALOGE("recorder is not initialized");
         return NO_INIT;
     }
     return mRecorder->setListener(listener);
diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index f945c6a..7dbb57f 100644
--- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -98,11 +98,11 @@
         default:
             // TODO:
             // support for TEST_PLAYER
-            LOGE("player type %d is not supported",  playerType);
+            ALOGE("player type %d is not supported",  playerType);
             break;
     }
     if (p == NULL) {
-        LOGE("failed to create a retriever object");
+        ALOGE("failed to create a retriever object");
     }
     return p;
 }
@@ -131,7 +131,7 @@
     struct stat sb;
     int ret = fstat(fd, &sb);
     if (ret != 0) {
-        LOGE("fstat(%d) failed: %d, %s", fd, ret, strerror(errno));
+        ALOGE("fstat(%d) failed: %d, %s", fd, ret, strerror(errno));
         return BAD_VALUE;
     }
     ALOGV("st_dev  = %llu", sb.st_dev);
@@ -141,7 +141,7 @@
     ALOGV("st_size = %llu", sb.st_size);
 
     if (offset >= sb.st_size) {
-        LOGE("offset (%lld) bigger than file size (%llu)", offset, sb.st_size);
+        ALOGE("offset (%lld) bigger than file size (%llu)", offset, sb.st_size);
         ::close(fd);
         return BAD_VALUE;
     }
@@ -169,24 +169,24 @@
     Mutex::Autolock lock(mLock);
     mThumbnail.clear();
     if (mRetriever == NULL) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return NULL;
     }
     VideoFrame *frame = mRetriever->getFrameAtTime(timeUs, option);
     if (frame == NULL) {
-        LOGE("failed to capture a video frame");
+        ALOGE("failed to capture a video frame");
         return NULL;
     }
     size_t size = sizeof(VideoFrame) + frame->mSize;
     sp<MemoryHeapBase> heap = new MemoryHeapBase(size, 0, "MetadataRetrieverClient");
     if (heap == NULL) {
-        LOGE("failed to create MemoryDealer");
+        ALOGE("failed to create MemoryDealer");
         delete frame;
         return NULL;
     }
     mThumbnail = new MemoryBase(heap, 0, size);
     if (mThumbnail == NULL) {
-        LOGE("not enough memory for VideoFrame size=%u", size);
+        ALOGE("not enough memory for VideoFrame size=%u", size);
         delete frame;
         return NULL;
     }
@@ -210,24 +210,24 @@
     Mutex::Autolock lock(mLock);
     mAlbumArt.clear();
     if (mRetriever == NULL) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return NULL;
     }
     MediaAlbumArt *albumArt = mRetriever->extractAlbumArt();
     if (albumArt == NULL) {
-        LOGE("failed to extract an album art");
+        ALOGE("failed to extract an album art");
         return NULL;
     }
     size_t size = sizeof(MediaAlbumArt) + albumArt->mSize;
     sp<MemoryHeapBase> heap = new MemoryHeapBase(size, 0, "MetadataRetrieverClient");
     if (heap == NULL) {
-        LOGE("failed to create MemoryDealer object");
+        ALOGE("failed to create MemoryDealer object");
         delete albumArt;
         return NULL;
     }
     mAlbumArt = new MemoryBase(heap, 0, size);
     if (mAlbumArt == NULL) {
-        LOGE("not enough memory for MediaAlbumArt size=%u", size);
+        ALOGE("not enough memory for MediaAlbumArt size=%u", size);
         delete albumArt;
         return NULL;
     }
@@ -244,7 +244,7 @@
     ALOGV("extractMetadata");
     Mutex::Autolock lock(mLock);
     if (mRetriever == NULL) {
-        LOGE("retriever is not initialized");
+        ALOGE("retriever is not initialized");
         return NULL;
     }
     return mRetriever->extractMetadata(keyCode);
diff --git a/media/libmediaplayerservice/MidiFile.cpp b/media/libmediaplayerservice/MidiFile.cpp
index 4946956..7cb8c29 100644
--- a/media/libmediaplayerservice/MidiFile.cpp
+++ b/media/libmediaplayerservice/MidiFile.cpp
@@ -69,13 +69,13 @@
     if (pLibConfig == NULL)
         pLibConfig = EAS_Config();
     if ((pLibConfig == NULL) || (LIB_VERSION != pLibConfig->libVersion)) {
-        LOGE("EAS library/header mismatch");
+        ALOGE("EAS library/header mismatch");
         goto Failed;
     }
 
     // initialize EAS library
     if (EAS_Init(&mEasData) != EAS_SUCCESS) {
-        LOGE("EAS_Init failed");
+        ALOGE("EAS_Init failed");
         goto Failed;
     }
 
@@ -134,7 +134,7 @@
     }
 
     if (result != EAS_SUCCESS) {
-        LOGE("EAS_OpenFile failed: [%d]", (int)result);
+        ALOGE("EAS_OpenFile failed: [%d]", (int)result);
         mState = EAS_STATE_ERROR;
         return ERROR_OPEN_FAILED;
     }
@@ -162,7 +162,7 @@
     updateState();
 
     if (result != EAS_SUCCESS) {
-        LOGE("EAS_OpenFile failed: [%d]", (int)result);
+        ALOGE("EAS_OpenFile failed: [%d]", (int)result);
         mState = EAS_STATE_ERROR;
         return ERROR_OPEN_FAILED;
     }
@@ -181,7 +181,7 @@
     }
     EAS_RESULT result;
     if ((result = EAS_Prepare(mEasData, mEasHandle)) != EAS_SUCCESS) {
-        LOGE("EAS_Prepare failed: [%ld]", result);
+        ALOGE("EAS_Prepare failed: [%ld]", result);
         return ERROR_EAS_FAILURE;
     }
     updateState();
@@ -237,7 +237,7 @@
     if (!mPaused && (mState != EAS_STATE_STOPPED)) {
         EAS_RESULT result = EAS_Pause(mEasData, mEasHandle);
         if (result != EAS_SUCCESS) {
-            LOGE("EAS_Pause returned error %ld", result);
+            ALOGE("EAS_Pause returned error %ld", result);
             return ERROR_EAS_FAILURE;
         }
     }
@@ -258,7 +258,7 @@
         if ((result = EAS_Locate(mEasData, mEasHandle, position, false))
                 != EAS_SUCCESS)
         {
-            LOGE("EAS_Locate returned %ld", result);
+            ALOGE("EAS_Locate returned %ld", result);
             return ERROR_EAS_FAILURE;
         }
         EAS_GetLocation(mEasData, mEasHandle, &mPlayTime);
@@ -293,11 +293,11 @@
 {
     ALOGV("MidiFile::getCurrentPosition");
     if (!mEasHandle) {
-        LOGE("getCurrentPosition(): file not open");
+        ALOGE("getCurrentPosition(): file not open");
         return ERROR_NOT_OPEN;
     }
     if (mPlayTime < 0) {
-        LOGE("getCurrentPosition(): mPlayTime = %ld", mPlayTime);
+        ALOGE("getCurrentPosition(): mPlayTime = %ld", mPlayTime);
         return ERROR_EAS_FAILURE;
     }
     *position = mPlayTime;
@@ -422,7 +422,7 @@
 
 status_t MidiFile::createOutputTrack() {
     if (mAudioSink->open(pLibConfig->sampleRate, pLibConfig->numChannels, AUDIO_FORMAT_PCM_16_BIT, 2) != NO_ERROR) {
-        LOGE("mAudioSink open failed");
+        ALOGE("mAudioSink open failed");
         return ERROR_OPEN_FAILED;
     }
     return NO_ERROR;
@@ -439,7 +439,7 @@
     // allocate render buffer
     mAudioBuffer = new EAS_PCM[pLibConfig->mixBufferSize * pLibConfig->numChannels * NUM_BUFFERS];
     if (!mAudioBuffer) {
-        LOGE("mAudioBuffer allocate failed");
+        ALOGE("mAudioBuffer allocate failed");
         goto threadExit;
     }
 
@@ -473,7 +473,7 @@
         for (int i = 0; i < NUM_BUFFERS; i++) {
             result = EAS_Render(mEasData, p, pLibConfig->mixBufferSize, &count);
             if (result != EAS_SUCCESS) {
-                LOGE("EAS_Render returned %ld", result);
+                ALOGE("EAS_Render returned %ld", result);
             }
             p += count * pLibConfig->numChannels;
             num_output += count * pLibConfig->numChannels * sizeof(EAS_PCM);
@@ -495,7 +495,7 @@
         // Write data to the audio hardware
         // ALOGV("MidiFile::render - writing to audio output");
         if ((temp = mAudioSink->write(mAudioBuffer, num_output)) < 0) {
-            LOGE("Error in writing:%d",temp);
+            ALOGE("Error in writing:%d",temp);
             return temp;
         }
 
@@ -519,7 +519,7 @@
             }
             case EAS_STATE_ERROR:
             {
-                LOGE("MidiFile::render - error");
+                ALOGE("MidiFile::render - error");
                 sendEvent(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN);
                 break;
             }
diff --git a/media/libmediaplayerservice/MidiMetadataRetriever.cpp b/media/libmediaplayerservice/MidiMetadataRetriever.cpp
index bb65ed4..465209f 100644
--- a/media/libmediaplayerservice/MidiMetadataRetriever.cpp
+++ b/media/libmediaplayerservice/MidiMetadataRetriever.cpp
@@ -63,7 +63,7 @@
     ALOGV("extractMetdata: key(%d)", keyCode);
     Mutex::Autolock lock(mLock);
     if (mMidiPlayer == 0 || mMidiPlayer->initCheck() != NO_ERROR) {
-        LOGE("Midi player is not initialized yet");
+        ALOGE("Midi player is not initialized yet");
         return NULL;
     }
     switch (keyCode) {
@@ -72,7 +72,7 @@
             if (mMetadataValues[0][0] == '\0') {
                 int duration = -1;
                 if (mMidiPlayer->getDuration(&duration) != NO_ERROR) {
-                    LOGE("failed to get duration");
+                    ALOGE("failed to get duration");
                     return NULL;
                 }
                 snprintf(mMetadataValues[0], MAX_METADATA_STRING_LENGTH, "%d", duration);
@@ -82,7 +82,7 @@
             return mMetadataValues[0];
         }
     default:
-        LOGE("Unsupported key code (%d)", keyCode);
+        ALOGE("Unsupported key code (%d)", keyCode);
         return NULL;
     }
     return NULL;
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index c0ba091..4632016 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -97,7 +97,7 @@
     ALOGV("setAudioSource: %d", as);
     if (as < AUDIO_SOURCE_DEFAULT ||
         as >= AUDIO_SOURCE_CNT) {
-        LOGE("Invalid audio source: %d", as);
+        ALOGE("Invalid audio source: %d", as);
         return BAD_VALUE;
     }
 
@@ -114,7 +114,7 @@
     ALOGV("setVideoSource: %d", vs);
     if (vs < VIDEO_SOURCE_DEFAULT ||
         vs >= VIDEO_SOURCE_LIST_END) {
-        LOGE("Invalid video source: %d", vs);
+        ALOGE("Invalid video source: %d", vs);
         return BAD_VALUE;
     }
 
@@ -131,7 +131,7 @@
     ALOGV("setOutputFormat: %d", of);
     if (of < OUTPUT_FORMAT_DEFAULT ||
         of >= OUTPUT_FORMAT_LIST_END) {
-        LOGE("Invalid output format: %d", of);
+        ALOGE("Invalid output format: %d", of);
         return BAD_VALUE;
     }
 
@@ -148,7 +148,7 @@
     ALOGV("setAudioEncoder: %d", ae);
     if (ae < AUDIO_ENCODER_DEFAULT ||
         ae >= AUDIO_ENCODER_LIST_END) {
-        LOGE("Invalid audio encoder: %d", ae);
+        ALOGE("Invalid audio encoder: %d", ae);
         return BAD_VALUE;
     }
 
@@ -165,7 +165,7 @@
     ALOGV("setVideoEncoder: %d", ve);
     if (ve < VIDEO_ENCODER_DEFAULT ||
         ve >= VIDEO_ENCODER_LIST_END) {
-        LOGE("Invalid video encoder: %d", ve);
+        ALOGE("Invalid video encoder: %d", ve);
         return BAD_VALUE;
     }
 
@@ -181,7 +181,7 @@
 status_t StagefrightRecorder::setVideoSize(int width, int height) {
     ALOGV("setVideoSize: %dx%d", width, height);
     if (width <= 0 || height <= 0) {
-        LOGE("Invalid video size: %dx%d", width, height);
+        ALOGE("Invalid video size: %dx%d", width, height);
         return BAD_VALUE;
     }
 
@@ -196,7 +196,7 @@
     ALOGV("setVideoFrameRate: %d", frames_per_second);
     if ((frames_per_second <= 0 && frames_per_second != -1) ||
         frames_per_second > 120) {
-        LOGE("Invalid video frame rate: %d", frames_per_second);
+        ALOGE("Invalid video frame rate: %d", frames_per_second);
         return BAD_VALUE;
     }
 
@@ -210,11 +210,11 @@
                                         const sp<ICameraRecordingProxy> &proxy) {
     ALOGV("setCamera");
     if (camera == 0) {
-        LOGE("camera is NULL");
+        ALOGE("camera is NULL");
         return BAD_VALUE;
     }
     if (proxy == 0) {
-        LOGE("camera proxy is NULL");
+        ALOGE("camera proxy is NULL");
         return BAD_VALUE;
     }
 
@@ -231,7 +231,7 @@
 }
 
 status_t StagefrightRecorder::setOutputFile(const char *path) {
-    LOGE("setOutputFile(const char*) must not be called");
+    ALOGE("setOutputFile(const char*) must not be called");
     // We don't actually support this at all, as the media_server process
     // no longer has permissions to create files.
 
@@ -245,7 +245,7 @@
     CHECK_EQ(length, 0);
 
     if (fd < 0) {
-        LOGE("Invalid file descriptor: %d", fd);
+        ALOGE("Invalid file descriptor: %d", fd);
         return -EBADF;
     }
 
@@ -315,7 +315,7 @@
 status_t StagefrightRecorder::setParamAudioSamplingRate(int32_t sampleRate) {
     ALOGV("setParamAudioSamplingRate: %d", sampleRate);
     if (sampleRate <= 0) {
-        LOGE("Invalid audio sampling rate: %d", sampleRate);
+        ALOGE("Invalid audio sampling rate: %d", sampleRate);
         return BAD_VALUE;
     }
 
@@ -327,7 +327,7 @@
 status_t StagefrightRecorder::setParamAudioNumberOfChannels(int32_t channels) {
     ALOGV("setParamAudioNumberOfChannels: %d", channels);
     if (channels <= 0 || channels >= 3) {
-        LOGE("Invalid number of audio channels: %d", channels);
+        ALOGE("Invalid number of audio channels: %d", channels);
         return BAD_VALUE;
     }
 
@@ -339,7 +339,7 @@
 status_t StagefrightRecorder::setParamAudioEncodingBitRate(int32_t bitRate) {
     ALOGV("setParamAudioEncodingBitRate: %d", bitRate);
     if (bitRate <= 0) {
-        LOGE("Invalid audio encoding bit rate: %d", bitRate);
+        ALOGE("Invalid audio encoding bit rate: %d", bitRate);
         return BAD_VALUE;
     }
 
@@ -354,7 +354,7 @@
 status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) {
     ALOGV("setParamVideoEncodingBitRate: %d", bitRate);
     if (bitRate <= 0) {
-        LOGE("Invalid video encoding bit rate: %d", bitRate);
+        ALOGE("Invalid video encoding bit rate: %d", bitRate);
         return BAD_VALUE;
     }
 
@@ -370,7 +370,7 @@
 status_t StagefrightRecorder::setParamVideoRotation(int32_t degrees) {
     ALOGV("setParamVideoRotation: %d", degrees);
     if (degrees < 0 || degrees % 90 != 0) {
-        LOGE("Unsupported video rotation angle: %d", degrees);
+        ALOGE("Unsupported video rotation angle: %d", degrees);
         return BAD_VALUE;
     }
     mRotationDegrees = degrees % 360;
@@ -382,15 +382,15 @@
 
     // 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);
+        ALOGE("Max file duration is too short: %lld us", timeUs);
         return BAD_VALUE;
     }
 
     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,16 +401,16 @@
 
     // 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
-        LOGE("Max file size is too small: %lld bytes", bytes);
+        ALOGE("Max file size is too small: %lld bytes", bytes);
         return BAD_VALUE;
     }
 
     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;
@@ -423,13 +423,13 @@
         // If interleave duration is too small, it is very inefficient to do
         // interleaving since the metadata overhead will count for a significant
         // portion of the saved contents
-        LOGE("Audio/video interleave duration is too small: %d us", durationUs);
+        ALOGE("Audio/video interleave duration is too small: %d us", durationUs);
         return BAD_VALUE;
     } else if (durationUs >= 10000000) {  // 10 seconds
         // If interleaving duration is too large, it can cause the recording
         // session to use too much memory since we have to save the output
         // data before we write them out
-        LOGE("Audio/video interleave duration is too large: %d us", durationUs);
+        ALOGE("Audio/video interleave duration is too large: %d us", durationUs);
         return BAD_VALUE;
     }
     mInterleaveDurationUs = durationUs;
@@ -464,7 +464,7 @@
 status_t StagefrightRecorder::setParamTrackTimeStatus(int64_t timeDurationUs) {
     ALOGV("setParamTrackTimeStatus: %lld", timeDurationUs);
     if (timeDurationUs < 20000) {  // Infeasible if shorter than 20 ms?
-        LOGE("Tracking time duration too short: %lld us", timeDurationUs);
+        ALOGE("Tracking time duration too short: %lld us", timeDurationUs);
         return BAD_VALUE;
     }
     mTrackEveryTimeDurationUs = timeDurationUs;
@@ -495,7 +495,7 @@
     // The range is set to be the same as the audio's time scale range
     // since audio's time scale has a wider range.
     if (timeScale < 600 || timeScale > 96000) {
-        LOGE("Time scale (%d) for movie is out of range [600, 96000]", timeScale);
+        ALOGE("Time scale (%d) for movie is out of range [600, 96000]", timeScale);
         return BAD_VALUE;
     }
     mMovieTimeScale = timeScale;
@@ -508,7 +508,7 @@
     // 60000 is chosen to make sure that each video frame from a 60-fps
     // video has 1000 ticks.
     if (timeScale < 600 || timeScale > 60000) {
-        LOGE("Time scale (%d) for video is out of range [600, 60000]", timeScale);
+        ALOGE("Time scale (%d) for video is out of range [600, 60000]", timeScale);
         return BAD_VALUE;
     }
     mVideoTimeScale = timeScale;
@@ -520,7 +520,7 @@
 
     // 96000 Hz is the highest sampling rate support in AAC.
     if (timeScale < 600 || timeScale > 96000) {
-        LOGE("Time scale (%d) for audio is out of range [600, 96000]", timeScale);
+        ALOGE("Time scale (%d) for audio is out of range [600, 96000]", timeScale);
         return BAD_VALUE;
     }
     mAudioTimeScale = timeScale;
@@ -545,7 +545,7 @@
 
     // Not allowing time more than a day
     if (timeUs <= 0 || timeUs > 86400*1E6) {
-        LOGE("Time between time lapse frame capture (%lld) is out of range [0, 1 Day]", timeUs);
+        ALOGE("Time between time lapse frame capture (%lld) is out of range [0, 1 Day]", timeUs);
         return BAD_VALUE;
     }
 
@@ -683,7 +683,7 @@
                     1000LL * timeBetweenTimeLapseFrameCaptureMs);
         }
     } else {
-        LOGE("setParameter: failed to find key %s", key.string());
+        ALOGE("setParameter: failed to find key %s", key.string());
     }
     return BAD_VALUE;
 }
@@ -695,13 +695,13 @@
     for (;;) {
         const char *equal_pos = strchr(key_start, '=');
         if (equal_pos == NULL) {
-            LOGE("Parameters %s miss a value", cparams);
+            ALOGE("Parameters %s miss a value", cparams);
             return BAD_VALUE;
         }
         String8 key(key_start, equal_pos - key_start);
         TrimString(&key);
         if (key.length() == 0) {
-            LOGE("Parameters %s contains an empty key", cparams);
+            ALOGE("Parameters %s contains an empty key", cparams);
             return BAD_VALUE;
         }
         const char *value_start = equal_pos + 1;
@@ -737,7 +737,7 @@
     CHECK(mOutputFd >= 0);
 
     if (mWriter != NULL) {
-        LOGE("File writer is not avaialble");
+        ALOGE("File writer is not avaialble");
         return UNKNOWN_ERROR;
     }
 
@@ -769,7 +769,7 @@
             break;
 
         default:
-            LOGE("Unsupported output file format: %d", mOutputFormat);
+            ALOGE("Unsupported output file format: %d", mOutputFormat);
             status = UNKNOWN_ERROR;
             break;
     }
@@ -801,7 +801,7 @@
     status_t err = audioSource->initCheck();
 
     if (err != OK) {
-        LOGE("audio source is not initialized");
+        ALOGE("audio source is not initialized");
         return NULL;
     }
 
@@ -819,7 +819,7 @@
             mime = MEDIA_MIMETYPE_AUDIO_AAC;
             break;
         default:
-            LOGE("Unknown audio encoder: %d", mAudioEncoder);
+            ALOGE("Unknown audio encoder: %d", mAudioEncoder);
             return NULL;
     }
     encMeta->setCString(kKeyMIMEType, mime);
@@ -872,13 +872,13 @@
     if (mOutputFormat == OUTPUT_FORMAT_AMR_NB) {
         if (mAudioEncoder != AUDIO_ENCODER_DEFAULT &&
             mAudioEncoder != AUDIO_ENCODER_AMR_NB) {
-            LOGE("Invalid encoder %d used for AMRNB recording",
+            ALOGE("Invalid encoder %d used for AMRNB recording",
                     mAudioEncoder);
             return BAD_VALUE;
         }
     } else {  // mOutputFormat must be OUTPUT_FORMAT_AMR_WB
         if (mAudioEncoder != AUDIO_ENCODER_AMR_WB) {
-            LOGE("Invlaid encoder %d used for AMRWB recording",
+            ALOGE("Invlaid encoder %d used for AMRWB recording",
                     mAudioEncoder);
             return BAD_VALUE;
         }
@@ -895,7 +895,7 @@
 
 status_t StagefrightRecorder::startRawAudioRecording() {
     if (mAudioSource >= AUDIO_SOURCE_CNT) {
-        LOGE("Invalid audio source: %d", mAudioSource);
+        ALOGE("Invalid audio source: %d", mAudioSource);
         return BAD_VALUE;
     }
 
@@ -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;
     }
@@ -1131,7 +1131,7 @@
         audioSampleRate == mSampleRate &&
         audioChannels == mAudioChannels) {
         if (videoCodec == VIDEO_ENCODER_H264) {
-            LOGI("Force to use AVC baseline profile");
+            ALOGI("Force to use AVC baseline profile");
             setParamVideoEncoderProfile(OMX_VIDEO_AVCProfileBaseline);
         }
     }
@@ -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;
     }
@@ -1268,7 +1268,7 @@
         int32_t frameRate = 0;
         CHECK (mSurfaceMediaSource->getFormat()->findInt32(
                                         kKeyFrameRate, &frameRate));
-        LOGI("Frame rate is not explicitly set. Use the current frame "
+        ALOGI("Frame rate is not explicitly set. Use the current frame "
              "rate (%d fps)", frameRate);
         mFrameRate = frameRate;
     } else {
@@ -1319,7 +1319,7 @@
         int32_t frameRate = 0;
         CHECK ((*cameraSource)->getFormat()->findInt32(
                     kKeyFrameRate, &frameRate));
-        LOGI("Frame rate is not explicitly set. Use the current frame "
+        ALOGI("Frame rate is not explicitly set. Use the current frame "
              "rate (%d fps)", frameRate);
         mFrameRate = frameRate;
     }
@@ -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.
@@ -1432,7 +1432,7 @@
             break;
 
         default:
-            LOGE("Unsupported audio encoder: %d", mAudioEncoder);
+            ALOGE("Unsupported audio encoder: %d", mAudioEncoder);
             return UNKNOWN_ERROR;
     }
 
@@ -1667,7 +1667,7 @@
     ALOGV("getMaxAmplitude");
 
     if (max == NULL) {
-        LOGE("Null pointer argument");
+        ALOGE("Null pointer argument");
         return BAD_VALUE;
     }
 
diff --git a/media/libmediaplayerservice/TestPlayerStub.cpp b/media/libmediaplayerservice/TestPlayerStub.cpp
index 169e49a..0f0ff65 100644
--- a/media/libmediaplayerservice/TestPlayerStub.cpp
+++ b/media/libmediaplayerservice/TestPlayerStub.cpp
@@ -134,7 +134,7 @@
     // None of the entry points should be NULL.
     mHandle = ::dlopen(mFilename, RTLD_NOW | RTLD_GLOBAL);
     if (!mHandle) {
-        LOGE("dlopen failed: %s", ::dlerror());
+        ALOGE("dlopen failed: %s", ::dlerror());
         resetInternal();
         return UNKNOWN_ERROR;
     }
@@ -147,7 +147,7 @@
     if (err || mNewPlayer == NULL) {
         // if err is NULL the string <null> is inserted in the logs =>
         // mNewPlayer was NULL.
-        LOGE("dlsym for newPlayer failed %s", err);
+        ALOGE("dlsym for newPlayer failed %s", err);
         resetInternal();
         return UNKNOWN_ERROR;
     }
@@ -156,7 +156,7 @@
                                                           "deletePlayer"));
     err = ::dlerror();
     if (err || mDeletePlayer == NULL) {
-        LOGE("dlsym for deletePlayer failed %s", err);
+        ALOGE("dlsym for deletePlayer failed %s", err);
         resetInternal();
         return UNKNOWN_ERROR;
     }
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
index 079f6fa..22b8847 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
@@ -111,9 +111,9 @@
             break;
         } else if (n < 0) {
             if (n != ERROR_END_OF_STREAM) {
-                LOGI("input data EOS reached, error %ld", n);
+                ALOGI("input data EOS reached, error %ld", n);
             } else {
-                LOGI("input data EOS reached.");
+                ALOGI("input data EOS reached.");
             }
             mTSParser->signalEOS(n);
             mFinalResult = n;
@@ -131,7 +131,7 @@
                 status_t err = mTSParser->feedTSPacket(buffer, sizeof(buffer));
 
                 if (err != OK) {
-                    LOGE("TS Parser returned error %d", err);
+                    ALOGE("TS Parser returned error %d", err);
                     mTSParser->signalEOS(err);
                     mFinalResult = err;
                     break;
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 03aa42e..b731d0f 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -383,7 +383,7 @@
 
                 finishFlushIfPossible();
             } else if (what == ACodec::kWhatError) {
-                LOGE("Received error from %s decoder, aborting playback.",
+                ALOGE("Received error from %s decoder, aborting playback.",
                      audio ? "audio" : "video");
 
                 mRenderer->queueEOS(audio, UNKNOWN_ERROR);
@@ -417,7 +417,7 @@
                 if (finalResult == ERROR_END_OF_STREAM) {
                     ALOGV("reached %s EOS", audio ? "audio" : "video");
                 } else {
-                    LOGE("%s track encountered an error (%d)",
+                    ALOGE("%s track encountered an error (%d)",
                          audio ? "audio" : "video", finalResult);
 
                     notifyListener(
@@ -689,7 +689,7 @@
 
                 bool timeChange = (type & ATSParser::DISCONTINUITY_TIME) != 0;
 
-                LOGI("%s discontinuity (formatChange=%d, time=%d)",
+                ALOGI("%s discontinuity (formatChange=%d, time=%d)",
                      audio ? "audio" : "video", formatChange, timeChange);
 
                 if (audio) {
@@ -705,7 +705,7 @@
                         int64_t resumeAtMediaTimeUs;
                         if (extra->findInt64(
                                     "resume-at-mediatimeUs", &resumeAtMediaTimeUs)) {
-                            LOGI("suppressing rendering of %s until %lld us",
+                            ALOGI("suppressing rendering of %s until %lld us",
                                     audio ? "audio" : "video", resumeAtMediaTimeUs);
 
                             if (audio) {
@@ -838,7 +838,7 @@
 
 void NuPlayer::flushDecoder(bool audio, bool needShutdown) {
     if ((audio && mAudioDecoder == NULL) || (!audio && mVideoDecoder == NULL)) {
-        LOGI("flushDecoder %s without decoder present",
+        ALOGI("flushDecoder %s without decoder present",
              audio ? "audio" : "video");
     }
 
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 3539e3f..15259cb 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -228,7 +228,7 @@
 
 #if 0
     if (numFramesAvailableToWrite == mAudioSink->frameCount()) {
-        LOGI("audio sink underrun");
+        ALOGI("audio sink underrun");
     } else {
         ALOGV("audio queue has %d frames left to play",
              mAudioSink->frameCount() - numFramesAvailableToWrite);
@@ -270,7 +270,7 @@
                     + numFramesPendingPlayout
                         * mAudioSink->msecsPerFrame()) * 1000ll;
 
-            // LOGI("realTimeOffsetUs = %lld us", realTimeOffsetUs);
+            // ALOGI("realTimeOffsetUs = %lld us", realTimeOffsetUs);
 
             mAnchorTimeRealUs =
                 ALooper::GetNowUs() + realTimeOffsetUs;
diff --git a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
index 6d28298..6eb0d07 100644
--- a/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/RTSPSource.cpp
@@ -226,7 +226,7 @@
             int32_t damaged;
             if (accessUnit->meta()->findInt32("damaged", &damaged)
                     && damaged) {
-                LOGI("dropping damaged access unit.");
+                ALOGI("dropping damaged access unit.");
                 break;
             }
 
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
index 2e63b3b..7c9bc5e 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
@@ -58,7 +58,7 @@
         ssize_t n = mStreamListener->read(buffer, sizeof(buffer), &extra);
 
         if (n == 0) {
-            LOGI("input data EOS reached.");
+            ALOGI("input data EOS reached.");
             mTSParser->signalEOS(ERROR_END_OF_STREAM);
             mFinalResult = ERROR_END_OF_STREAM;
             break;
@@ -70,7 +70,7 @@
                     && extra->findInt32(
                         IStreamListener::kKeyDiscontinuityMask, &mask)) {
                 if (mask == 0) {
-                    LOGE("Client specified an illegal discontinuity type.");
+                    ALOGE("Client specified an illegal discontinuity type.");
                     return ERROR_UNSUPPORTED;
                 }
 
@@ -94,7 +94,7 @@
                 status_t err = mTSParser->feedTSPacket(buffer, sizeof(buffer));
 
                 if (err != OK) {
-                    LOGE("TS Parser returned error %d", err);
+                    ALOGE("TS Parser returned error %d", err);
 
                     mTSParser->signalEOS(err);
                     mFinalResult = err;
diff --git a/media/libstagefright/AACWriter.cpp b/media/libstagefright/AACWriter.cpp
index 03fb33b..1673ccd 100644
--- a/media/libstagefright/AACWriter.cpp
+++ b/media/libstagefright/AACWriter.cpp
@@ -84,7 +84,7 @@
     }
 
     if (mSource != NULL) {
-        LOGE("AAC files only support a single track of audio.");
+        ALOGE("AAC files only support a single track of audio.");
         return UNKNOWN_ERROR;
     }
 
@@ -216,7 +216,7 @@
         }
     }
 
-    LOGE("Sampling rate %d bps is not supported", sampleRate);
+    ALOGE("Sampling rate %d bps is not supported", sampleRate);
     return false;
 }
 
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index ebf5fab..ca44ea3 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.");
             }
@@ -445,7 +445,7 @@
             def.format.video.eColorFormat);
 
     if (err != 0) {
-        LOGE("native_window_set_buffers_geometry failed: %s (%d)",
+        ALOGE("native_window_set_buffers_geometry failed: %s (%d)",
                 strerror(-err), -err);
         return err;
     }
@@ -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;
     }
@@ -464,7 +464,7 @@
             usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
 
     if (err != 0) {
-        LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
+        ALOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
         return err;
     }
 
@@ -474,7 +474,7 @@
             &minUndequeuedBufs);
 
     if (err != 0) {
-        LOGE("NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS query failed: %s (%d)",
+        ALOGE("NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS query failed: %s (%d)",
                 strerror(-err), -err);
         return err;
     }
@@ -489,7 +489,7 @@
                 mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));
 
         if (err != OK) {
-            LOGE("[%s] setting nBufferCountActual to %lu failed: %d",
+            ALOGE("[%s] setting nBufferCountActual to %lu failed: %d",
                     mComponentName.c_str(), newBufferCount, err);
             return err;
         }
@@ -499,7 +499,7 @@
             mNativeWindow.get(), def.nBufferCountActual);
 
     if (err != 0) {
-        LOGE("native_window_set_buffer_count failed: %s (%d)", strerror(-err),
+        ALOGE("native_window_set_buffer_count failed: %s (%d)", strerror(-err),
                 -err);
         return err;
     }
@@ -513,7 +513,7 @@
         ANativeWindowBuffer *buf;
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
         if (err != 0) {
-            LOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
+            ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
             break;
         }
 
@@ -528,7 +528,7 @@
         err = mOMX->useGraphicBuffer(mNode, kPortIndexOutput, graphicBuffer,
                 &bufferId);
         if (err != 0) {
-            LOGE("registering GraphicBuffer %lu with OMX IL component failed: "
+            ALOGE("registering GraphicBuffer %lu with OMX IL component failed: "
                  "%d", i, err);
             break;
         }
@@ -581,7 +581,7 @@
 ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() {
     ANativeWindowBuffer *buf;
     if (mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf) != 0) {
-        LOGE("dequeueBuffer failed.");
+        ALOGE("dequeueBuffer failed.");
         return NULL;
     }
 
@@ -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);
         }
     }
@@ -1367,7 +1367,7 @@
         return false;
     }
 
-    LOGE("[%s] ERROR(0x%08lx)", mCodec->mComponentName.c_str(), data1);
+    ALOGE("[%s] ERROR(0x%08lx)", mCodec->mComponentName.c_str(), data1);
 
     mCodec->signalError((OMX_ERRORTYPE)data1);
 
@@ -1826,7 +1826,7 @@
     }
 
     if (node == NULL) {
-        LOGE("Unable to instantiate a decoder for type '%s'.", mime.c_str());
+        ALOGE("Unable to instantiate a decoder for type '%s'.", mime.c_str());
 
         mCodec->signalError(OMX_ErrorComponentNotFound);
         return;
@@ -1874,7 +1874,7 @@
 
     status_t err;
     if ((err = allocateBuffers()) != OK) {
-        LOGE("Failed to allocate buffers after transitioning to IDLE state "
+        ALOGE("Failed to allocate buffers after transitioning to IDLE state "
              "(error 0x%08x)",
              err);
 
@@ -2198,7 +2198,7 @@
                 status_t err;
                 if ((err = mCodec->allocateBuffersOnPort(
                                 kPortIndexOutput)) != OK) {
-                    LOGE("Failed to allocate output port buffers after "
+                    ALOGE("Failed to allocate output port buffers after "
                          "port reconfiguration (error 0x%08x)",
                          err);
 
diff --git a/media/libstagefright/AMRExtractor.cpp b/media/libstagefright/AMRExtractor.cpp
index 7eca5e4..5a28347 100644
--- a/media/libstagefright/AMRExtractor.cpp
+++ b/media/libstagefright/AMRExtractor.cpp
@@ -85,7 +85,7 @@
     };
 
     if (FT > 15 || (isWide && FT > 9 && FT < 14) || (!isWide && FT > 11 && FT < 15)) {
-        LOGE("illegal AMR frame type %d", FT);
+        ALOGE("illegal AMR frame type %d", FT);
         return 0;
     }
 
@@ -285,7 +285,7 @@
     if (header & 0x83) {
         // Padding bits must be 0.
 
-        LOGE("padding bits must be 0, header is 0x%02x", header);
+        ALOGE("padding bits must be 0, header is 0x%02x", header);
 
         return ERROR_MALFORMED;
     }
diff --git a/media/libstagefright/AVIExtractor.cpp b/media/libstagefright/AVIExtractor.cpp
index 142fa5b..a3187b7 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]);
@@ -1080,7 +1080,7 @@
     sp<MetaData> meta = MakeAVCCodecSpecificData(buffer);
 
     if (meta == NULL) {
-        LOGE("Unable to extract AVC codec specific data");
+        ALOGE("Unable to extract AVC codec specific data");
         return ERROR_MALFORMED;
     }
 
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/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 6fb16f5..7a2d7b3 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -132,7 +132,7 @@
         status_t err = mNativeWindow->queueBuffer(
                 mNativeWindow.get(), buffer->graphicBuffer().get());
         if (err != 0) {
-            LOGE("queueBuffer failed with error %s (%d)", strerror(-err),
+            ALOGE("queueBuffer failed with error %s (%d)", strerror(-err),
                     -err);
             return;
         }
@@ -280,9 +280,9 @@
     }
 
     if (!(mFlags & INCOGNITO)) {
-        LOGI("setDataSource_l('%s')", mUri.string());
+        ALOGI("setDataSource_l('%s')", mUri.string());
     } else {
-        LOGI("setDataSource_l(URL suppressed)");
+        ALOGI("setDataSource_l(URL suppressed)");
     }
 
     // The actual work will be done during preparation in the call to
@@ -483,7 +483,7 @@
     if (mFlags & PREPARING) {
         modifyFlags(PREPARE_CANCELLED, SET);
         if (mConnectingDataSource != NULL) {
-            LOGI("interrupting the connection process");
+            ALOGI("interrupting the connection process");
             mConnectingDataSource->disconnect();
         }
 
@@ -686,7 +686,7 @@
 
                 if ((mFlags & PLAYING) && !eos
                         && (cachedDataRemaining < kLowWaterMarkBytes)) {
-                    LOGI("cache is running low (< %d) , pausing.",
+                    ALOGI("cache is running low (< %d) , pausing.",
                          kLowWaterMarkBytes);
                     modifyFlags(CACHE_UNDERRUN, SET);
                     pause_l();
@@ -695,7 +695,7 @@
                     notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
                 } else if (eos || cachedDataRemaining > kHighWaterMarkBytes) {
                     if (mFlags & CACHE_UNDERRUN) {
-                        LOGI("cache has filled up (> %d), resuming.",
+                        ALOGI("cache has filled up (> %d), resuming.",
                              kHighWaterMarkBytes);
                         modifyFlags(CACHE_UNDERRUN, CLEAR);
                         play_l();
@@ -742,7 +742,7 @@
 
         if ((mFlags & PLAYING) && !eos
                 && (cachedDurationUs < kLowWaterMarkUs)) {
-            LOGI("cache is running low (%.2f secs) , pausing.",
+            ALOGI("cache is running low (%.2f secs) , pausing.",
                  cachedDurationUs / 1E6);
             modifyFlags(CACHE_UNDERRUN, SET);
             pause_l();
@@ -751,7 +751,7 @@
             notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
         } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
             if (mFlags & CACHE_UNDERRUN) {
-                LOGI("cache has filled up (%.2f secs), resuming.",
+                ALOGI("cache has filled up (%.2f secs), resuming.",
                      cachedDurationUs / 1E6);
                 modifyFlags(CACHE_UNDERRUN, CLEAR);
                 play_l();
@@ -1192,7 +1192,7 @@
     status_t err = initVideoDecoder();
 
     if (err != OK) {
-        LOGE("failed to reinstantiate video decoder after surface change.");
+        ALOGE("failed to reinstantiate video decoder after surface change.");
         return err;
     }
 
@@ -1667,7 +1667,7 @@
 
     if (mSeeking == SEEK_VIDEO_ONLY) {
         if (mSeekTimeUs > timeUs) {
-            LOGI("XXX mSeekTimeUs = %lld us, timeUs = %lld us",
+            ALOGI("XXX mSeekTimeUs = %lld us, timeUs = %lld us",
                  mSeekTimeUs, timeUs);
         }
     }
@@ -1683,7 +1683,7 @@
     if (mAudioPlayer != NULL && !(mFlags & (AUDIO_RUNNING | SEEK_PREVIEW))) {
         status_t err = startAudioPlayer_l();
         if (err != OK) {
-            LOGE("Starting the audio player failed w/ err %d", err);
+            ALOGE("Starting the audio player failed w/ err %d", err);
             return;
         }
     }
@@ -1715,7 +1715,7 @@
         int64_t latenessUs = nowUs - timeUs;
 
         if (latenessUs > 0) {
-            LOGI("after SEEK_VIDEO_ONLY we're late by %.2f secs", latenessUs / 1E6);
+            ALOGI("after SEEK_VIDEO_ONLY we're late by %.2f secs", latenessUs / 1E6);
         }
     }
 
@@ -1730,7 +1730,7 @@
                 && mAudioPlayer != NULL
                 && mAudioPlayer->getMediaTimeMapping(
                     &realTimeUs, &mediaTimeUs)) {
-            LOGI("we're much too late (%.2f secs), video skipping ahead",
+            ALOGI("we're much too late (%.2f secs), video skipping ahead",
                  latenessUs / 1E6);
 
             mVideoBuffer->release();
@@ -1975,7 +1975,7 @@
         if (err != OK) {
             mConnectingDataSource.clear();
 
-            LOGI("mConnectingDataSource->connect() returned %d", err);
+            ALOGI("mConnectingDataSource->connect() returned %d", err);
             return err;
         }
 
@@ -2073,7 +2073,7 @@
             }
 
             if (mFlags & PREPARE_CANCELLED) {
-                LOGI("Prepare cancelled while waiting for initial cache fill.");
+                ALOGI("Prepare cancelled while waiting for initial cache fill.");
                 return UNKNOWN_ERROR;
             }
         }
@@ -2155,7 +2155,7 @@
     Mutex::Autolock autoLock(mLock);
 
     if (mFlags & PREPARE_CANCELLED) {
-        LOGI("prepare was cancelled before doing anything");
+        ALOGI("prepare was cancelled before doing anything");
         abortPrepare(UNKNOWN_ERROR);
         return;
     }
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 080faa6..1850c9c 100755
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -111,7 +111,7 @@
        return OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
     }
 
-    LOGE("Uknown color format (%s), please add it to "
+    ALOGE("Uknown color format (%s), please add it to "
          "CameraSource::getColorFormat", colorFormat);
 
     CHECK_EQ(0, "Unknown color format");
@@ -301,7 +301,7 @@
     bool isCameraParamChanged = false;
     if (width != -1 && height != -1) {
         if (!isVideoSizeSupported(width, height, sizes)) {
-            LOGE("Video dimension (%dx%d) is unsupported", width, height);
+            ALOGE("Video dimension (%dx%d) is unsupported", width, height);
             return BAD_VALUE;
         }
         if (isSetVideoSizeSupportedByCamera) {
@@ -314,7 +314,7 @@
                (width != -1 && height == -1)) {
         // If one and only one of the width and height is -1
         // we reject such a request.
-        LOGE("Requested video size (%dx%d) is not supported", width, height);
+        ALOGE("Requested video size (%dx%d) is not supported", width, height);
         return BAD_VALUE;
     } else {  // width == -1 && height == -1
         // Do not configure the camera.
@@ -330,7 +330,7 @@
         char buf[4];
         snprintf(buf, 4, "%d", frameRate);
         if (strstr(supportedFrameRates, buf) == NULL) {
-            LOGE("Requested frame rate (%d) is not supported: %s",
+            ALOGE("Requested frame rate (%d) is not supported: %s",
                 frameRate, supportedFrameRates);
             return BAD_VALUE;
         }
@@ -347,7 +347,7 @@
         // Either frame rate or frame size needs to be changed.
         String8 s = params->flatten();
         if (OK != mCamera->setParameters(s)) {
-            LOGE("Could not change settings."
+            ALOGE("Could not change settings."
                  " Someone else is using camera %p?", mCamera.get());
             return -EBUSY;
         }
@@ -387,7 +387,7 @@
         params.getVideoSize(&frameWidthActual, &frameHeightActual);
     }
     if (frameWidthActual < 0 || frameHeightActual < 0) {
-        LOGE("Failed to retrieve video frame size (%dx%d)",
+        ALOGE("Failed to retrieve video frame size (%dx%d)",
                 frameWidthActual, frameHeightActual);
         return UNKNOWN_ERROR;
     }
@@ -396,7 +396,7 @@
     // video frame size.
     if (width != -1 && height != -1) {
         if (frameWidthActual != width || frameHeightActual != height) {
-            LOGE("Failed to set video frame size to %dx%d. "
+            ALOGE("Failed to set video frame size to %dx%d. "
                     "The actual video size is %dx%d ", width, height,
                     frameWidthActual, frameHeightActual);
             return UNKNOWN_ERROR;
@@ -425,14 +425,14 @@
     ALOGV("checkFrameRate");
     int32_t frameRateActual = params.getPreviewFrameRate();
     if (frameRateActual < 0) {
-        LOGE("Failed to retrieve preview frame rate (%d)", frameRateActual);
+        ALOGE("Failed to retrieve preview frame rate (%d)", frameRateActual);
         return UNKNOWN_ERROR;
     }
 
     // Check the actual video frame rate against the target/requested
     // video frame rate.
     if (frameRate != -1 && (frameRateActual - frameRate) != 0) {
-        LOGE("Failed to set preview frame rate to %d fps. The actual "
+        ALOGE("Failed to set preview frame rate to %d fps. The actual "
                 "frame rate is %d", frameRate, frameRateActual);
         return UNKNOWN_ERROR;
     }
@@ -489,7 +489,7 @@
     status_t err = OK;
 
     if ((err = isCameraAvailable(camera, proxy, cameraId)) != OK) {
-        LOGE("Camera connection could not be established.");
+        ALOGE("Camera connection could not be established.");
         return err;
     }
     CameraParameters params(mCamera->getParameters());
@@ -579,7 +579,7 @@
     ALOGV("start");
     CHECK(!mStarted);
     if (mInitCheck != OK) {
-        LOGE("CameraSource is not initialized yet");
+        ALOGE("CameraSource is not initialized yet");
         return mInitCheck;
     }
 
@@ -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());
         }
     }
@@ -660,13 +660,13 @@
     }
 
     if (mCollectStats) {
-        LOGI("Frames received/encoded/dropped: %d/%d/%d in %lld us",
+        ALOGI("Frames received/encoded/dropped: %d/%d/%d in %lld us",
                 mNumFramesReceived, mNumFramesEncoded, mNumFramesDropped,
                 mLastFrameTimestampUs - mFirstFrameTimeUs);
     }
 
     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);
             }
         }
@@ -832,7 +832,7 @@
 }
 
 void CameraSource::DeathNotifier::binderDied(const wp<IBinder>& who) {
-    LOGI("Camera recording proxy died");
+    ALOGI("Camera recording proxy died");
 }
 
 }  // namespace android
diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp
index 22c3182..263ab50 100644
--- a/media/libstagefright/CameraSourceTimeLapse.cpp
+++ b/media/libstagefright/CameraSourceTimeLapse.cpp
@@ -140,7 +140,7 @@
         if (mCamera->setParameters(params.flatten()) == OK) {
             isSuccessful = true;
         } else {
-            LOGE("Failed to set preview size to %dx%d", width, height);
+            ALOGE("Failed to set preview size to %dx%d", width, height);
             isSuccessful = false;
         }
     }
@@ -260,7 +260,7 @@
 
             // Really make sure that this video recording frame will not be dropped.
             if (*timestampUs < mStartTimeUs) {
-                LOGI("set timestampUs to start time stamp %lld us", mStartTimeUs);
+                ALOGI("set timestampUs to start time stamp %lld us", mStartTimeUs);
                 *timestampUs = mStartTimeUs;
             }
             return false;
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..668d7f7 100644
--- a/media/libstagefright/FLACExtractor.cpp
+++ b/media/libstagefright/FLACExtractor.cpp
@@ -327,7 +327,7 @@
         mWriteCompleted = true;
         return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
     } else {
-        LOGE("FLACParser::writeCallback unexpected");
+        ALOGE("FLACParser::writeCallback unexpected");
         return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
     }
 }
@@ -340,7 +340,7 @@
             mStreamInfo = metadata->data.stream_info;
             mStreamInfoValid = true;
         } else {
-            LOGE("FLACParser::metadataCallback unexpected STREAMINFO");
+            ALOGE("FLACParser::metadataCallback unexpected STREAMINFO");
         }
         break;
     case FLAC__METADATA_TYPE_VORBIS_COMMENT:
@@ -366,14 +366,14 @@
         }
         break;
     default:
-        LOGW("FLACParser::metadataCallback unexpected type %u", metadata->type);
+        ALOGW("FLACParser::metadataCallback unexpected type %u", metadata->type);
         break;
     }
 }
 
 void FLACParser::errorCallback(FLAC__StreamDecoderErrorStatus status)
 {
-    LOGE("FLACParser::errorCallback status=%d", status);
+    ALOGE("FLACParser::errorCallback status=%d", status);
     mErrorStatus = status;
 }
 
@@ -477,7 +477,7 @@
         // The new should succeed, since probably all it does is a malloc
         // that always succeeds in Android.  But to avoid dependence on the
         // libFLAC internals, we check and log here.
-        LOGE("new failed");
+        ALOGE("new failed");
         return NO_INIT;
     }
     FLAC__stream_decoder_set_md5_checking(mDecoder, false);
@@ -497,12 +497,12 @@
     if (initStatus != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
         // A failure here probably indicates a programming error and so is
         // unlikely to happen. But we check and log here similarly to above.
-        LOGE("init_stream failed %d", initStatus);
+        ALOGE("init_stream failed %d", initStatus);
         return NO_INIT;
     }
     // parse all metadata
     if (!FLAC__stream_decoder_process_until_end_of_metadata(mDecoder)) {
-        LOGE("end_of_metadata failed");
+        ALOGE("end_of_metadata failed");
         return NO_INIT;
     }
     if (mStreamInfoValid) {
@@ -512,7 +512,7 @@
         case 2:
             break;
         default:
-            LOGE("unsupported channel count %u", getChannels());
+            ALOGE("unsupported channel count %u", getChannels());
             return NO_INIT;
         }
         // check bit depth
@@ -522,7 +522,7 @@
         case 24:
             break;
         default:
-            LOGE("unsupported bits per sample %u", getBitsPerSample());
+            ALOGE("unsupported bits per sample %u", getBitsPerSample());
             return NO_INIT;
         }
         // check sample rate
@@ -539,7 +539,7 @@
             break;
         default:
             // 96000 would require a proper downsampler in AudioFlinger
-            LOGE("unsupported sample rate %u", getSampleRate());
+            ALOGE("unsupported sample rate %u", getSampleRate());
             return NO_INIT;
         }
         // configure the appropriate copy function, defaulting to trespass
@@ -572,7 +572,7 @@
                     (getTotalSamples() * 1000000LL) / getSampleRate());
         }
     } else {
-        LOGE("missing STREAMINFO");
+        ALOGE("missing STREAMINFO");
         return NO_INIT;
     }
     if (mFileMetadata != 0) {
@@ -603,13 +603,13 @@
     if (doSeek) {
         // We implement the seek callback, so this works without explicit flush
         if (!FLAC__stream_decoder_seek_absolute(mDecoder, sample)) {
-            LOGE("FLACParser::readBuffer seek to sample %llu failed", sample);
+            ALOGE("FLACParser::readBuffer seek to sample %llu failed", sample);
             return NULL;
         }
         ALOGV("FLACParser::readBuffer seek to sample %llu succeeded", sample);
     } else {
         if (!FLAC__stream_decoder_process_single(mDecoder)) {
-            LOGE("FLACParser::readBuffer process_single failed");
+            ALOGE("FLACParser::readBuffer process_single failed");
             return NULL;
         }
     }
@@ -620,13 +620,13 @@
     // verify that block header keeps the promises made by STREAMINFO
     unsigned blocksize = mWriteHeader.blocksize;
     if (blocksize == 0 || blocksize > getMaxBlockSize()) {
-        LOGE("FLACParser::readBuffer write invalid blocksize %u", blocksize);
+        ALOGE("FLACParser::readBuffer write invalid blocksize %u", blocksize);
         return NULL;
     }
     if (mWriteHeader.sample_rate != getSampleRate() ||
         mWriteHeader.channels != getChannels() ||
         mWriteHeader.bits_per_sample != getBitsPerSample()) {
-        LOGE("FLACParser::readBuffer write changed parameters mid-stream");
+        ALOGE("FLACParser::readBuffer write changed parameters mid-stream");
     }
     // acquire a media buffer
     CHECK(mGroup != NULL);
diff --git a/media/libstagefright/FileSource.cpp b/media/libstagefright/FileSource.cpp
index 0794f57..73cb48c 100644
--- a/media/libstagefright/FileSource.cpp
+++ b/media/libstagefright/FileSource.cpp
@@ -101,7 +101,7 @@
    } else {
         off64_t result = lseek64(mFd, offset + mOffset, SEEK_SET);
         if (result == -1) {
-            LOGE("seek to %lld failed", offset + mOffset);
+            ALOGE("seek to %lld failed", offset + mOffset);
             return UNKNOWN_ERROR;
         }
 
diff --git a/media/libstagefright/HTTPBase.cpp b/media/libstagefright/HTTPBase.cpp
index 3c5a8a5..d7eea3f 100644
--- a/media/libstagefright/HTTPBase.cpp
+++ b/media/libstagefright/HTTPBase.cpp
@@ -111,11 +111,11 @@
     if (freqMs < kMinBandwidthCollectFreqMs
             || freqMs > kMaxBandwidthCollectFreqMs) {
 
-        LOGE("frequency (%d ms) is out of range [1000, 60000]", freqMs);
+        ALOGE("frequency (%d ms) is out of range [1000, 60000]", freqMs);
         return BAD_VALUE;
     }
 
-    LOGI("frequency set to %d ms", freqMs);
+    ALOGI("frequency set to %d ms", freqMs);
     mBandWidthCollectFreqMs = freqMs;
     return OK;
 }
@@ -139,7 +139,7 @@
 void HTTPBase::RegisterSocketUserTag(int sockfd, uid_t uid, uint32_t kTag) {
     int res = qtaguid_tagSocket(sockfd, kTag, uid);
     if (res != 0) {
-        LOGE("Failed tagging socket %d for uid %d (My UID=%d)", sockfd, uid, geteuid());
+        ALOGE("Failed tagging socket %d for uid %d (My UID=%d)", sockfd, uid, geteuid());
     }
 }
 
@@ -147,7 +147,7 @@
 void HTTPBase::UnRegisterSocketUserTag(int sockfd) {
     int res = qtaguid_untagSocket(sockfd);
     if (res != 0) {
-        LOGE("Failed untagging socket %d (My UID=%d)", sockfd, geteuid());
+        ALOGE("Failed untagging socket %d (My UID=%d)", sockfd, geteuid());
     }
 }
 
diff --git a/media/libstagefright/MP3Extractor.cpp b/media/libstagefright/MP3Extractor.cpp
index ab1dc5c..2215c07 100644
--- a/media/libstagefright/MP3Extractor.cpp
+++ b/media/libstagefright/MP3Extractor.cpp
@@ -431,7 +431,7 @@
             int32_t bitrate;
             if (!mMeta->findInt32(kKeyBitRate, &bitrate)) {
                 // bitrate is in bits/sec.
-                LOGI("no bitrate");
+                ALOGI("no bitrate");
 
                 return ERROR_UNSUPPORTED;
             }
@@ -487,7 +487,7 @@
 
         off64_t pos = mCurrentPos;
         if (!Resync(mDataSource, mFixedHeader, &pos, NULL, NULL)) {
-            LOGE("Unable to resync. Signalling end of stream.");
+            ALOGE("Unable to resync. Signalling end of stream.");
 
             buffer->release();
             buffer = NULL;
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 0a69df4..bc88015 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -1250,7 +1250,7 @@
             char buffer[23];
             if (chunk_data_size != 7 &&
                 chunk_data_size != 23) {
-                LOGE("Incorrect D263 box size %lld", chunk_data_size);
+                ALOGE("Incorrect D263 box size %lld", chunk_data_size);
                 return ERROR_MALFORMED;
             }
 
@@ -1500,9 +1500,9 @@
     int32_t dy = U32_AT(&buffer[matrixOffset + 20]);
 
 #if 0
-    LOGI("x' = %.2f * x + %.2f * y + %.2f",
+    ALOGI("x' = %.2f * x + %.2f * y + %.2f",
          a00 / 65536.0f, a01 / 65536.0f, dx / 65536.0f);
-    LOGI("y' = %.2f * x + %.2f * y + %.2f",
+    ALOGI("y' = %.2f * x + %.2f * y + %.2f",
          a10 / 65536.0f, a11 / 65536.0f, dy / 65536.0f);
 #endif
 
@@ -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;
     }
 
@@ -1751,7 +1751,7 @@
         // The media subtype is MP3 audio
         // Our software MP3 audio decoder may not be able to handle
         // packetized MP3 audio; for now, lets just return ERROR_UNSUPPORTED
-        LOGE("MP3 track in MP4/3GPP file is not supported");
+        ALOGE("MP3 track in MP4/3GPP file is not supported");
         return ERROR_UNSUPPORTED;
     }
 
@@ -2036,7 +2036,7 @@
         CHECK_EQ(OK, mSampleTable->getMetaDataForSample(
                     syncSampleIndex, NULL, NULL, &syncSampleTime));
 
-        LOGI("seek to time %lld us => sample at time %lld us, "
+        ALOGI("seek to time %lld us => sample at time %lld us, "
              "sync sample at time %lld us",
              seekTimeUs,
              sampleTime * 1000000ll / mTimescale,
@@ -2123,7 +2123,7 @@
 
         size_t nal_size = parseNALSize(src);
         if (mBuffer->range_length() < mNALLengthSize + nal_size) {
-            LOGE("incomplete NAL unit.");
+            ALOGE("incomplete NAL unit.");
 
             mBuffer->release();
             mBuffer = NULL;
@@ -2187,7 +2187,7 @@
                 }
 
                 if (isMalFormed) {
-                    LOGE("Video is malformed");
+                    ALOGE("Video is malformed");
                     mBuffer->release();
                     mBuffer = NULL;
                     return ERROR_MALFORMED;
@@ -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 a368e0a..06dd875 100755
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -327,7 +327,7 @@
 status_t MPEG4Writer::addSource(const sp<MediaSource> &source) {
     Mutex::Autolock l(mLock);
     if (mStarted) {
-        LOGE("Attempt to add source AFTER recording is started");
+        ALOGE("Attempt to add source AFTER recording is started");
         return UNKNOWN_ERROR;
     }
     Track *track = new Track(this, source, mTracks.size());
@@ -406,7 +406,7 @@
         size = MAX_MOOV_BOX_SIZE;
     }
 
-    LOGI("limits: %lld/%lld bytes/us, bit rate: %d bps and the estimated"
+    ALOGI("limits: %lld/%lld bytes/us, bit rate: %d bps and the estimated"
          " moov size %lld bytes",
          mMaxFileSizeLimitBytes, mMaxFileDurationLimitUs, bitRate, size);
     return factor * size;
@@ -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;
@@ -701,7 +701,7 @@
         mMoovBoxBuffer = NULL;
         mMoovBoxBufferOffset = 0;
     } else {
-        LOGI("The mp4 file will not be streamable.");
+        ALOGI("The mp4 file will not be streamable.");
     }
 
     CHECK(mBoxes.empty());
@@ -1084,12 +1084,12 @@
 }
 
 void MPEG4Writer::setStartTimestampUs(int64_t timeUs) {
-    LOGI("setStartTimestampUs: %lld", timeUs);
+    ALOGI("setStartTimestampUs: %lld", timeUs);
     CHECK(timeUs >= 0);
     Mutex::Autolock autoLock(mLock);
     if (mStartTimestampUs < 0 || mStartTimestampUs > timeUs) {
         mStartTimestampUs = timeUs;
-        LOGI("Earliest track starting time: %lld", mStartTimestampUs);
+        ALOGI("Earliest track starting time: %lld", mStartTimestampUs);
     }
 }
 
@@ -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);
@@ -1481,7 +1481,7 @@
             startTimeOffsetUs = kInitialDelayTimeUs;
         }
         startTimeUs += startTimeOffsetUs;
-        LOGI("Start time offset: %lld us", startTimeOffsetUs);
+        ALOGI("Start time offset: %lld us", startTimeOffsetUs);
     }
 
     meta->setInt64(kKeyTime, startTimeUs);
@@ -1525,7 +1525,7 @@
 status_t MPEG4Writer::Track::stop() {
     ALOGD("Stopping %s track", mIsAudio? "Audio": "Video");
     if (!mStarted) {
-        LOGE("Stop() called but track is not started");
+        ALOGE("Stop() called but track is not started");
         return ERROR_END_OF_STREAM;
     }
 
@@ -1596,14 +1596,14 @@
     const uint8_t *nextStartCode = findNextStartCode(data, length);
     *paramSetLen = nextStartCode - data;
     if (*paramSetLen == 0) {
-        LOGE("Param set is malformed, since its length is 0");
+        ALOGE("Param set is malformed, since its length is 0");
         return NULL;
     }
 
     AVCParamSet paramSet(*paramSetLen, data);
     if (type == kNalUnitTypeSeqParamSet) {
         if (*paramSetLen < 4) {
-            LOGE("Seq parameter set malformed");
+            ALOGE("Seq parameter set malformed");
             return NULL;
         }
         if (mSeqParamSets.empty()) {
@@ -1614,7 +1614,7 @@
             if (mProfileIdc != data[1] ||
                 mProfileCompatible != data[2] ||
                 mLevelIdc != data[3]) {
-                LOGE("Inconsistent profile/level found in seq parameter sets");
+                ALOGE("Inconsistent profile/level found in seq parameter sets");
                 return NULL;
             }
         }
@@ -1632,7 +1632,7 @@
     // 2 bytes for each of the parameter set length field
     // plus the 7 bytes for the header
     if (size < 4 + 7) {
-        LOGE("Codec specific data length too short: %d", size);
+        ALOGE("Codec specific data length too short: %d", size);
         return ERROR_MALFORMED;
     }
 
@@ -1661,7 +1661,7 @@
         getNalUnitType(*(tmp + 4), &type);
         if (type == kNalUnitTypeSeqParamSet) {
             if (gotPps) {
-                LOGE("SPS must come before PPS");
+                ALOGE("SPS must come before PPS");
                 return ERROR_MALFORMED;
             }
             if (!gotSps) {
@@ -1670,7 +1670,7 @@
             nextStartCode = parseParamSet(tmp + 4, bytesLeft - 4, type, &paramSetLen);
         } else if (type == kNalUnitTypePicParamSet) {
             if (!gotSps) {
-                LOGE("SPS must come before PPS");
+                ALOGE("SPS must come before PPS");
                 return ERROR_MALFORMED;
             }
             if (!gotPps) {
@@ -1678,7 +1678,7 @@
             }
             nextStartCode = parseParamSet(tmp + 4, bytesLeft - 4, type, &paramSetLen);
         } else {
-            LOGE("Only SPS and PPS Nal units are expected");
+            ALOGE("Only SPS and PPS Nal units are expected");
             return ERROR_MALFORMED;
         }
 
@@ -1696,12 +1696,12 @@
         // Check on the number of seq parameter sets
         size_t nSeqParamSets = mSeqParamSets.size();
         if (nSeqParamSets == 0) {
-            LOGE("Cound not find sequence parameter set");
+            ALOGE("Cound not find sequence parameter set");
             return ERROR_MALFORMED;
         }
 
         if (nSeqParamSets > 0x1F) {
-            LOGE("Too many seq parameter sets (%d) found", nSeqParamSets);
+            ALOGE("Too many seq parameter sets (%d) found", nSeqParamSets);
             return ERROR_MALFORMED;
         }
     }
@@ -1710,11 +1710,11 @@
         // Check on the number of pic parameter sets
         size_t nPicParamSets = mPicParamSets.size();
         if (nPicParamSets == 0) {
-            LOGE("Cound not find picture parameter set");
+            ALOGE("Cound not find picture parameter set");
             return ERROR_MALFORMED;
         }
         if (nPicParamSets > 0xFF) {
-            LOGE("Too many pic parameter sets (%d) found", nPicParamSets);
+            ALOGE("Too many pic parameter sets (%d) found", nPicParamSets);
             return ERROR_MALFORMED;
         }
     }
@@ -1727,7 +1727,7 @@
         // These profiles requires additional parameter set extensions
         if (mProfileIdc == 100 || mProfileIdc == 110 ||
             mProfileIdc == 122 || mProfileIdc == 144) {
-            LOGE("Sorry, no support for profile_idc: %d!", mProfileIdc);
+            ALOGE("Sorry, no support for profile_idc: %d!", mProfileIdc);
             return BAD_VALUE;
         }
     }
@@ -1739,12 +1739,12 @@
         const uint8_t *data, size_t size) {
 
     if (mCodecSpecificData != NULL) {
-        LOGE("Already have codec specific data");
+        ALOGE("Already have codec specific data");
         return ERROR_MALFORMED;
     }
 
     if (size < 4) {
-        LOGE("Codec specific data length too short: %d", size);
+        ALOGE("Codec specific data length too short: %d", size);
         return ERROR_MALFORMED;
     }
 
@@ -2146,10 +2146,10 @@
 
     sendTrackSummary(hasMultipleTracks);
 
-    LOGI("Received total/0-length (%d/%d) buffers and encoded %d frames. - %s",
+    ALOGI("Received total/0-length (%d/%d) buffers and encoded %d frames. - %s",
             count, nZeroLengthFrames, mNumSamples, mIsAudio? "audio": "video");
     if (mIsAudio) {
-        LOGI("Audio track drift time: %lld us", mOwner->getDriftTimeUs());
+        ALOGI("Audio track drift time: %lld us", mOwner->getDriftTimeUs());
     }
 
     if (err == ERROR_END_OF_STREAM) {
@@ -2160,12 +2160,12 @@
 
 bool MPEG4Writer::Track::isTrackMalFormed() const {
     if (mSampleSizes.empty()) {                      // no samples written
-        LOGE("The number of recorded samples is 0");
+        ALOGE("The number of recorded samples is 0");
         return true;
     }
 
     if (!mIsAudio && mNumStssTableEntries == 0) {  // no sync frames for video
-        LOGE("There are no sync frames for video track");
+        ALOGE("There are no sync frames for video track");
         return true;
     }
 
@@ -2308,13 +2308,13 @@
         !strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime)) {
         if (!mCodecSpecificData ||
             mCodecSpecificDataSize <= 0) {
-            LOGE("Missing codec specific data");
+            ALOGE("Missing codec specific data");
             return ERROR_MALFORMED;
         }
     } else {
         if (mCodecSpecificData ||
             mCodecSpecificDataSize > 0) {
-            LOGE("Unexepected codec specific data found");
+            ALOGE("Unexepected codec specific data found");
             return ERROR_MALFORMED;
         }
     }
@@ -2378,7 +2378,7 @@
     } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime)) {
         mOwner->beginBox("avc1");
     } else {
-        LOGE("Unknown mime type '%s'.", mime);
+        ALOGE("Unknown mime type '%s'.", mime);
         CHECK(!"should not be here, unknown mime type.");
     }
 
@@ -2432,7 +2432,7 @@
     } else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AAC, mime)) {
         fourcc = "mp4a";
     } else {
-        LOGE("Unknown mime type '%s'.", mime);
+        ALOGE("Unknown mime type '%s'.", mime);
         CHECK(!"should not be here, unknown mime type.");
     }
 
diff --git a/media/libstagefright/MediaBuffer.cpp b/media/libstagefright/MediaBuffer.cpp
index 0b14f1e..96271e4 100644
--- a/media/libstagefright/MediaBuffer.cpp
+++ b/media/libstagefright/MediaBuffer.cpp
@@ -135,7 +135,7 @@
 
 void MediaBuffer::set_range(size_t offset, size_t length) {
     if ((mGraphicBuffer == NULL) && (offset + length > mSize)) {
-        LOGE("offset = %d, length = %d, mSize = %d", offset, length, mSize);
+        ALOGE("offset = %d, length = %d, mSize = %d", offset, length, mSize);
     }
     CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize));
 
diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp
index 20d0632..249c298 100644
--- a/media/libstagefright/NuCachedSource2.cpp
+++ b/media/libstagefright/NuCachedSource2.cpp
@@ -302,7 +302,7 @@
             mNumRetriesLeft = 0;
             return;
         } else if (err != OK) {
-            LOGI("The attempt to reconnect failed, %d retries remaining",
+            ALOGI("The attempt to reconnect failed, %d retries remaining",
                  mNumRetriesLeft);
 
             return;
@@ -317,11 +317,11 @@
     Mutex::Autolock autoLock(mLock);
 
     if (n < 0) {
-        LOGE("source returned error %ld, %d retries left", n, mNumRetriesLeft);
+        ALOGE("source returned error %ld, %d retries left", n, mNumRetriesLeft);
         mFinalStatus = n;
         mCache->releasePage(page);
     } else if (n == 0) {
-        LOGI("ERROR_END_OF_STREAM");
+        ALOGI("ERROR_END_OF_STREAM");
 
         mNumRetriesLeft = 0;
         mFinalStatus = ERROR_END_OF_STREAM;
@@ -329,7 +329,7 @@
         mCache->releasePage(page);
     } else {
         if (mFinalStatus != OK) {
-            LOGI("retrying a previously failed read succeeded.");
+            ALOGI("retrying a previously failed read succeeded.");
         }
         mNumRetriesLeft = kMaxNumRetries;
         mFinalStatus = OK;
@@ -355,7 +355,7 @@
 
     if (mFetching || keepAlive) {
         if (keepAlive) {
-            LOGI("Keep alive");
+            ALOGI("Keep alive");
         }
 
         fetchInternal();
@@ -363,7 +363,7 @@
         mLastFetchTimeUs = ALooper::GetNowUs();
 
         if (mFetching && mCache->totalSize() >= mHighwaterThresholdBytes) {
-            LOGI("Cache full, done prefetching for now");
+            ALOGI("Cache full, done prefetching for now");
             mFetching = false;
 
             if (mDisconnectAtHighwatermark
@@ -448,7 +448,7 @@
     size_t actualBytes = mCache->releaseFromStart(maxBytes);
     mCacheOffset += actualBytes;
 
-    LOGI("restarting prefetcher, totalSize = %d", mCache->totalSize());
+    ALOGI("restarting prefetcher, totalSize = %d", mCache->totalSize());
     mFetching = true;
 }
 
@@ -584,7 +584,7 @@
         return OK;
     }
 
-    LOGI("new range: offset= %lld", offset);
+    ALOGI("new range: offset= %lld", offset);
 
     mCacheOffset = offset;
 
@@ -634,7 +634,7 @@
 
     if (sscanf(s, "%ld/%ld/%d",
                &lowwaterMarkKb, &highwaterMarkKb, &keepAliveSecs) != 3) {
-        LOGE("Failed to parse cache parameters from '%s'.", s);
+        ALOGE("Failed to parse cache parameters from '%s'.", s);
         return;
     }
 
@@ -651,7 +651,7 @@
     }
 
     if (mLowwaterThresholdBytes >= mHighwaterThresholdBytes) {
-        LOGE("Illegal low/highwater marks specified, reverting to defaults.");
+        ALOGE("Illegal low/highwater marks specified, reverting to defaults.");
 
         mLowwaterThresholdBytes = kDefaultLowWaterThreshold;
         mHighwaterThresholdBytes = kDefaultHighWaterThreshold;
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index f9f92d2..60d9bb7 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -179,9 +179,9 @@
 
 #undef OPTIONAL
 
-#define CODEC_LOGI(x, ...) LOGI("[%s] "x, mComponentName, ##__VA_ARGS__)
+#define CODEC_LOGI(x, ...) ALOGI("[%s] "x, mComponentName, ##__VA_ARGS__)
 #define CODEC_LOGV(x, ...) ALOGV("[%s] "x, mComponentName, ##__VA_ARGS__)
-#define CODEC_LOGE(x, ...) LOGE("[%s] "x, mComponentName, ##__VA_ARGS__)
+#define CODEC_LOGE(x, ...) ALOGE("[%s] "x, mComponentName, ##__VA_ARGS__)
 
 struct OMXCodecObserver : public BnOMXObserver {
     OMXCodecObserver() {
@@ -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);
 
@@ -625,7 +625,7 @@
             status_t err;
             if ((err = parseAVCCodecSpecificData(
                             data, size, &profile, &level)) != OK) {
-                LOGE("Malformed AVC codec specific data.");
+                ALOGE("Malformed AVC codec specific data.");
                 return err;
             }
 
@@ -639,7 +639,7 @@
                 // does not handle this gracefully and would clobber the heap
                 // and wreak havoc instead...
 
-                LOGE("Profile and/or level exceed the decoder's capabilities.");
+                ALOGE("Profile and/or level exceed the decoder's capabilities.");
                 return ERROR_UNSUPPORTED;
             }
         } else if (meta->findData(kKeyVorbisInfo, &type, &data, &size)) {
@@ -981,7 +981,7 @@
     } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_H263, mime)) {
         compressionFormat = OMX_VIDEO_CodingH263;
     } else {
-        LOGE("Not a supported video mime type: %s", mime);
+        ALOGE("Not a supported video mime type: %s", mime);
         CHECK(!"Should not be here. Not a supported video mime type.");
     }
 
@@ -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.
@@ -1375,7 +1375,7 @@
     } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_MPEG2, mime)) {
         compressionFormat = OMX_VIDEO_CodingMPEG2;
     } else {
-        LOGE("Not a supported video mime type: %s", mime);
+        ALOGE("Not a supported video mime type: %s", mime);
         CHECK(!"Should not be here. Not a supported video mime type.");
     }
 
@@ -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);
         }
     }
 }
@@ -1664,7 +1664,7 @@
     }
 
     if ((mFlags & kEnableGrallocUsageProtected) && portIndex == kPortIndexOutput) {
-        LOGE("protected output buffers must be stent to an ANativeWindow");
+        ALOGE("protected output buffers must be stent to an ANativeWindow");
         return PERMISSION_DENIED;
     }
 
@@ -1673,7 +1673,7 @@
             && portIndex == kPortIndexInput) {
         err = mOMX->storeMetaDataInBuffers(mNode, kPortIndexInput, OMX_TRUE);
         if (err != OK) {
-            LOGE("Storing meta data in video buffers is not supported");
+            ALOGE("Storing meta data in video buffers is not supported");
             return err;
         }
     }
@@ -1735,7 +1735,7 @@
         }
 
         if (err != OK) {
-            LOGE("allocate_buffer_with_backup failed");
+            ALOGE("allocate_buffer_with_backup failed");
             return err;
         }
 
@@ -1849,7 +1849,7 @@
             def.format.video.eColorFormat);
 
     if (err != 0) {
-        LOGE("native_window_set_buffers_geometry failed: %s (%d)",
+        ALOGE("native_window_set_buffers_geometry failed: %s (%d)",
                 strerror(-err), -err);
         return err;
     }
@@ -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;
     }
@@ -1881,11 +1881,11 @@
                 mNativeWindow.get(), NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER,
                 &queuesToNativeWindow);
         if (err != 0) {
-            LOGE("error authenticating native window: %d", err);
+            ALOGE("error authenticating native window: %d", err);
             return err;
         }
         if (queuesToNativeWindow != 1) {
-            LOGE("native window could not be authenticated");
+            ALOGE("native window could not be authenticated");
             return PERMISSION_DENIED;
         }
     }
@@ -1894,7 +1894,7 @@
     err = native_window_set_usage(
             mNativeWindow.get(), usage | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
     if (err != 0) {
-        LOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
+        ALOGE("native_window_set_usage failed: %s (%d)", strerror(-err), -err);
         return err;
     }
 
@@ -1902,7 +1902,7 @@
     err = mNativeWindow->query(mNativeWindow.get(),
             NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minUndequeuedBufs);
     if (err != 0) {
-        LOGE("NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS query failed: %s (%d)",
+        ALOGE("NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS query failed: %s (%d)",
                 strerror(-err), -err);
         return err;
     }
@@ -1925,7 +1925,7 @@
     err = native_window_set_buffer_count(
             mNativeWindow.get(), def.nBufferCountActual);
     if (err != 0) {
-        LOGE("native_window_set_buffer_count failed: %s (%d)", strerror(-err),
+        ALOGE("native_window_set_buffer_count failed: %s (%d)", strerror(-err),
                 -err);
         return err;
     }
@@ -1938,7 +1938,7 @@
         ANativeWindowBuffer* buf;
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &buf);
         if (err != 0) {
-            LOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
+            ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), -err);
             break;
         }
 
@@ -2052,7 +2052,7 @@
     err = native_window_api_disconnect(mNativeWindow.get(),
             NATIVE_WINDOW_API_MEDIA);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: api_disconnect failed: %s (%d)",
+        ALOGE("error pushing blank frames: api_disconnect failed: %s (%d)",
                 strerror(-err), -err);
         return err;
     }
@@ -2060,7 +2060,7 @@
     err = native_window_api_connect(mNativeWindow.get(),
             NATIVE_WINDOW_API_CPU);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: api_connect failed: %s (%d)",
+        ALOGE("error pushing blank frames: api_connect failed: %s (%d)",
                 strerror(-err), -err);
         return err;
     }
@@ -2068,7 +2068,7 @@
     err = native_window_set_scaling_mode(mNativeWindow.get(),
             NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: set_buffers_geometry failed: %s (%d)",
+        ALOGE("error pushing blank frames: set_buffers_geometry failed: %s (%d)",
                 strerror(-err), -err);
         goto error;
     }
@@ -2076,7 +2076,7 @@
     err = native_window_set_buffers_geometry(mNativeWindow.get(), 1, 1,
             HAL_PIXEL_FORMAT_RGBX_8888);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: set_buffers_geometry failed: %s (%d)",
+        ALOGE("error pushing blank frames: set_buffers_geometry failed: %s (%d)",
                 strerror(-err), -err);
         goto error;
     }
@@ -2084,7 +2084,7 @@
     err = native_window_set_usage(mNativeWindow.get(),
             GRALLOC_USAGE_SW_WRITE_OFTEN);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: set_usage failed: %s (%d)",
+        ALOGE("error pushing blank frames: set_usage failed: %s (%d)",
                 strerror(-err), -err);
         goto error;
     }
@@ -2092,7 +2092,7 @@
     err = mNativeWindow->query(mNativeWindow.get(),
             NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &minUndequeuedBufs);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: MIN_UNDEQUEUED_BUFFERS query "
+        ALOGE("error pushing blank frames: MIN_UNDEQUEUED_BUFFERS query "
                 "failed: %s (%d)", strerror(-err), -err);
         goto error;
     }
@@ -2100,7 +2100,7 @@
     numBufs = minUndequeuedBufs + 1;
     err = native_window_set_buffer_count(mNativeWindow.get(), numBufs);
     if (err != NO_ERROR) {
-        LOGE("error pushing blank frames: set_buffer_count failed: %s (%d)",
+        ALOGE("error pushing blank frames: set_buffer_count failed: %s (%d)",
                 strerror(-err), -err);
         goto error;
     }
@@ -2112,7 +2112,7 @@
     for (int i = 0; i < numBufs + 1; i++) {
         err = mNativeWindow->dequeueBuffer(mNativeWindow.get(), &anb);
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: dequeueBuffer failed: %s (%d)",
+            ALOGE("error pushing blank frames: dequeueBuffer failed: %s (%d)",
                     strerror(-err), -err);
             goto error;
         }
@@ -2121,7 +2121,7 @@
         err = mNativeWindow->lockBuffer(mNativeWindow.get(),
                 buf->getNativeBuffer());
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: lockBuffer failed: %s (%d)",
+            ALOGE("error pushing blank frames: lockBuffer failed: %s (%d)",
                     strerror(-err), -err);
             goto error;
         }
@@ -2130,7 +2130,7 @@
         uint32_t* img = NULL;
         err = buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img));
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: lock failed: %s (%d)",
+            ALOGE("error pushing blank frames: lock failed: %s (%d)",
                     strerror(-err), -err);
             goto error;
         }
@@ -2139,7 +2139,7 @@
 
         err = buf->unlock();
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: unlock failed: %s (%d)",
+            ALOGE("error pushing blank frames: unlock failed: %s (%d)",
                     strerror(-err), -err);
             goto error;
         }
@@ -2147,7 +2147,7 @@
         err = mNativeWindow->queueBuffer(mNativeWindow.get(),
                 buf->getNativeBuffer());
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: queueBuffer failed: %s (%d)",
+            ALOGE("error pushing blank frames: queueBuffer failed: %s (%d)",
                     strerror(-err), -err);
             goto error;
         }
@@ -2174,7 +2174,7 @@
         err = native_window_api_disconnect(mNativeWindow.get(),
                 NATIVE_WINDOW_API_CPU);
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: api_disconnect failed: %s (%d)",
+            ALOGE("error pushing blank frames: api_disconnect failed: %s (%d)",
                     strerror(-err), -err);
             return err;
         }
@@ -2182,7 +2182,7 @@
         err = native_window_api_connect(mNativeWindow.get(),
                 NATIVE_WINDOW_API_MEDIA);
         if (err != NO_ERROR) {
-            LOGE("error pushing blank frames: api_connect failed: %s (%d)",
+            ALOGE("error pushing blank frames: api_connect failed: %s (%d)",
                     strerror(-err), -err);
             return err;
         }
@@ -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/OggExtractor.cpp b/media/libstagefright/OggExtractor.cpp
index 5a68d79..73efc27 100644
--- a/media/libstagefright/OggExtractor.cpp
+++ b/media/libstagefright/OggExtractor.cpp
@@ -189,9 +189,9 @@
 #if 0
     int64_t timeUs;
     if (packet->meta_data()->findInt64(kKeyTime, &timeUs)) {
-        LOGI("found time = %lld us", timeUs);
+        ALOGI("found time = %lld us", timeUs);
     } else {
-        LOGI("NO time");
+        ALOGI("NO time");
     }
 #endif
 
@@ -777,7 +777,7 @@
         const char *comment = mVc.user_comments[i];
         size_t commentLength = mVc.comment_lengths[i];
         parseVorbisComment(mFileMeta, comment, commentLength);
-        //LOGI("comment #%d: '%s'", i + 1, mVc.user_comments[i]);
+        //ALOGI("comment #%d: '%s'", i + 1, mVc.user_comments[i]);
     }
 }
 
@@ -899,7 +899,7 @@
     uint8_t *flac = DecodeBase64((const char *)data, size, &flacSize);
 
     if (flac == NULL) {
-        LOGE("malformed base64 encoded data.");
+        ALOGE("malformed base64 encoded data.");
         return;
     }
 
diff --git a/media/libstagefright/SampleIterator.cpp b/media/libstagefright/SampleIterator.cpp
index 7b8e008..81ec5c1 100644
--- a/media/libstagefright/SampleIterator.cpp
+++ b/media/libstagefright/SampleIterator.cpp
@@ -77,7 +77,7 @@
     if (sampleIndex >= mStopChunkSampleIndex) {
         status_t err;
         if ((err = findChunkRange(sampleIndex)) != OK) {
-            LOGE("findChunkRange failed");
+            ALOGE("findChunkRange failed");
             return err;
         }
     }
@@ -93,7 +93,7 @@
 
         status_t err;
         if ((err = getChunkOffset(chunk, &mCurrentChunkOffset)) != OK) {
-            LOGE("getChunkOffset return error");
+            ALOGE("getChunkOffset return error");
             return err;
         }
 
@@ -107,7 +107,7 @@
             size_t sampleSize;
             if ((err = getSampleSizeDirect(
                             firstChunkSampleIndex + i, &sampleSize)) != OK) {
-                LOGE("getSampleSizeDirect return error");
+                ALOGE("getSampleSizeDirect return error");
                 return err;
             }
 
@@ -134,7 +134,7 @@
 
     status_t err;
     if ((err = findSampleTime(sampleIndex, &mCurrentSampleTime)) != OK) {
-        LOGE("findSampleTime return error");
+        ALOGE("findSampleTime return error");
         return err;
     }
 
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp
index 3e287fa..d9858d7 100644
--- a/media/libstagefright/SampleTable.cpp
+++ b/media/libstagefright/SampleTable.cpp
@@ -347,7 +347,7 @@
 
 status_t SampleTable::setCompositionTimeToSampleParams(
         off64_t data_offset, size_t data_size) {
-    LOGI("There are reordered frames present.");
+    ALOGI("There are reordered frames present.");
 
     if (mCompositionTimeDeltaEntries != NULL || data_size < 8) {
         return ERROR_MALFORMED;
@@ -634,7 +634,7 @@
     }
     if (left == mNumSyncSamples) {
         if (flags == kFlagAfter) {
-            LOGE("tried to find a sync frame after the last one: %d", left);
+            ALOGE("tried to find a sync frame after the last one: %d", left);
             return ERROR_OUT_OF_RANGE;
         }
         left = left - 1;
diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp
index 4345184..bd7a226 100644
--- a/media/libstagefright/StagefrightMediaScanner.cpp
+++ b/media/libstagefright/StagefrightMediaScanner.cpp
@@ -57,7 +57,7 @@
     // get the library configuration and do sanity check
     const S_EAS_LIB_CONFIG* pLibConfig = EAS_Config();
     if ((pLibConfig == NULL) || (LIB_VERSION != pLibConfig->libVersion)) {
-        LOGE("EAS library/header mismatch\n");
+        ALOGE("EAS library/header mismatch\n");
         return MEDIA_SCAN_RESULT_ERROR;
     }
     EAS_I32 temp;
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index 2634da0..43bfd9e 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;
     }
 
@@ -138,7 +138,7 @@
     if (seekMode < MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC ||
         seekMode > MediaSource::ReadOptions::SEEK_CLOSEST) {
 
-        LOGE("Unknown seek mode: %d", seekMode);
+        ALOGE("Unknown seek mode: %d", seekMode);
         return NULL;
     }
 
@@ -264,7 +264,7 @@
     decoder->stop();
 
     if (err != OK) {
-        LOGE("Colorconverter failed to convert frame.");
+        ALOGE("Colorconverter failed to convert frame.");
 
         delete frame;
         frame = NULL;
@@ -292,7 +292,7 @@
 
     int32_t drm = 0;
     if (fileMeta->findInt32(kKeyIsDRM, &drm) && drm != 0) {
-        LOGE("frame grab not allowed.");
+        ALOGE("frame grab not allowed.");
         return NULL;
     }
 
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 2f807d0..2233d1b 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -112,7 +112,7 @@
 status_t SurfaceMediaSource::setBufferCount(int bufferCount) {
     ALOGV("SurfaceMediaSource::setBufferCount");
     if (bufferCount > NUM_BUFFER_SLOTS) {
-        LOGE("setBufferCount: bufferCount is larger than the number of buffer slots");
+        ALOGE("setBufferCount: bufferCount is larger than the number of buffer slots");
         return BAD_VALUE;
     }
 
@@ -120,7 +120,7 @@
     // Error out if the user has dequeued buffers
     for (int i = 0 ; i < mBufferCount ; i++) {
         if (mSlots[i].mBufferState == BufferSlot::DEQUEUED) {
-            LOGE("setBufferCount: client owns some buffers");
+            ALOGE("setBufferCount: client owns some buffers");
             return INVALID_OPERATION;
         }
     }
@@ -155,7 +155,7 @@
     ALOGV("SurfaceMediaSource::requestBuffer");
     Mutex::Autolock lock(mMutex);
     if (slot < 0 || mBufferCount <= slot) {
-        LOGE("requestBuffer: slot index out of range [0, %d]: %d",
+        ALOGE("requestBuffer: slot index out of range [0, %d]: %d",
                 mBufferCount, slot);
         return BAD_VALUE;
     }
@@ -183,7 +183,7 @@
     // we might declare mHeight and mWidth and check against those here.
     if ((w != 0) || (h != 0)) {
         if ((w != mDefaultWidth) || (h != mDefaultHeight)) {
-            LOGE("dequeuebuffer: invalid buffer size! Req: %dx%d, Found: %dx%d",
+            ALOGE("dequeuebuffer: invalid buffer size! Req: %dx%d, Found: %dx%d",
                     mDefaultWidth, mDefaultHeight, w, h);
             return BAD_VALUE;
         }
@@ -284,7 +284,7 @@
             // than allowed.
             const int avail = mBufferCount - (dequeuedCount+1);
             if (avail < (MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode))) {
-                LOGE("dequeueBuffer: MIN_UNDEQUEUED_BUFFERS=%d exceeded (dequeued=%d)",
+                ALOGE("dequeueBuffer: MIN_UNDEQUEUED_BUFFERS=%d exceeded (dequeued=%d)",
                         MIN_UNDEQUEUED_BUFFERS-int(mSynchronousMode),
                         dequeuedCount);
                 return -EBUSY;
@@ -346,7 +346,7 @@
                     mGraphicBufferAlloc->createGraphicBuffer(
                                     w, h, format, usage, &error));
             if (graphicBuffer == 0) {
-                LOGE("dequeueBuffer: SurfaceComposer::createGraphicBuffer failed");
+                ALOGE("dequeueBuffer: SurfaceComposer::createGraphicBuffer failed");
                 return error;
             }
             if (updateFormat) {
@@ -363,13 +363,13 @@
 status_t SurfaceMediaSource::setSynchronousMode(bool enabled) {
     Mutex::Autolock lock(mMutex);
     if (mStopped) {
-        LOGE("setSynchronousMode: SurfaceMediaSource has been stopped!");
+        ALOGE("setSynchronousMode: SurfaceMediaSource has been stopped!");
         return NO_INIT;
     }
 
     if (!enabled) {
         // Async mode is not allowed
-        LOGE("SurfaceMediaSource can be used only synchronous mode!");
+        ALOGE("SurfaceMediaSource can be used only synchronous mode!");
         return INVALID_OPERATION;
     }
 
@@ -390,7 +390,7 @@
     Mutex::Autolock lock(mMutex);
 
     if (mStopped) {
-        LOGE("Connect: SurfaceMediaSource has been stopped!");
+        ALOGE("Connect: SurfaceMediaSource has been stopped!");
         return NO_INIT;
     }
 
@@ -431,7 +431,7 @@
     Mutex::Autolock lock(mMutex);
 
     if (mStopped) {
-        LOGE("disconnect: SurfaceMediaSoource is already stopped!");
+        ALOGE("disconnect: SurfaceMediaSoource is already stopped!");
         return NO_INIT;
     }
 
@@ -467,15 +467,15 @@
     *outTransform = 0;
 
     if (bufIndex < 0 || bufIndex >= mBufferCount) {
-        LOGE("queueBuffer: slot index out of range [0, %d]: %d",
+        ALOGE("queueBuffer: slot index out of range [0, %d]: %d",
                 mBufferCount, bufIndex);
         return -EINVAL;
     } else if (mSlots[bufIndex].mBufferState != BufferSlot::DEQUEUED) {
-        LOGE("queueBuffer: slot %d is not owned by the client (state=%d)",
+        ALOGE("queueBuffer: slot %d is not owned by the client (state=%d)",
                 bufIndex, mSlots[bufIndex].mBufferState);
         return -EINVAL;
     } else if (!mSlots[bufIndex].mRequestBufferCalled) {
-        LOGE("queueBuffer: slot %d was enqueued without requesting a "
+        ALOGE("queueBuffer: slot %d was enqueued without requesting a "
                 "buffer", bufIndex);
         return -EINVAL;
     }
@@ -561,11 +561,11 @@
     ALOGV("SurfaceMediaSource::cancelBuffer");
     Mutex::Autolock lock(mMutex);
     if (bufIndex < 0 || bufIndex >= mBufferCount) {
-        LOGE("cancelBuffer: slot index out of range [0, %d]: %d",
+        ALOGE("cancelBuffer: slot index out of range [0, %d]: %d",
                 mBufferCount, bufIndex);
         return;
     } else if (mSlots[bufIndex].mBufferState != BufferSlot::DEQUEUED) {
-        LOGE("cancelBuffer: slot %d is not owned by the client (state=%d)",
+        ALOGE("cancelBuffer: slot %d is not owned by the client (state=%d)",
                 bufIndex, mSlots[bufIndex].mBufferState);
         return;
     }
@@ -814,7 +814,7 @@
         new MediaBuffer(4 + sizeof(buffer_handle_t));
     char *data = (char *)tempBuffer->data();
     if (data == NULL) {
-        LOGE("Cannot allocate memory for metadata buffer!");
+        ALOGE("Cannot allocate memory for metadata buffer!");
         return;
     }
     OMX_U32 type = kMetadataBufferTypeGrallocSource;
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/VBRISeeker.cpp b/media/libstagefright/VBRISeeker.cpp
index ecff538..6ac5a83 100644
--- a/media/libstagefright/VBRISeeker.cpp
+++ b/media/libstagefright/VBRISeeker.cpp
@@ -120,7 +120,7 @@
     delete[] buffer;
     buffer = NULL;
 
-    LOGI("Found VBRI header.");
+    ALOGI("Found VBRI header.");
 
     return seeker;
 }
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index 26eda0c..2092cb6 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -53,7 +53,7 @@
         }
 
         if (gVendorLibHandle == NULL) {
-            LOGE("Failed to open libwvm.so");
+            ALOGE("Failed to open libwvm.so");
             return;
         }
     }
@@ -67,7 +67,7 @@
         mImpl = (*getInstanceFunc)(source);
         CHECK(mImpl != NULL);
     } else {
-        LOGE("Failed to locate GetInstance in libwvm.so");
+        ALOGE("Failed to locate GetInstance in libwvm.so");
     }
 }
 
diff --git a/media/libstagefright/avc_utils.cpp b/media/libstagefright/avc_utils.cpp
index 1ed9e57..65c1848 100644
--- a/media/libstagefright/avc_utils.cpp
+++ b/media/libstagefright/avc_utils.cpp
@@ -290,7 +290,7 @@
     memcpy(out, picParamSet->data(), picParamSet->size());
 
 #if 0
-    LOGI("AVC seq param set");
+    ALOGI("AVC seq param set");
     hexdump(seqParamSet->data(), seqParamSet->size());
 #endif
 
@@ -301,7 +301,7 @@
     meta->setInt32(kKeyWidth, width);
     meta->setInt32(kKeyHeight, height);
 
-    LOGI("found AVC codec config (%d x %d, %s-profile level %d.%d)",
+    ALOGI("found AVC codec config (%d x %d, %s-profile level %d.%d)",
          width, height, AVCProfileToString(profile), level / 10, level % 10);
 
     return meta;
diff --git a/media/libstagefright/codecs/aacdec/SoftAAC.cpp b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
index c408b2c..da9d280 100644
--- a/media/libstagefright/codecs/aacdec/SoftAAC.cpp
+++ b/media/libstagefright/codecs/aacdec/SoftAAC.cpp
@@ -116,7 +116,7 @@
 
     Int err = PVMP4AudioDecoderInitLibrary(mConfig, mDecoderBuf);
     if (err != MP4AUDEC_SUCCESS) {
-        LOGE("Failed to initialize MP4 audio decoder");
+        ALOGE("Failed to initialize MP4 audio decoder");
         return UNKNOWN_ERROR;
     }
 
@@ -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..2b8633d 100644
--- a/media/libstagefright/codecs/aacenc/AACEncoder.cpp
+++ b/media/libstagefright/codecs/aacenc/AACEncoder.cpp
@@ -53,7 +53,7 @@
     CHECK(mApiHandle);
 
     if (VO_ERR_NONE != voGetAACEncAPI(mApiHandle)) {
-        LOGE("Failed to get api handle");
+        ALOGE("Failed to get api handle");
         return UNKNOWN_ERROR;
     }
 
@@ -70,11 +70,11 @@
     userData.memflag = VO_IMF_USERMEMOPERATOR;
     userData.memData = (VO_PTR) mMemOperator;
     if (VO_ERR_NONE != mApiHandle->Init(&mEncoderHandle, VO_AUDIO_CodingAAC, &userData)) {
-        LOGE("Failed to init AAC encoder");
+        ALOGE("Failed to init AAC encoder");
         return UNKNOWN_ERROR;
     }
     if (OK != setAudioSpecificConfigData()) {
-        LOGE("Failed to configure AAC encoder");
+        ALOGE("Failed to configure AAC encoder");
         return UNKNOWN_ERROR;
     }
 
@@ -86,7 +86,7 @@
     params.nChannels = mChannels;
     params.adtsUsed = 0;  // We add adts header in the file writer if needed.
     if (VO_ERR_NONE != mApiHandle->SetParam(mEncoderHandle, VO_PID_AAC_ENCPARAM,  &params)) {
-        LOGE("Failed to set AAC encoder parameters");
+        ALOGE("Failed to set AAC encoder parameters");
         return UNKNOWN_ERROR;
     }
 
@@ -106,7 +106,7 @@
         }
     }
 
-    LOGE("Sampling rate %d bps is not supported", sampleRate);
+    ALOGE("Sampling rate %d bps is not supported", sampleRate);
     return UNKNOWN_ERROR;
 }
 
@@ -117,7 +117,7 @@
     int32_t index;
     CHECK_EQ(OK, getSampleRateTableIndex(mSampleRate, index));
     if (mChannels > 2 || mChannels <= 0) {
-        LOGE("Unsupported number of channels(%d)", mChannels);
+        ALOGE("Unsupported number of channels(%d)", mChannels);
         return UNKNOWN_ERROR;
     }
 
@@ -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;
     }
 
@@ -153,7 +153,7 @@
 
     status_t err = mSource->start(params);
     if (err != OK) {
-         LOGE("AudioSource is not available");
+         ALOGE("AudioSource is not available");
         return err;
     }
 
@@ -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/dec/SoftAMR.cpp b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp
index c0a588f..7602f2d 100644
--- a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp
+++ b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp
@@ -304,7 +304,7 @@
                   MIME_IETF);
 
             if (numBytesRead == -1) {
-                LOGE("PV AMR decoder AMRDecode() call failed");
+                ALOGE("PV AMR decoder AMRDecode() call failed");
 
                 notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
                 mSignalledError = true;
diff --git a/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp b/media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp
index d361ef4..3afbc4f 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;
     }
 
@@ -84,7 +84,7 @@
 
     status_t err = mSource->start(params);
     if (err != OK) {
-        LOGE("AudioSource is not available");
+        ALOGE("AudioSource is not available");
         return err;
     }
 
@@ -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..60b1163 100644
--- a/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
+++ b/media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp
@@ -80,7 +80,7 @@
     CHECK(mApiHandle);
 
     if (VO_ERR_NONE != voGetAMRWBEncAPI(mApiHandle)) {
-        LOGE("Failed to get api handle");
+        ALOGE("Failed to get api handle");
         return UNKNOWN_ERROR;
     }
 
@@ -97,20 +97,20 @@
     userData.memflag = VO_IMF_USERMEMOPERATOR;
     userData.memData = (VO_PTR) mMemOperator;
     if (VO_ERR_NONE != mApiHandle->Init(&mEncoderHandle, VO_AUDIO_CodingAMRWB, &userData)) {
-        LOGE("Failed to init AMRWB encoder");
+        ALOGE("Failed to init AMRWB encoder");
         return UNKNOWN_ERROR;
     }
 
     // Configure AMRWB encoder$
     VOAMRWBMODE mode = pickModeFromBitRate(mBitRate);
     if (VO_ERR_NONE != mApiHandle->SetParam(mEncoderHandle, VO_PID_AMRWB_MODE,  &mode)) {
-        LOGE("Failed to set AMRWB encoder mode to %d", mode);
+        ALOGE("Failed to set AMRWB encoder mode to %d", mode);
         return UNKNOWN_ERROR;
     }
 
     VOAMRWBFRAMETYPE type = VOAMRWB_RFC3267;
     if (VO_ERR_NONE != mApiHandle->SetParam(mEncoderHandle, VO_PID_AMRWB_FRAMETYPE, &type)) {
-        LOGE("Failed to set AMRWB encoder frame type to %d", type);
+        ALOGE("Failed to set AMRWB encoder frame type to %d", type);
         return UNKNOWN_ERROR;
     }
 
@@ -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;
     }
 
@@ -140,7 +140,7 @@
 
     status_t err = mSource->start(params);
     if (err != OK) {
-        LOGE("AudioSource is not available");
+        ALOGE("AudioSource is not available");
         return err;
     }
     mStarted = true;
@@ -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 18c5550..e202a2b 100644
--- a/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp
+++ b/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp
@@ -41,7 +41,7 @@
             *pvProfile = AVC_BASELINE;
             return OK;
         default:
-            LOGE("Unsupported omx profile: %d", omxProfile);
+            ALOGE("Unsupported omx profile: %d", omxProfile);
     }
     return BAD_VALUE;
 }
@@ -100,7 +100,7 @@
             level = AVC_LEVEL5_1;
             break;
         default:
-            LOGE("Unknown omx level: %d", omxLevel);
+            ALOGE("Unknown omx level: %d", omxLevel);
             return BAD_VALUE;
     }
     *pvLevel = level;
@@ -178,7 +178,7 @@
       mInputFrameData(NULL),
       mGroup(NULL) {
 
-    LOGI("Construct software AVCEncoder");
+    ALOGI("Construct software AVCEncoder");
 
     mHandle = new tagAVCHandle;
     memset(mHandle, 0, sizeof(tagAVCHandle));
@@ -214,7 +214,7 @@
     CHECK(meta->findInt32(kKeyColorFormat, &mVideoColorFormat));
     if (mVideoColorFormat != OMX_COLOR_FormatYUV420Planar) {
         if (mVideoColorFormat != OMX_COLOR_FormatYUV420SemiPlanar) {
-            LOGE("Color format %d is not supported", mVideoColorFormat);
+            ALOGE("Color format %d is not supported", mVideoColorFormat);
             return BAD_VALUE;
         }
         // Allocate spare buffer only when color conversion is needed.
@@ -226,7 +226,7 @@
 
     // XXX: Remove this restriction
     if (mVideoWidth % 16 != 0 || mVideoHeight % 16 != 0) {
-        LOGE("Video frame size %dx%d must be a multiple of 16",
+        ALOGE("Video frame size %dx%d must be a multiple of 16",
             mVideoWidth, mVideoHeight);
         return BAD_VALUE;
     }
@@ -336,14 +336,14 @@
     }
 
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
     AVCEnc_Status err;
     err = PVAVCEncInitialize(mHandle, mEncParams, NULL, NULL);
     if (err != AVCENC_SUCCESS) {
-        LOGE("Failed to initialize the encoder: %d", err);
+        ALOGE("Failed to initialize the encoder: %d", err);
         return UNKNOWN_ERROR;
     }
 
@@ -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;
     }
 
@@ -461,7 +461,7 @@
                     *out = outputBuffer;
                     return OK;
                 default:
-                    LOGE("Nal type (%d) other than SPS/PPS is unexpected", type);
+                    ALOGE("Nal type (%d) other than SPS/PPS is unexpected", type);
                     return UNKNOWN_ERROR;
             }
         }
@@ -476,7 +476,7 @@
         status_t err = mSource->read(&mInputBuffer, options);
         if (err != OK) {
             if (err != ERROR_END_OF_STREAM) {
-                LOGE("Failed to read input video frame: %d", err);
+                ALOGE("Failed to read input video frame: %d", err);
             }
             outputBuffer->release();
             return err;
diff --git a/media/libstagefright/codecs/g711/dec/SoftG711.cpp b/media/libstagefright/codecs/g711/dec/SoftG711.cpp
index 15e2c26..32ef003 100644
--- a/media/libstagefright/codecs/g711/dec/SoftG711.cpp
+++ b/media/libstagefright/codecs/g711/dec/SoftG711.cpp
@@ -210,7 +210,7 @@
         }
 
         if (inHeader->nFilledLen > kMaxNumSamplesPerFrame) {
-            LOGE("input buffer too large (%ld).", inHeader->nFilledLen);
+            ALOGE("input buffer too large (%ld).", inHeader->nFilledLen);
 
             notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
             mSignalledError = true;
diff --git a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
index bedfc58..a34a0ca 100644
--- a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
+++ b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp
@@ -207,7 +207,7 @@
                     (OMX_VIDEO_PARAM_PROFILELEVELTYPE *) params;
 
             if (profileLevel->nPortIndex != 0) {  // Input port only
-                LOGE("Invalid port index: %ld", profileLevel->nPortIndex);
+                ALOGE("Invalid port index: %ld", profileLevel->nPortIndex);
                 return OMX_ErrorUnsupportedIndex;
             }
 
@@ -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;
@@ -430,7 +430,7 @@
                     mHandle, &bitstream, &timestamp, &tmp,
                     &useExtTimestamp,
                     outHeader->pBuffer) != PV_TRUE) {
-            LOGE("failed to decode video frame.");
+            ALOGE("failed to decode video frame.");
 
             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 2e3d12d..d538603 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp
@@ -43,16 +43,16 @@
         switch (omxProfile) {
             case OMX_VIDEO_H263ProfileBaseline:
                 if (omxLevel > OMX_VIDEO_H263Level45) {
-                    LOGE("Unsupported level (%d) for H263", omxLevel);
+                    ALOGE("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;
                 }
                 break;
             default:
-                LOGE("Unsupported profile (%d) for H263", omxProfile);
+                ALOGE("Unsupported profile (%d) for H263", omxProfile);
                 return BAD_VALUE;
         }
     } else {  // MPEG4
@@ -72,7 +72,7 @@
                         profileLevel = SIMPLE_PROFILE_LEVEL3;
                         break;
                     default:
-                        LOGE("Unsupported level (%d) for MPEG4 simple profile",
+                        ALOGE("Unsupported level (%d) for MPEG4 simple profile",
                             omxLevel);
                         return BAD_VALUE;
                 }
@@ -89,7 +89,7 @@
                         profileLevel = SIMPLE_SCALABLE_PROFILE_LEVEL2;
                         break;
                     default:
-                        LOGE("Unsupported level (%d) for MPEG4 simple "
+                        ALOGE("Unsupported level (%d) for MPEG4 simple "
                              "scalable profile", omxLevel);
                         return BAD_VALUE;
                 }
@@ -103,7 +103,7 @@
                         profileLevel = CORE_PROFILE_LEVEL2;
                         break;
                     default:
-                        LOGE("Unsupported level (%d) for MPEG4 core "
+                        ALOGE("Unsupported level (%d) for MPEG4 core "
                              "profile", omxLevel);
                         return BAD_VALUE;
                 }
@@ -120,13 +120,13 @@
                         profileLevel = CORE_SCALABLE_PROFILE_LEVEL3;
                         break;
                     default:
-                        LOGE("Unsupported level (%d) for MPEG4 core "
+                        ALOGE("Unsupported level (%d) for MPEG4 core "
                              "scalable profile", omxLevel);
                         return BAD_VALUE;
                 }
                 break;
             default:
-                LOGE("Unsupported MPEG4 profile (%d)", omxProfile);
+                ALOGE("Unsupported MPEG4 profile (%d)", omxProfile);
                 return BAD_VALUE;
         }
     }
@@ -178,7 +178,7 @@
       mInputFrameData(NULL),
       mGroup(NULL) {
 
-    LOGI("Construct software M4vH263Encoder");
+    ALOGI("Construct software M4vH263Encoder");
 
     mHandle = new tagvideoEncControls;
     memset(mHandle, 0, sizeof(tagvideoEncControls));
@@ -207,7 +207,7 @@
     CHECK(meta->findInt32(kKeyColorFormat, &mVideoColorFormat));
     if (mVideoColorFormat != OMX_COLOR_FormatYUV420Planar) {
         if (mVideoColorFormat != OMX_COLOR_FormatYUV420SemiPlanar) {
-            LOGE("Color format %d is not supported", mVideoColorFormat);
+            ALOGE("Color format %d is not supported", mVideoColorFormat);
             return BAD_VALUE;
         }
         // Allocate spare buffer only when color conversion is needed.
@@ -219,7 +219,7 @@
 
     // XXX: Remove this restriction
     if (mVideoWidth % 16 != 0 || mVideoHeight % 16 != 0) {
-        LOGE("Video frame size %dx%d must be a multiple of 16",
+        ALOGE("Video frame size %dx%d must be a multiple of 16",
             mVideoWidth, mVideoHeight);
         return BAD_VALUE;
     }
@@ -227,7 +227,7 @@
     mEncParams = new tagvideoEncOptions;
     memset(mEncParams, 0, sizeof(tagvideoEncOptions));
     if (!PVGetDefaultEncOption(mEncParams, 0)) {
-        LOGE("Failed to get default encoding parameters");
+        ALOGE("Failed to get default encoding parameters");
         return BAD_VALUE;
     }
 
@@ -314,12 +314,12 @@
     }
 
     if (mStarted) {
-        LOGW("Call start() when encoder already started");
+        ALOGW("Call start() when encoder already started");
         return OK;
     }
 
     if (!PVInitVideoEncoder(mHandle, mEncParams)) {
-        LOGE("Failed to initialize the encoder");
+        ALOGE("Failed to initialize the encoder");
         return UNKNOWN_ERROR;
     }
 
@@ -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;
     }
 
@@ -386,7 +386,7 @@
     // Output codec specific data
     if (mNumInputFrames < 0) {
         if (!PVGetVolHeader(mHandle, outPtr, &dataLength, 0)) {
-            LOGE("Failed to get VOL header");
+            ALOGE("Failed to get VOL header");
             return UNKNOWN_ERROR;
         }
         ALOGV("Output VOL header: %d bytes", dataLength);
@@ -401,7 +401,7 @@
     status_t err = mSource->read(&mInputBuffer, options);
     if (OK != err) {
         if (err != ERROR_END_OF_STREAM) {
-            LOGE("Failed to read from data source");
+            ALOGE("Failed to read from data source");
         }
         outputBuffer->release();
         return err;
@@ -460,7 +460,7 @@
     if (!PVEncodeVideoFrame(mHandle, &vin, &vout,
             &modTimeMs, outPtr, &dataLength, &nLayer) ||
         !PVGetHintTrack(mHandle, &hintTrack)) {
-        LOGE("Failed to encode frame or get hink track at frame %lld",
+        ALOGE("Failed to encode frame or get hink track at frame %lld",
             mNumInputFrames);
         outputBuffer->release();
         mInputBuffer->release();
diff --git a/media/libstagefright/codecs/mp3dec/SoftMP3.cpp b/media/libstagefright/codecs/mp3dec/SoftMP3.cpp
index 43fb30a..ad55295 100644
--- a/media/libstagefright/codecs/mp3dec/SoftMP3.cpp
+++ b/media/libstagefright/codecs/mp3dec/SoftMP3.cpp
@@ -223,10 +223,10 @@
 
             if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR ||
                     mConfig->outputFrameSize == 0) {
-                LOGE("mp3 decoder returned error %d", decoderErr);
+                ALOGE("mp3 decoder returned error %d", decoderErr);
 
                 if (mConfig->outputFrameSize == 0) {
-                    LOGE("Output frame size is 0");
+                    ALOGE("Output frame size is 0");
                 }
 
                 notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL);
diff --git a/media/libstagefright/codecs/on2/dec/SoftVPX.cpp b/media/libstagefright/codecs/on2/dec/SoftVPX.cpp
index c5fe199..bf9ab3a 100644
--- a/media/libstagefright/codecs/on2/dec/SoftVPX.cpp
+++ b/media/libstagefright/codecs/on2/dec/SoftVPX.cpp
@@ -138,7 +138,7 @@
     cfg.threads = GetCPUCoreCount();
     if ((vpx_err = vpx_codec_dec_init(
                 (vpx_codec_ctx_t *)mCtx, &vpx_codec_vp8_dx_algo, &cfg, 0))) {
-        LOGE("on2 decoder failed to initialize. (%d)", vpx_err);
+        ALOGE("on2 decoder failed to initialize. (%d)", vpx_err);
         return UNKNOWN_ERROR;
     }
 
@@ -254,7 +254,7 @@
                     inHeader->nFilledLen,
                     NULL,
                     0)) {
-            LOGE("on2 decoder failed to decode frame.");
+            ALOGE("on2 decoder failed to decode frame.");
 
             notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
             return;
diff --git a/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp b/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
index dede3ac..6c3f834 100644
--- a/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
+++ b/media/libstagefright/codecs/on2/h264dec/SoftAVC.cpp
@@ -204,7 +204,7 @@
                     (OMX_VIDEO_PARAM_PROFILELEVELTYPE *) params;
 
             if (profileLevel->nPortIndex != kInputPortIndex) {
-                LOGE("Invalid port index: %ld", profileLevel->nPortIndex);
+                ALOGE("Invalid port index: %ld", profileLevel->nPortIndex);
                 return OMX_ErrorUnsupportedIndex;
             }
 
@@ -371,7 +371,7 @@
                 }
                 inPicture.dataLen = 0;
                 if (ret < 0) {
-                    LOGE("Decoder failed: %d", ret);
+                    ALOGE("Decoder failed: %d", ret);
 
                     notify(OMX_EventError, OMX_ErrorUndefined,
                            ERROR_MALFORMED, NULL);
diff --git a/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp b/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
index 47dbd5c..ac88107 100644
--- a/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
+++ b/media/libstagefright/codecs/vorbis/dec/SoftVorbis.cpp
@@ -353,14 +353,14 @@
 
         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,
                     kMaxNumSamplesPerBuffer);
 
             if (numFrames < 0) {
-                LOGE("vorbis_dsp_pcmout returned %d", numFrames);
+                ALOGE("vorbis_dsp_pcmout returned %d", numFrames);
                 numFrames = 0;
             }
         }
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/foundation/AMessage.cpp b/media/libstagefright/foundation/AMessage.cpp
index f039bc1..0a6776e 100644
--- a/media/libstagefright/foundation/AMessage.cpp
+++ b/media/libstagefright/foundation/AMessage.cpp
@@ -471,7 +471,7 @@
 
             default:
             {
-                LOGE("This type of object cannot cross process boundaries.");
+                ALOGE("This type of object cannot cross process boundaries.");
                 TRESPASS();
             }
         }
@@ -535,7 +535,7 @@
 
             default:
             {
-                LOGE("This type of object cannot cross process boundaries.");
+                ALOGE("This type of object cannot cross process boundaries.");
                 TRESPASS();
             }
         }
diff --git a/media/libstagefright/foundation/hexdump.cpp b/media/libstagefright/foundation/hexdump.cpp
index 9f6bf9e..16c1ca5 100644
--- a/media/libstagefright/foundation/hexdump.cpp
+++ b/media/libstagefright/foundation/hexdump.cpp
@@ -67,7 +67,7 @@
             }
         }
 
-        LOGI("%s", line.c_str());
+        ALOGI("%s", line.c_str());
 
         offset += 16;
     }
diff --git a/media/libstagefright/httplive/LiveDataSource.cpp b/media/libstagefright/httplive/LiveDataSource.cpp
index 5f5c6d4..7560642 100644
--- a/media/libstagefright/httplive/LiveDataSource.cpp
+++ b/media/libstagefright/httplive/LiveDataSource.cpp
@@ -59,7 +59,7 @@
     Mutex::Autolock autoLock(mLock);
 
     if (offset != mOffset) {
-        LOGE("Attempt at reading non-sequentially from LiveDataSource.");
+        ALOGE("Attempt at reading non-sequentially from LiveDataSource.");
         return -EPIPE;
     }
 
@@ -89,7 +89,7 @@
 
 ssize_t LiveDataSource::readAt_l(off64_t offset, void *data, size_t size) {
     if (offset != mOffset) {
-        LOGE("Attempt at reading non-sequentially from LiveDataSource.");
+        ALOGE("Attempt at reading non-sequentially from LiveDataSource.");
         return -EPIPE;
     }
 
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 6f4b875..0cddd2e 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -168,9 +168,9 @@
     }
 
     if (!(mFlags & kFlagIncognito)) {
-        LOGI("onConnect '%s'", url.c_str());
+        ALOGI("onConnect '%s'", url.c_str());
     } else {
-        LOGI("onConnect <URL suppressed>");
+        ALOGI("onConnect <URL suppressed>");
     }
 
     mMasterURL = url;
@@ -179,7 +179,7 @@
     sp<M3UParser> playlist = fetchPlaylist(url.c_str(), &dummy);
 
     if (playlist == NULL) {
-        LOGE("unable to fetch master playlist '%s'.", url.c_str());
+        ALOGE("unable to fetch master playlist '%s'.", url.c_str());
 
         mDataSource->queueEOS(ERROR_IO);
         return;
@@ -207,7 +207,7 @@
 }
 
 void LiveSession::onDisconnect() {
-    LOGI("onDisconnect");
+    ALOGI("onDisconnect");
 
     mDataSource->queueEOS(ERROR_END_OF_STREAM);
 
@@ -360,7 +360,7 @@
         new M3UParser(url, buffer->data(), buffer->size());
 
     if (playlist->initCheck() != OK) {
-        LOGE("failed to parse .m3u8 playlist");
+        ALOGE("failed to parse .m3u8 playlist");
 
         return NULL;
     }
@@ -531,7 +531,7 @@
                 // We succeeded in fetching the playlist, but it was
                 // unchanged from the last time we tried.
             } else {
-                LOGE("failed to load playlist at url '%s'", url.c_str());
+                ALOGE("failed to load playlist at url '%s'", url.c_str());
                 mDataSource->queueEOS(ERROR_IO);
                 return;
             }
@@ -596,7 +596,7 @@
                 int32_t newSeqNumber = firstSeqNumberInPlaylist + index;
 
                 if (newSeqNumber != mSeqNumber) {
-                    LOGI("seeking to seq no %d", newSeqNumber);
+                    ALOGI("seeking to seq no %d", newSeqNumber);
 
                     mSeqNumber = newSeqNumber;
 
@@ -633,7 +633,7 @@
         if (mPrevBandwidthIndex != (ssize_t)bandwidthIndex) {
             // Go back to the previous bandwidth.
 
-            LOGI("new bandwidth does not have the sequence number "
+            ALOGI("new bandwidth does not have the sequence number "
                  "we're looking for, switching back to previous bandwidth");
 
             mLastPlaylistFetchTimeUs = -1;
@@ -653,13 +653,13 @@
             // we've missed the boat, let's start from the lowest sequence
             // number available and signal a discontinuity.
 
-            LOGI("We've missed the boat, restarting playback.");
+            ALOGI("We've missed the boat, restarting playback.");
             mSeqNumber = lastSeqNumberInPlaylist;
             explicitDiscontinuity = true;
 
             // fall through
         } else {
-            LOGE("Cannot find sequence number %d in playlist "
+            ALOGE("Cannot find sequence number %d in playlist "
                  "(contains %d - %d)",
                  mSeqNumber, firstSeqNumberInPlaylist,
                  firstSeqNumberInPlaylist + mPlaylist->size() - 1);
@@ -693,7 +693,7 @@
     sp<ABuffer> buffer;
     status_t err = fetchFile(uri.c_str(), &buffer, range_offset, range_length);
     if (err != OK) {
-        LOGE("failed to fetch .ts segment at url '%s'", uri.c_str());
+        ALOGE("failed to fetch .ts segment at url '%s'", uri.c_str());
         mDataSource->queueEOS(err);
         return;
     }
@@ -703,7 +703,7 @@
     err = decryptBuffer(mSeqNumber - firstSeqNumberInPlaylist, buffer);
 
     if (err != OK) {
-        LOGE("decryptBuffer failed w/ error %d", err);
+        ALOGE("decryptBuffer failed w/ error %d", err);
 
         mDataSource->queueEOS(err);
         return;
@@ -712,7 +712,7 @@
     if (buffer->size() == 0 || buffer->data()[0] != 0x47) {
         // Not a transport stream???
 
-        LOGE("This doesn't look like a transport stream...");
+        ALOGE("This doesn't look like a transport stream...");
 
         mBandwidthItems.removeAt(bandwidthIndex);
 
@@ -721,7 +721,7 @@
             return;
         }
 
-        LOGI("Retrying with a different bandwidth stream.");
+        ALOGI("Retrying with a different bandwidth stream.");
 
         mLastPlaylistFetchTimeUs = -1;
         bandwidthIndex = getBandwidthIndex();
@@ -744,7 +744,7 @@
     if (seekDiscontinuity || explicitDiscontinuity || bandwidthChanged) {
         // Signal discontinuity.
 
-        LOGI("queueing discontinuity (seek=%d, explicit=%d, bandwidthChanged=%d)",
+        ALOGI("queueing discontinuity (seek=%d, explicit=%d, bandwidthChanged=%d)",
              seekDiscontinuity, explicitDiscontinuity, bandwidthChanged);
 
         sp<ABuffer> tmp = new ABuffer(188);
@@ -796,13 +796,13 @@
     if (method == "NONE") {
         return OK;
     } else if (!(method == "AES-128")) {
-        LOGE("Unsupported cipher method '%s'", method.c_str());
+        ALOGE("Unsupported cipher method '%s'", method.c_str());
         return ERROR_UNSUPPORTED;
     }
 
     AString keyURI;
     if (!itemMeta->findString("cipher-uri", &keyURI)) {
-        LOGE("Missing key uri");
+        ALOGE("Missing key uri");
         return ERROR_MALFORMED;
     }
 
@@ -844,7 +844,7 @@
         }
 
         if (err != OK) {
-            LOGE("failed to fetch cipher key from '%s'.", keyURI.c_str());
+            ALOGE("failed to fetch cipher key from '%s'.", keyURI.c_str());
             return ERROR_IO;
         }
 
@@ -853,7 +853,7 @@
 
     AES_KEY aes_key;
     if (AES_set_decrypt_key(key->data(), 128, &aes_key) != 0) {
-        LOGE("failed to set AES decryption key.");
+        ALOGE("failed to set AES decryption key.");
         return UNKNOWN_ERROR;
     }
 
@@ -863,7 +863,7 @@
     if (itemMeta->findString("cipher-iv", &iv)) {
         if ((!iv.startsWith("0x") && !iv.startsWith("0X"))
                 || iv.size() != 16 * 2 + 2) {
-            LOGE("malformed cipher IV '%s'.", iv.c_str());
+            ALOGE("malformed cipher IV '%s'.", iv.c_str());
             return ERROR_MALFORMED;
         }
 
@@ -872,7 +872,7 @@
             char c1 = tolower(iv.c_str()[2 + 2 * i]);
             char c2 = tolower(iv.c_str()[3 + 2 * i]);
             if (!isxdigit(c1) || !isxdigit(c2)) {
-                LOGE("malformed cipher IV '%s'.", iv.c_str());
+                ALOGE("malformed cipher IV '%s'.", iv.c_str());
                 return ERROR_MALFORMED;
             }
             uint8_t nibble1 = isdigit(c1) ? c1 - '0' : c1 - 'a' + 10;
diff --git a/media/libstagefright/httplive/M3UParser.cpp b/media/libstagefright/httplive/M3UParser.cpp
index a50970e..7d3cf05 100644
--- a/media/libstagefright/httplive/M3UParser.cpp
+++ b/media/libstagefright/httplive/M3UParser.cpp
@@ -169,7 +169,7 @@
             line.setTo(&data[offset], offsetLF - offset);
         }
 
-        // LOGI("#%s#", line.c_str());
+        // ALOGI("#%s#", line.c_str());
 
         if (line.empty()) {
             offset = offsetLF + 1;
@@ -451,7 +451,7 @@
                 if (MakeURL(baseURI.c_str(), val.c_str(), &absURI)) {
                     val = absURI;
                 } else {
-                    LOGE("failed to make absolute url for '%s'.",
+                    ALOGE("failed to make absolute url for '%s'.",
                          val.c_str());
                 }
             }
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp
index 943a937..6dde9d8 100644
--- a/media/libstagefright/id3/ID3.cpp
+++ b/media/libstagefright/id3/ID3.cpp
@@ -129,7 +129,7 @@
     }
 
     if (size > kMaxMetadataSize) {
-        LOGE("skipping huge ID3 metadata of size %d", size);
+        ALOGE("skipping huge ID3 metadata of size %d", size);
         return false;
     }
 
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index 474c794..4fbf47e 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -245,7 +245,7 @@
             if (res < 0) {
                 // I/O error
 
-                LOGE("Cluster::Parse returned result %ld", res);
+                ALOGE("Cluster::Parse returned result %ld", res);
 
                 mCluster = NULL;
                 break;
@@ -563,7 +563,7 @@
 
 #if 0
     const mkvparser::SegmentInfo *info = mSegment->GetInfo();
-    LOGI("muxing app: %s, writing app: %s",
+    ALOGI("muxing app: %s, writing app: %s",
          info->GetMuxingAppAsUTF8(),
          info->GetWritingAppAsUTF8());
 #endif
diff --git a/media/libstagefright/mpeg2ts/ATSParser.cpp b/media/libstagefright/mpeg2ts/ATSParser.cpp
index da911e4..3f4de1f 100644
--- a/media/libstagefright/mpeg2ts/ATSParser.cpp
+++ b/media/libstagefright/mpeg2ts/ATSParser.cpp
@@ -282,7 +282,7 @@
         ssize_t index = mStreams.indexOfKey(info.mPID);
 
         if (index >= 0 && mStreams.editValueAt(index)->type() != info.mType) {
-            LOGI("uh oh. stream PIDs have changed.");
+            ALOGI("uh oh. stream PIDs have changed.");
             PIDsChanged = true;
             break;
         }
@@ -290,18 +290,18 @@
 
     if (PIDsChanged) {
 #if 0
-        LOGI("before:");
+        ALOGI("before:");
         for (size_t i = 0; i < mStreams.size(); ++i) {
             sp<Stream> stream = mStreams.editValueAt(i);
 
-            LOGI("PID 0x%08x => type 0x%02x", stream->pid(), stream->type());
+            ALOGI("PID 0x%08x => type 0x%02x", stream->pid(), stream->type());
         }
 
-        LOGI("after:");
+        ALOGI("after:");
         for (size_t i = 0; i < infos.size(); ++i) {
             StreamInfo &info = infos.editItemAt(i);
 
-            LOGI("PID 0x%08x => type 0x%02x", info.mPID, info.mType);
+            ALOGI("PID 0x%08x => type 0x%02x", info.mPID, info.mType);
         }
 #endif
 
@@ -340,7 +340,7 @@
         }
 
         if (!success) {
-            LOGI("Stream PIDs changed and we cannot recover.");
+            ALOGI("Stream PIDs changed and we cannot recover.");
             return ERROR_MALFORMED;
         }
     }
@@ -475,7 +475,7 @@
         // Increment in multiples of 64K.
         neededSize = (neededSize + 65535) & ~65535;
 
-        LOGI("resizing buffer to %d bytes", neededSize);
+        ALOGI("resizing buffer to %d bytes", neededSize);
 
         sp<ABuffer> newBuffer = new ABuffer(neededSize);
         memcpy(newBuffer->data(), mBuffer->data(), mBuffer->size());
@@ -634,7 +634,7 @@
             CHECK_EQ(br->getBits(1), 1u);
 
             ALOGV("PTS = %llu", PTS);
-            // LOGI("PTS = %.2f secs", PTS / 90000.0f);
+            // ALOGI("PTS = %.2f secs", PTS / 90000.0f);
 
             optional_bytes_remaining -= 5;
 
@@ -697,7 +697,7 @@
                 PES_packet_length - 3 - PES_header_data_length;
 
             if (br->numBitsLeft() < dataLength * 8) {
-                LOGE("PES packet does not carry enough data to contain "
+                ALOGE("PES packet does not carry enough data to contain "
                      "payload. (numBitsLeft = %d, required = %d)",
                      br->numBitsLeft(), dataLength * 8);
 
@@ -968,7 +968,7 @@
     unsigned continuity_counter = br->getBits(4);
     ALOGV("continuity_counter = %u", continuity_counter);
 
-    // LOGI("PID = 0x%04x, continuity_counter = %u", PID, continuity_counter);
+    // ALOGI("PID = 0x%04x, continuity_counter = %u", PID, continuity_counter);
 
     if (adaptation_field_control == 2 || adaptation_field_control == 3) {
         parseAdaptationField(br);
diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp
index edb4232..7fd99a8 100644
--- a/media/libstagefright/mpeg2ts/ESQueue.cpp
+++ b/media/libstagefright/mpeg2ts/ESQueue.cpp
@@ -144,7 +144,7 @@
                 }
 
                 if (startOffset > 0) {
-                    LOGI("found something resembling an H.264/MPEG syncword at "
+                    ALOGI("found something resembling an H.264/MPEG syncword at "
                          "offset %ld",
                          startOffset);
                 }
@@ -177,7 +177,7 @@
                 }
 
                 if (startOffset > 0) {
-                    LOGI("found something resembling an H.264/MPEG syncword at "
+                    ALOGI("found something resembling an H.264/MPEG syncword at "
                          "offset %ld",
                          startOffset);
                 }
@@ -210,7 +210,7 @@
                 }
 
                 if (startOffset > 0) {
-                    LOGI("found something resembling an AAC syncword at offset %ld",
+                    ALOGI("found something resembling an AAC syncword at offset %ld",
                          startOffset);
                 }
 
@@ -237,7 +237,7 @@
                 }
 
                 if (startOffset > 0) {
-                    LOGI("found something resembling an MPEG audio "
+                    ALOGI("found something resembling an MPEG audio "
                          "syncword at offset %ld",
                          startOffset);
                 }
@@ -280,7 +280,7 @@
 
 #if 0
     if (mMode == AAC) {
-        LOGI("size = %d, timeUs = %.2f secs", size, timeUs / 1E6);
+        ALOGI("size = %d, timeUs = %.2f secs", size, timeUs / 1E6);
         hexdump(data, size);
     }
 #endif
@@ -337,7 +337,7 @@
             CHECK(mFormat->findInt32(kKeySampleRate, &sampleRate));
             CHECK(mFormat->findInt32(kKeyChannelCount, &numChannels));
 
-            LOGI("found AAC codec config (%d Hz, %d channels)",
+            ALOGI("found AAC codec config (%d Hz, %d channels)",
                  sampleRate, numChannels);
         } else {
             // profile_ObjectType, sampling_frequency_index, private_bits,
@@ -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;
@@ -714,7 +714,7 @@
                 mFormat->setInt32(kKeyWidth, width);
                 mFormat->setInt32(kKeyHeight, height);
 
-                LOGI("found MPEG2 video codec config (%d x %d)", width, height);
+                ALOGI("found MPEG2 video codec config (%d x %d)", width, height);
 
                 sp<ABuffer> csd = new ABuffer(offset);
                 memcpy(csd->data(), data, offset);
@@ -880,7 +880,7 @@
                     mFormat->setInt32(kKeyWidth, width);
                     mFormat->setInt32(kKeyHeight, height);
 
-                    LOGI("found MPEG4 video codec config (%d x %d)",
+                    ALOGI("found MPEG4 video codec config (%d x %d)",
                          width, height);
 
                     sp<ABuffer> csd = new ABuffer(offset);
diff --git a/media/libstagefright/mpeg2ts/MPEG2PSExtractor.cpp b/media/libstagefright/mpeg2ts/MPEG2PSExtractor.cpp
index df30a9c..dd714c9 100644
--- a/media/libstagefright/mpeg2ts/MPEG2PSExtractor.cpp
+++ b/media/libstagefright/mpeg2ts/MPEG2PSExtractor.cpp
@@ -315,7 +315,7 @@
             unsigned descriptor_tag = br.getBits(8);
             unsigned descriptor_length = br.getBits(8);
 
-            LOGI("found descriptor tag 0x%02x of length %u",
+            ALOGI("found descriptor tag 0x%02x of length %u",
                  descriptor_tag, descriptor_length);
 
             if (offset + 2 + descriptor_length > program_stream_info_length) {
@@ -338,7 +338,7 @@
             unsigned stream_type = br.getBits(8);
             unsigned elementary_stream_id = br.getBits(8);
 
-            LOGI("elementary stream id 0x%02x has stream type 0x%02x",
+            ALOGI("elementary stream id 0x%02x has stream type 0x%02x",
                  elementary_stream_id, stream_type);
 
             mStreamTypeByESID.add(elementary_stream_id, stream_type);
@@ -409,7 +409,7 @@
             CHECK_EQ(br.getBits(1), 1u);
 
             ALOGV("PTS = %llu", PTS);
-            // LOGI("PTS = %.2f secs", PTS / 90000.0f);
+            // ALOGI("PTS = %.2f secs", PTS / 90000.0f);
 
             optional_bytes_remaining -= 5;
 
@@ -471,7 +471,7 @@
             PES_packet_length - 3 - PES_header_data_length;
 
         if (br.numBitsLeft() < dataLength * 8) {
-            LOGE("PES packet does not carry enough data to contain "
+            ALOGE("PES packet does not carry enough data to contain "
                  "payload. (numBitsLeft = %d, required = %d)",
                  br.numBitsLeft(), dataLength * 8);
 
@@ -568,7 +568,7 @@
     if (supported) {
         mQueue = new ElementaryStreamQueue(mode);
     } else {
-        LOGI("unsupported stream ID 0x%02x", stream_id);
+        ALOGI("unsupported stream ID 0x%02x", stream_id);
     }
 }
 
diff --git a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
index 17cf45a..03033f5 100644
--- a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
+++ b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
@@ -199,7 +199,7 @@
         }
     }
 
-    LOGI("haveAudio=%d, haveVideo=%d", haveAudio, haveVideo);
+    ALOGI("haveAudio=%d, haveVideo=%d", haveAudio, haveVideo);
 }
 
 status_t MPEG2TSExtractor::feedMore() {
diff --git a/media/libstagefright/omx/OMXMaster.cpp b/media/libstagefright/omx/OMXMaster.cpp
index c8278ab..d698939 100644
--- a/media/libstagefright/omx/OMXMaster.cpp
+++ b/media/libstagefright/omx/OMXMaster.cpp
@@ -81,7 +81,7 @@
         String8 name8(name);
 
         if (mPluginByComponentName.indexOfKey(name8) >= 0) {
-            LOGE("A component of name '%s' already exists, ignoring this one.",
+            ALOGE("A component of name '%s' already exists, ignoring this one.",
                  name8.string());
 
             continue;
@@ -91,7 +91,7 @@
     }
 
     if (err != OMX_ErrorNoMore) {
-        LOGE("OMX plugin failed w/ error 0x%08x after registering %d "
+        ALOGE("OMX plugin failed w/ error 0x%08x after registering %d "
              "components", err, mPluginByComponentName.size());
     }
 }
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index 802c429..8938e33 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -150,7 +150,7 @@
                    && state != OMX_StateIdle
                    && state != OMX_StateInvalid) {
                 if (++iteration > kMaxNumIterations) {
-                    LOGE("component failed to enter Idle state, aborting.");
+                    ALOGE("component failed to enter Idle state, aborting.");
                     state = OMX_StateInvalid;
                     break;
                 }
@@ -179,7 +179,7 @@
                    && state != OMX_StateLoaded
                    && state != OMX_StateInvalid) {
                 if (++iteration > kMaxNumIterations) {
-                    LOGE("component failed to enter Loaded state, aborting.");
+                    ALOGE("component failed to enter Loaded state, aborting.");
                     state = OMX_StateInvalid;
                     break;
                 }
@@ -209,7 +209,7 @@
     mHandle = NULL;
 
     if (err != OMX_ErrorNone) {
-        LOGE("FreeHandle FAILED with error 0x%08x.", err);
+        ALOGE("FreeHandle FAILED with error 0x%08x.", err);
     }
 
     mOwner->invalidateNodeID(mNodeID);
@@ -285,7 +285,7 @@
             &index);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_GetExtensionIndex failed");
+        ALOGE("OMX_GetExtensionIndex failed");
 
         return StatusFromOMXError(err);
     }
@@ -302,7 +302,7 @@
     err = OMX_SetParameter(mHandle, index, &params);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_EnableAndroidNativeBuffers failed with error %d (0x%08x)",
+        ALOGE("OMX_EnableAndroidNativeBuffers failed with error %d (0x%08x)",
                 err, err);
 
         return UNKNOWN_ERROR;
@@ -323,7 +323,7 @@
             &index);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_GetExtensionIndex failed");
+        ALOGE("OMX_GetExtensionIndex failed");
 
         return StatusFromOMXError(err);
     }
@@ -340,7 +340,7 @@
     err = OMX_GetParameter(mHandle, index, &params);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_GetAndroidNativeBufferUsage failed with error %d (0x%08x)",
+        ALOGE("OMX_GetAndroidNativeBufferUsage failed with error %d (0x%08x)",
                 err, err);
         return UNKNOWN_ERROR;
     }
@@ -361,7 +361,7 @@
 
     OMX_ERRORTYPE err = OMX_GetExtensionIndex(mHandle, name, &index);
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_GetExtensionIndex %s failed", name);
+        ALOGE("OMX_GetExtensionIndex %s failed", name);
         return StatusFromOMXError(err);
     }
 
@@ -375,7 +375,7 @@
     params.nPortIndex = portIndex;
     params.bStoreMetaData = enable;
     if ((err = OMX_SetParameter(mHandle, index, &params)) != OMX_ErrorNone) {
-        LOGE("OMX_SetParameter() failed for StoreMetaDataInBuffers: 0x%08x", err);
+        ALOGE("OMX_SetParameter() failed for StoreMetaDataInBuffers: 0x%08x", err);
         return UNKNOWN_ERROR;
     }
     return err;
@@ -395,7 +395,7 @@
             params->size(), static_cast<OMX_U8 *>(params->pointer()));
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_UseBuffer failed with error %d (0x%08x)", err, err);
+        ALOGE("OMX_UseBuffer failed with error %d (0x%08x)", err, err);
 
         delete buffer_meta;
         buffer_meta = NULL;
@@ -429,7 +429,7 @@
     OMX_ERRORTYPE err = OMX_GetParameter(mHandle, OMX_IndexParamPortDefinition, &def);
     if (err != OMX_ErrorNone)
     {
-        LOGE("%s::%d:Error getting OMX_IndexParamPortDefinition", __FUNCTION__, __LINE__);
+        ALOGE("%s::%d:Error getting OMX_IndexParamPortDefinition", __FUNCTION__, __LINE__);
         return err;
     }
 
@@ -448,7 +448,7 @@
             bufferHandle);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_UseBuffer failed with error %d (0x%08x)", err, err);
+        ALOGE("OMX_UseBuffer failed with error %d (0x%08x)", err, err);
         delete bufferMeta;
         bufferMeta = NULL;
         *buffer = 0;
@@ -488,7 +488,7 @@
             &index);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_GetExtensionIndex failed");
+        ALOGE("OMX_GetExtensionIndex failed");
 
         return StatusFromOMXError(err);
     }
@@ -510,7 +510,7 @@
     err = OMX_SetParameter(mHandle, index, &params);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_UseAndroidNativeBuffer failed with error %d (0x%08x)", err,
+        ALOGE("OMX_UseAndroidNativeBuffer failed with error %d (0x%08x)", err,
                 err);
 
         delete bufferMeta;
@@ -543,7 +543,7 @@
             mHandle, &header, portIndex, buffer_meta, size);
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_AllocateBuffer failed with error %d (0x%08x)", err, err);
+        ALOGE("OMX_AllocateBuffer failed with error %d (0x%08x)", err, err);
 
         delete buffer_meta;
         buffer_meta = NULL;
@@ -576,7 +576,7 @@
             mHandle, &header, portIndex, buffer_meta, params->size());
 
     if (err != OMX_ErrorNone) {
-        LOGE("OMX_AllocateBuffer failed with error %d (0x%08x)", err, err);
+        ALOGE("OMX_AllocateBuffer failed with error %d (0x%08x)", err, err);
 
         delete buffer_meta;
         buffer_meta = NULL;
@@ -672,7 +672,7 @@
 }
 
 void OMXNodeInstance::onObserverDied(OMXMaster *master) {
-    LOGE("!!! Observer died. Quickly, do something, ... anything...");
+    ALOGE("!!! Observer died. Quickly, do something, ... anything...");
 
     // Try to force shutdown of the node and hope for the best.
     freeNode(master);
@@ -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/omx/SoftOMXPlugin.cpp b/media/libstagefright/omx/SoftOMXPlugin.cpp
index 8aeb763..da3ae42 100644
--- a/media/libstagefright/omx/SoftOMXPlugin.cpp
+++ b/media/libstagefright/omx/SoftOMXPlugin.cpp
@@ -72,7 +72,7 @@
         void *libHandle = dlopen(libName.c_str(), RTLD_NOW);
 
         if (libHandle == NULL) {
-            LOGE("unable to dlopen %s", libName.c_str());
+            ALOGE("unable to dlopen %s", libName.c_str());
 
             return OMX_ErrorComponentNotFound;
         }
diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp
index d4354db..8faf544 100644
--- a/media/libstagefright/omx/tests/OMXHarness.cpp
+++ b/media/libstagefright/omx/tests/OMXHarness.cpp
@@ -174,7 +174,7 @@
 
 #define EXPECT(condition, info) \
     if (!(condition)) {         \
-        LOGE(info); printf("\n  * " info "\n"); return UNKNOWN_ERROR; \
+        ALOGE(info); printf("\n  * " info "\n"); return UNKNOWN_ERROR; \
     }
 
 #define EXPECT_SUCCESS(err, info) \
@@ -571,7 +571,7 @@
     const char *mime = GetMimeFromComponentRole(componentRole);
 
     if (!mime) {
-        LOGI("Cannot perform seek test with this componentRole (%s)",
+        ALOGI("Cannot perform seek test with this componentRole (%s)",
              componentRole);
 
         return OK;
@@ -597,7 +597,7 @@
     int64_t durationUs;
     CHECK(source->getFormat()->findInt64(kKeyDuration, &durationUs));
 
-    LOGI("stream duration is %lld us (%.2f secs)",
+    ALOGI("stream duration is %lld us (%.2f secs)",
          durationUs, durationUs / 1E6);
 
     static const int32_t kNumIterations = 5000;
@@ -617,19 +617,19 @@
 
             requestedSeekTimeUs = -1;
 
-            LOGI("requesting linear read");
+            ALOGI("requesting linear read");
         } else {
             if (i == 0 || r < 0.55) {
                 // 5% chance of seeking beyond end of stream.
 
                 requestedSeekTimeUs = durationUs;
 
-                LOGI("requesting seek beyond EOF");
+                ALOGI("requesting seek beyond EOF");
             } else {
                 requestedSeekTimeUs =
                     (int64_t)(uniform_rand() * durationUs);
 
-                LOGI("requesting seek to %lld us (%.2f secs)",
+                ALOGI("requesting seek to %lld us (%.2f secs)",
                      requestedSeekTimeUs, requestedSeekTimeUs / 1E6);
             }
 
@@ -649,7 +649,7 @@
                 buffer = NULL;
             }
 
-            LOGI("nearest keyframe is at %lld us (%.2f secs)",
+            ALOGI("nearest keyframe is at %lld us (%.2f secs)",
                  actualSeekTimeUs, actualSeekTimeUs / 1E6);
         }
 
@@ -733,7 +733,7 @@
 status_t Harness::test(
         const char *componentName, const char *componentRole) {
     printf("testing %s [%s] ... ", componentName, componentRole);
-    LOGI("testing %s [%s].", componentName, componentRole);
+    ALOGI("testing %s [%s].", componentName, componentRole);
 
     status_t err1 = testStateTransitions(componentName, componentRole);
     status_t err2 = testSeek(componentName, componentRole);
diff --git a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
index 11d9c22..b0c7007 100644
--- a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
+++ b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
@@ -196,7 +196,7 @@
 
         unsigned syncExtensionType = bits->getBits(11);
         if (syncExtensionType == 0x2b7) {
-            LOGI("found syncExtension");
+            ALOGI("found syncExtension");
 
             CHECK_EQ(parseAudioObjectType(bits, &extensionAudioObjectType),
                      (status_t)OK);
@@ -217,7 +217,7 @@
                 // Apparently an extension is always considered an even
                 // multiple of 8 bits long.
 
-                LOGI("Skipping %d bits after sync extension",
+                ALOGI("Skipping %d bits after sync extension",
                      8 - (numBitsInExtension & 7));
 
                 bits->skipBits(8 - (numBitsInExtension & 7));
@@ -424,7 +424,7 @@
     }
 
     if (offset < buffer->size()) {
-        LOGI("ignoring %d bytes of trailing data", buffer->size() - offset);
+        ALOGI("ignoring %d bytes of trailing data", buffer->size() - offset);
     }
     CHECK_LE(offset, buffer->size());
 
diff --git a/media/libstagefright/rtsp/APacketSource.cpp b/media/libstagefright/rtsp/APacketSource.cpp
index 3f4cdb5..6cf1301 100644
--- a/media/libstagefright/rtsp/APacketSource.cpp
+++ b/media/libstagefright/rtsp/APacketSource.cpp
@@ -193,7 +193,7 @@
 
         if (i == 0) {
             FindAVCDimensions(nal, width, height);
-            LOGI("dimensions %dx%d", *width, *height);
+            ALOGI("dimensions %dx%d", *width, *height);
         }
     }
 
@@ -371,7 +371,7 @@
         return NULL;
     }
 
-    LOGI("VOL dimensions = %dx%d", *width, *height);
+    ALOGI("VOL dimensions = %dx%d", *width, *height);
 
     size_t len1 = config->size() + GetSizeWidth(config->size()) + 1;
     size_t len2 = len1 + GetSizeWidth(len1) + 1 + 13;
diff --git a/media/libstagefright/rtsp/ARTPConnection.cpp b/media/libstagefright/rtsp/ARTPConnection.cpp
index c5d8740..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);
@@ -396,7 +396,7 @@
 
     buffer->setRange(0, nbytes);
 
-    // LOGI("received %d bytes.", buffer->size());
+    // ALOGI("received %d bytes.", buffer->size());
 
     status_t err;
     if (receiveRTP) {
@@ -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;
             }
@@ -606,7 +606,7 @@
     uint32_t rtpTime = u32at(&data[16]);
 
 #if 0
-    LOGI("XXX timeUpdate: ssrc=0x%08x, rtpTime %u == ntpTime %.3f",
+    ALOGI("XXX timeUpdate: ssrc=0x%08x, rtpTime %u == ntpTime %.3f",
          id,
          rtpTime,
          (ntpTime >> 32) + (double)(ntpTime & 0xffffffff) / (1ll << 32));
diff --git a/media/libstagefright/rtsp/ARTPSession.cpp b/media/libstagefright/rtsp/ARTPSession.cpp
index c6bcb12..7a05b88 100644
--- a/media/libstagefright/rtsp/ARTPSession.cpp
+++ b/media/libstagefright/rtsp/ARTPSession.cpp
@@ -53,24 +53,24 @@
         if (!mDesc->findAttribute(i, "c=", &connection)) {
             // No per-stream connection information, try global fallback.
             if (!mDesc->findAttribute(0, "c=", &connection)) {
-                LOGE("Unable to find connection attribute.");
+                ALOGE("Unable to find connection attribute.");
                 return mInitCheck;
             }
         }
         if (!(connection == "IN IP4 127.0.0.1")) {
-            LOGE("We only support localhost connections for now.");
+            ALOGE("We only support localhost connections for now.");
             return mInitCheck;
         }
 
         unsigned port;
         if (!validateMediaFormat(i, &port) || (port & 1) != 0) {
-            LOGE("Invalid media format.");
+            ALOGE("Invalid media format.");
             return mInitCheck;
         }
 
         sp<APacketSource> source = new APacketSource(mDesc, i);
         if (source->initCheck() != OK) {
-            LOGE("Unsupported format.");
+            ALOGE("Unsupported format.");
             return mInitCheck;
         }
 
@@ -159,7 +159,7 @@
             printf("access unit complete size=%d\tntp-time=0x%016llx\n",
                    accessUnit->size(), ntpTime);
 #else
-            LOGI("access unit complete, size=%d, ntp-time=%llu",
+            ALOGI("access unit complete, size=%d, ntp-time=%llu",
                  accessUnit->size(), ntpTime);
             hexdump(accessUnit->data(), accessUnit->size());
 #endif
@@ -170,7 +170,7 @@
             CHECK(!memcmp("\x00\x00\x00\x01", accessUnit->data(), 4));
             unsigned x = accessUnit->data()[4];
 
-            LOGI("access unit complete: nalType=0x%02x, nalRefIdc=0x%02x",
+            ALOGI("access unit complete: nalType=0x%02x, nalRefIdc=0x%02x",
                  x & 0x1f, (x & 0x60) >> 5);
 #endif
 
@@ -181,7 +181,7 @@
             int32_t damaged;
             if (accessUnit->meta()->findInt32("damaged", &damaged)
                     && damaged != 0) {
-                LOGI("ignoring damaged AU");
+                ALOGI("ignoring damaged AU");
             } else
 #endif
             {
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/ARTPWriter.cpp b/media/libstagefright/rtsp/ARTPWriter.cpp
index b602511..0d07043 100644
--- a/media/libstagefright/rtsp/ARTPWriter.cpp
+++ b/media/libstagefright/rtsp/ARTPWriter.cpp
@@ -269,7 +269,7 @@
     status_t err = mSource->read(&mediaBuf);
 
     if (err != OK) {
-        LOGI("reached EOS.");
+        ALOGI("reached EOS.");
 
         Mutex::Autolock autoLock(mLock);
         mFlags |= kFlagEOS;
@@ -520,7 +520,7 @@
         sdp.append("a=fmtp:" PT_STR " octed-align\r\n");
     }
 
-    LOGI("%s", sdp.c_str());
+    ALOGI("%s", sdp.c_str());
 }
 
 void ARTPWriter::makeH264SPropParamSets(MediaBuffer *buffer) {
diff --git a/media/libstagefright/rtsp/ARTSPConnection.cpp b/media/libstagefright/rtsp/ARTSPConnection.cpp
index d8107bc..80a010e 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTSPConnection.cpp
@@ -55,7 +55,7 @@
 
 ARTSPConnection::~ARTSPConnection() {
     if (mSocket >= 0) {
-        LOGE("Connection is still open, closing the socket.");
+        ALOGE("Connection is still open, closing the socket.");
         if (mUIDValid) {
             HTTPBase::UnRegisterSocketUserTag(mSocket);
         }
@@ -235,7 +235,7 @@
         // right here, since we currently have no way of asking the user
         // for this information.
 
-        LOGE("Malformed rtsp url %s", url.c_str());
+        ALOGE("Malformed rtsp url %s", url.c_str());
 
         reply->setInt32("result", ERROR_MALFORMED);
         reply->post();
@@ -250,7 +250,7 @@
 
     struct hostent *ent = gethostbyname(host.c_str());
     if (ent == NULL) {
-        LOGE("Unknown host %s", host.c_str());
+        ALOGE("Unknown host %s", host.c_str());
 
         reply->setInt32("result", -ENOENT);
         reply->post();
@@ -376,7 +376,7 @@
     CHECK_EQ(optionLen, (socklen_t)sizeof(err));
 
     if (err != 0) {
-        LOGE("err = %d (%s)", err, strerror(err));
+        ALOGE("err = %d (%s)", err, strerror(err));
 
         reply->setInt32("result", -err);
 
@@ -446,12 +446,12 @@
 
             if (n == 0) {
                 // Server closed the connection.
-                LOGE("Server unexpectedly closed the connection.");
+                ALOGE("Server unexpectedly closed the connection.");
 
                 reply->setInt32("result", ERROR_IO);
                 reply->post();
             } else {
-                LOGE("Error sending rtsp request. (%s)", strerror(errno));
+                ALOGE("Error sending rtsp request. (%s)", strerror(errno));
                 reply->setInt32("result", -errno);
                 reply->post();
             }
@@ -536,10 +536,10 @@
 
             if (n == 0) {
                 // Server closed the connection.
-                LOGE("Server unexpectedly closed the connection.");
+                ALOGE("Server unexpectedly closed the connection.");
                 return ERROR_IO;
             } else {
-                LOGE("Error reading rtsp response. (%s)", strerror(errno));
+                ALOGE("Error reading rtsp response. (%s)", strerror(errno));
                 return -errno;
             }
         }
@@ -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;
@@ -624,7 +624,7 @@
     sp<ARTSPResponse> response = new ARTSPResponse;
     response->mStatusLine = statusLine;
 
-    LOGI("status: %s", response->mStatusLine.c_str());
+    ALOGI("status: %s", response->mStatusLine.c_str());
 
     ssize_t space1 = response->mStatusLine.find(" ");
     if (space1 < 0) {
@@ -740,7 +740,7 @@
             msg->setMessage("reply", reply);
             msg->setString("request", request.c_str(), request.size());
 
-            LOGI("re-sending request with authentication headers...");
+            ALOGI("re-sending request with authentication headers...");
             onSendRequest(msg);
 
             return true;
@@ -793,9 +793,9 @@
         if (n <= 0) {
             if (n == 0) {
                 // Server closed the connection.
-                LOGE("Server unexpectedly closed the connection.");
+                ALOGE("Server unexpectedly closed the connection.");
             } else {
-                LOGE("Error sending rtsp response (%s).", strerror(errno));
+                ALOGE("Error sending rtsp response (%s).", strerror(errno));
             }
 
             performDisconnect();
diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp
index 56fdd9d..a9b3330 100644
--- a/media/libstagefright/rtsp/ASessionDescription.cpp
+++ b/media/libstagefright/rtsp/ASessionDescription.cpp
@@ -80,7 +80,7 @@
             return false;
         }
 
-        LOGI("%s", line.c_str());
+        ALOGI("%s", line.c_str());
 
         switch (line.c_str()[0]) {
             case 'v':
diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h
index 21ef298..2391c5c 100644
--- a/media/libstagefright/rtsp/MyHandler.h
+++ b/media/libstagefright/rtsp/MyHandler.h
@@ -155,7 +155,7 @@
             mSessionURL.append(StringPrintf("%u", port));
             mSessionURL.append(path);
 
-            LOGI("rewritten session url: '%s'", mSessionURL.c_str());
+            ALOGI("rewritten session url: '%s'", mSessionURL.c_str());
         }
 
         mSessionHost = host;
@@ -264,12 +264,12 @@
         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());
             if (ent == NULL) {
-                LOGE("Failed to look up address of session host '%s'",
+                ALOGE("Failed to look up address of session host '%s'",
                      mSessionHost.c_str());
 
                 return false;
@@ -283,7 +283,7 @@
         if (!GetAttribute(transport.c_str(),
                                  "server_port",
                                  &server_port)) {
-            LOGI("Missing 'server_port' field in Transport response.");
+            ALOGI("Missing 'server_port' field in Transport response.");
             return false;
         }
 
@@ -292,7 +292,7 @@
                 || rtpPort <= 0 || rtpPort > 65535
                 || rtcpPort <=0 || rtcpPort > 65535
                 || rtcpPort != rtpPort + 1) {
-            LOGE("Server picked invalid RTP/RTCP port pair %s,"
+            ALOGE("Server picked invalid RTP/RTCP port pair %s,"
                  " RTP port must be even, RTCP port must be one higher.",
                  server_port.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.");
         }
@@ -327,7 +327,7 @@
                 (const sockaddr *)&addr, sizeof(addr));
 
         if (n < (ssize_t)buf->size()) {
-            LOGE("failed to poke a hole for RTP packets");
+            ALOGE("failed to poke a hole for RTP packets");
             return false;
         }
 
@@ -338,7 +338,7 @@
                 (const sockaddr *)&addr, sizeof(addr));
 
         if (n < (ssize_t)buf->size()) {
-            LOGE("failed to poke a hole for RTCP packets");
+            ALOGE("failed to poke a hole for RTCP packets");
             return false;
         }
 
@@ -354,7 +354,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("connection request completed with result %d (%s)",
+                ALOGI("connection request completed with result %d (%s)",
                      result, strerror(-result));
 
                 if (result == OK) {
@@ -392,7 +392,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("DESCRIBE completed with result %d (%s)",
+                ALOGI("DESCRIBE completed with result %d (%s)",
                      result, strerror(-result));
 
                 if (result == OK) {
@@ -429,7 +429,7 @@
                                 response->mContent->size());
 
                         if (!mSessionDesc->isValid()) {
-                            LOGE("Failed to parse session description.");
+                            ALOGE("Failed to parse session description.");
                             result = ERROR_MALFORMED;
                         } else {
                             ssize_t i = response->mHeaders.indexOfKey("content-base");
@@ -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 {
@@ -499,7 +499,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("SETUP(%d) completed with result %d (%s)",
+                ALOGI("SETUP(%d) completed with result %d (%s)",
                      index, result, strerror(-result));
 
                 if (result == OK) {
@@ -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);
 
@@ -540,7 +540,7 @@
                             } else {
                                 mKeepAliveTimeoutUs = timeoutSecs * 1000000ll;
 
-                                LOGI("server specified timeout of %lu secs.",
+                                ALOGI("server specified timeout of %lu secs.",
                                      timeoutSecs);
                             }
                         }
@@ -625,7 +625,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("PLAY completed with result %d (%s)",
+                ALOGI("PLAY completed with result %d (%s)",
                      result, strerror(-result));
 
                 if (result == OK) {
@@ -682,7 +682,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("OPTIONS completed with result %d (%s)",
+                ALOGI("OPTIONS completed with result %d (%s)",
                      result, strerror(-result));
 
                 int32_t generation;
@@ -759,7 +759,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("TEARDOWN completed with result %d (%s)",
+                ALOGI("TEARDOWN completed with result %d (%s)",
                      result, strerror(-result));
 
                 sp<AMessage> reply = new AMessage('disc', id());
@@ -793,11 +793,11 @@
 
                 if (mNumAccessUnitsReceived == 0) {
 #if 1
-                    LOGI("stream ended? aborting.");
+                    ALOGI("stream ended? aborting.");
                     (new AMessage('abor', id()))->post();
                     break;
 #else
-                    LOGI("haven't seen an AU in a looong time.");
+                    ALOGI("haven't seen an AU in a looong time.");
 #endif
                 }
 
@@ -848,7 +848,7 @@
 
                 int32_t eos;
                 if (msg->findInt32("eos", &eos)) {
-                    LOGI("received BYE on track index %d", trackIndex);
+                    ALOGI("received BYE on track index %d", trackIndex);
 #if 0
                     track->mPacketSource->signalEOS(ERROR_END_OF_STREAM);
 #endif
@@ -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);
@@ -961,7 +961,7 @@
                 int32_t result;
                 CHECK(msg->findInt32("result", &result));
 
-                LOGI("PLAY completed with result %d (%s)",
+                ALOGI("PLAY completed with result %d (%s)",
                      result, strerror(-result));
 
                 mCheckPending = false;
@@ -983,12 +983,12 @@
 
                         ALOGV("rtp-info: %s", response->mHeaders.valueAt(i).c_str());
 
-                        LOGI("seek completed.");
+                        ALOGI("seek completed.");
                     }
                 }
 
                 if (result != OK) {
-                    LOGE("seek failed, aborting.");
+                    ALOGE("seek failed, aborting.");
                     (new AMessage('abor', id()))->post();
                 }
 
@@ -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();
                     }
                 }
@@ -1101,7 +1101,7 @@
         if (!ASessionDescription::parseNTPRange(val.c_str(), &npt1, &npt2)) {
             // This is a live stream and therefore not seekable.
 
-            LOGI("This is a live stream");
+            ALOGI("This is a live stream");
             return;
         }
 
@@ -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/media/libstagefright/rtsp/UDPPusher.cpp b/media/libstagefright/rtsp/UDPPusher.cpp
index 576b3ca..47ea6f1 100644
--- a/media/libstagefright/rtsp/UDPPusher.cpp
+++ b/media/libstagefright/rtsp/UDPPusher.cpp
@@ -71,7 +71,7 @@
 bool UDPPusher::onPush() {
     uint32_t length;
     if (fread(&length, 1, sizeof(length), mFile) < sizeof(length)) {
-        LOGI("No more data to push.");
+        ALOGI("No more data to push.");
         return false;
     }
 
@@ -81,7 +81,7 @@
 
     sp<ABuffer> buffer = new ABuffer(length);
     if (fread(buffer->data(), 1, length, mFile) < length) {
-        LOGE("File truncated?.");
+        ALOGE("File truncated?.");
         return false;
     }
 
@@ -93,7 +93,7 @@
 
     uint32_t timeMs;
     if (fread(&timeMs, 1, sizeof(timeMs), mFile) < sizeof(timeMs)) {
-        LOGI("No more data to push.");
+        ALOGI("No more data to push.");
         return false;
     }
 
@@ -113,7 +113,7 @@
         case kWhatPush:
         {
             if (!onPush() && !(ntohs(mRemoteAddr.sin_port) & 1)) {
-                LOGI("emulating BYE packet");
+                ALOGI("emulating BYE packet");
 
                 sp<ABuffer> buffer = new ABuffer(8);
                 uint8_t *data = buffer->data();
diff --git a/media/libstagefright/rtsp/rtp_test.cpp b/media/libstagefright/rtsp/rtp_test.cpp
index f0cb5a5..d43cd2a 100644
--- a/media/libstagefright/rtsp/rtp_test.cpp
+++ b/media/libstagefright/rtsp/rtp_test.cpp
@@ -204,7 +204,7 @@
                 continue;
             }
 
-            LOGE("decoder returned error 0x%08x", err);
+            ALOGE("decoder returned error 0x%08x", err);
             break;
         }
 
diff --git a/media/libstagefright/tests/DummyRecorder.cpp b/media/libstagefright/tests/DummyRecorder.cpp
index fbb606d..ac37b28 100644
--- a/media/libstagefright/tests/DummyRecorder.cpp
+++ b/media/libstagefright/tests/DummyRecorder.cpp
@@ -47,7 +47,7 @@
     pthread_attr_destroy(&attr);
 
     if (err) {
-        LOGE("Error creating thread!");
+        ALOGE("Error creating thread!");
         return -ENODEV;
     }
     return OK;
diff --git a/media/libstagefright/tests/SurfaceMediaSource_test.cpp b/media/libstagefright/tests/SurfaceMediaSource_test.cpp
index 6be5e9a..76b507f 100644
--- a/media/libstagefright/tests/SurfaceMediaSource_test.cpp
+++ b/media/libstagefright/tests/SurfaceMediaSource_test.cpp
@@ -731,7 +731,7 @@
     const char *fileName = "/sdcard/outputSurfEncMSource.mp4";
     int fd = open(fileName, O_RDWR | O_CREAT, 0744);
     if (fd < 0) {
-        LOGE("ERROR: Could not open the the file %s, fd = %d !!", fileName, fd);
+        ALOGE("ERROR: Could not open the the file %s, fd = %d !!", fileName, fd);
     }
     CHECK(fd >= 0);
 
@@ -861,7 +861,7 @@
     const char *fileName = "/sdcard/outputSurfEncMSourceGL.mp4";
     int fd = open(fileName, O_RDWR | O_CREAT, 0744);
     if (fd < 0) {
-        LOGE("ERROR: Could not open the the file %s, fd = %d !!", fileName, fd);
+        ALOGE("ERROR: Could not open the the file %s, fd = %d !!", fileName, fd);
     }
     CHECK(fd >= 0);
 
@@ -904,7 +904,7 @@
     const char *fileName = "/sdcard/outputSurfEncMSourceGLDiff.mp4";
     int fd = open(fileName, O_RDWR | O_CREAT, 0744);
     if (fd < 0) {
-        LOGE("ERROR: Could not open the the file %s, fd = %d !!", fileName, fd);
+        ALOGE("ERROR: Could not open the the file %s, fd = %d !!", fileName, fd);
     }
     CHECK(fd >= 0);
 
diff --git a/media/libstagefright/timedtext/TimedTextPlayer.cpp b/media/libstagefright/timedtext/TimedTextPlayer.cpp
index 7c8a747..3014b0b 100644
--- a/media/libstagefright/timedtext/TimedTextPlayer.cpp
+++ b/media/libstagefright/timedtext/TimedTextPlayer.cpp
@@ -91,7 +91,7 @@
 
     if (index >=
             mTextTrackVector.size() + mTextOutOfBandVector.size()) {
-        LOGE("Incorrect text track index: %d", index);
+        ALOGE("Incorrect text track index: %d", index);
         return BAD_VALUE;
     }
 
diff --git a/media/libstagefright/yuv/YUVImage.cpp b/media/libstagefright/yuv/YUVImage.cpp
index b712062..0d67c96 100644
--- a/media/libstagefright/yuv/YUVImage.cpp
+++ b/media/libstagefright/yuv/YUVImage.cpp
@@ -54,7 +54,7 @@
         // Y takes numberOfPixels bytes and U/V take numberOfPixels/4 bytes each.
         numberOfBytes = (size_t)(numberOfPixels + (numberOfPixels >> 1));
     } else {
-        LOGE("Format not supported");
+        ALOGE("Format not supported");
     }
     return numberOfBytes;
 }
@@ -74,7 +74,7 @@
         mVdata = mYdata + numberOfPixels;
         mUdata = mVdata + 1;
     } else {
-        LOGE("Format not supported");
+        ALOGE("Format not supported");
         return false;
     }
     return true;
@@ -98,7 +98,7 @@
         *uOffset = 2*uvOffset;
         *vOffset = 2*uvOffset;
     } else {
-        LOGE("Format not supported");
+        ALOGE("Format not supported");
         return false;
     }
 
@@ -122,7 +122,7 @@
         *uDataOffsetIncrement = 2*uvDataOffsetIncrement;
         *vDataOffsetIncrement = 2*uvDataOffsetIncrement;
     } else {
-        LOGE("Format not supported");
+        ALOGE("Format not supported");
         return false;
     }
 
diff --git a/media/mediaserver/main_mediaserver.cpp b/media/mediaserver/main_mediaserver.cpp
index b5f85f9..21496a9 100644
--- a/media/mediaserver/main_mediaserver.cpp
+++ b/media/mediaserver/main_mediaserver.cpp
@@ -31,7 +31,7 @@
 {
     sp<ProcessState> proc(ProcessState::self());
     sp<IServiceManager> sm = defaultServiceManager();
-    LOGI("ServiceManager: %p", sm.get());
+    ALOGI("ServiceManager: %p", sm.get());
     AudioFlinger::instantiate();
     MediaPlayerService::instantiate();
     CameraService::instantiate();
diff --git a/media/mtp/MtpDataPacket.cpp b/media/mtp/MtpDataPacket.cpp
index cfea7e8..930f0b0 100644
--- a/media/mtp/MtpDataPacket.cpp
+++ b/media/mtp/MtpDataPacket.cpp
@@ -418,7 +418,7 @@
 // Queue a read request.  Call readDataWait to wait for result
 int MtpDataPacket::readDataAsync(struct usb_request *req) {
     if (usb_request_queue(req)) {
-        LOGE("usb_endpoint_queue failed, errno: %d", errno);
+        ALOGE("usb_endpoint_queue failed, errno: %d", errno);
         return -1;
     }
     return 0;
diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp
index b370225..bf7795c 100644
--- a/media/mtp/MtpDevice.cpp
+++ b/media/mtp/MtpDevice.cpp
@@ -53,7 +53,7 @@
 MtpDevice* MtpDevice::open(const char* deviceName, int fd) {
     struct usb_device *device = usb_device_new(deviceName, fd);
     if (!device) {
-        LOGE("usb_device_new failed for %s", deviceName);
+        ALOGE("usb_device_new failed for %s", deviceName);
         return NULL;
     }
 
@@ -134,7 +134,7 @@
             for (int i = 0; i < 3; i++) {
                 ep = (struct usb_endpoint_descriptor *)usb_descriptor_iter_next(&iter);
                 if (!ep || ep->bDescriptorType != USB_DT_ENDPOINT) {
-                    LOGE("endpoints not found\n");
+                    ALOGE("endpoints not found\n");
                     usb_device_close(device);
                     return NULL;
                 }
@@ -149,13 +149,13 @@
                 }
             }
             if (!ep_in_desc || !ep_out_desc || !ep_intr_desc) {
-                LOGE("endpoints not found\n");
+                ALOGE("endpoints not found\n");
                 usb_device_close(device);
                 return NULL;
             }
 
             if (usb_device_claim_interface(device, interface->bInterfaceNumber)) {
-                LOGE("usb_device_claim_interface failed errno: %d\n", errno);
+                ALOGE("usb_device_claim_interface failed errno: %d\n", errno);
                 usb_device_close(device);
                 return NULL;
             }
@@ -168,7 +168,7 @@
     }
 
     usb_device_close(device);
-    LOGE("device not found");
+    ALOGE("device not found");
     return NULL;
 }
 
@@ -232,7 +232,7 @@
         mDeviceInfo->print();
 
         if (mDeviceInfo->mDeviceProperties) {
-            LOGI("***** DEVICE PROPERTIES *****\n");
+            ALOGI("***** DEVICE PROPERTIES *****\n");
             int count = mDeviceInfo->mDeviceProperties->size();
             for (int i = 0; i < count; i++) {
                 MtpDeviceProperty propCode = (*mDeviceInfo->mDeviceProperties)[i];
@@ -246,11 +246,11 @@
     }
 
     if (mDeviceInfo->mPlaybackFormats) {
-            LOGI("***** OBJECT PROPERTIES *****\n");
+            ALOGI("***** OBJECT PROPERTIES *****\n");
         int count = mDeviceInfo->mPlaybackFormats->size();
         for (int i = 0; i < count; i++) {
             MtpObjectFormat format = (*mDeviceInfo->mPlaybackFormats)[i];
-            LOGI("*** FORMAT: %s\n", MtpDebug::getFormatCodeName(format));
+            ALOGI("*** FORMAT: %s\n", MtpDebug::getFormatCodeName(format));
             MtpObjectPropertyList* props = getObjectPropsSupported(format);
             if (props) {
                 for (int j = 0; j < props->size(); j++) {
@@ -260,7 +260,7 @@
                         property->print();
                         delete property;
                     } else {
-                        LOGE("could not fetch property: %s",
+                        ALOGE("could not fetch property: %s",
                                 MtpDebug::getObjectPropCodeName(prop));
                     }
                 }
@@ -584,7 +584,7 @@
             && mData.readDataHeader(mRequestIn1)) {
         uint32_t length = mData.getContainerLength();
         if (length - MTP_CONTAINER_HEADER_SIZE != objectSize) {
-            LOGE("readObject error objectSize: %d, length: %d",
+            ALOGE("readObject error objectSize: %d, length: %d",
                     objectSize, length);
             goto fail;
         }
@@ -617,7 +617,7 @@
                 // queue up a read request
                 req->buffer_length = (remaining > sizeof(buffer1) ? sizeof(buffer1) : remaining);
                 if (mData.readDataAsync(req)) {
-                    LOGE("readDataAsync failed");
+                    ALOGE("readDataAsync failed");
                     goto fail;
                 }
             } else {
@@ -627,7 +627,7 @@
             if (writeBuffer) {
                 // write previous buffer
                 if (!callback(writeBuffer, offset, writeLength, clientData)) {
-                    LOGE("write failed");
+                    ALOGE("write failed");
                     // wait for pending read before failing
                     if (req)
                         mData.readDataWait(mDevice);
@@ -669,7 +669,7 @@
     ALOGD("readObject: %s", destPath);
     int fd = ::open(destPath, O_RDWR | O_CREAT | O_TRUNC);
     if (fd < 0) {
-        LOGE("open failed for %s", destPath);
+        ALOGE("open failed for %s", destPath);
         return false;
     }
 
@@ -718,7 +718,7 @@
                 // queue up a read request
                 req->buffer_length = (remaining > sizeof(buffer1) ? sizeof(buffer1) : remaining);
                 if (mData.readDataAsync(req)) {
-                    LOGE("readDataAsync failed");
+                    ALOGE("readDataAsync failed");
                     goto fail;
                 }
             } else {
@@ -728,7 +728,7 @@
             if (writeBuffer) {
                 // write previous buffer
                 if (write(fd, writeBuffer, writeLength) != writeLength) {
-                    LOGE("write failed");
+                    ALOGE("write failed");
                     // wait for pending read before failing
                     if (req)
                         mData.readDataWait(mDevice);
diff --git a/media/mtp/MtpPacket.cpp b/media/mtp/MtpPacket.cpp
index 39815d4..dd07843 100644
--- a/media/mtp/MtpPacket.cpp
+++ b/media/mtp/MtpPacket.cpp
@@ -36,7 +36,7 @@
 {
     mBuffer = (uint8_t *)malloc(bufferSize);
     if (!mBuffer) {
-        LOGE("out of memory!");
+        ALOGE("out of memory!");
         abort();
     }
 }
@@ -57,7 +57,7 @@
         int newLength = length + mAllocationIncrement;
         mBuffer = (uint8_t *)realloc(mBuffer, newLength);
         if (!mBuffer) {
-            LOGE("out of memory!");
+            ALOGE("out of memory!");
             abort();
         }
         mBufferSize = newLength;
@@ -134,7 +134,7 @@
 
 uint32_t MtpPacket::getParameter(int index) const {
     if (index < 1 || index > 5) {
-        LOGE("index %d out of range in MtpPacket::getParameter", index);
+        ALOGE("index %d out of range in MtpPacket::getParameter", index);
         return 0;
     }
     return getUInt32(MTP_CONTAINER_PARAMETER_OFFSET + (index - 1) * sizeof(uint32_t));
@@ -142,7 +142,7 @@
 
 void MtpPacket::setParameter(int index, uint32_t value) {
     if (index < 1 || index > 5) {
-        LOGE("index %d out of range in MtpPacket::setParameter", index);
+        ALOGE("index %d out of range in MtpPacket::setParameter", index);
         return;
     }
     int offset = MTP_CONTAINER_PARAMETER_OFFSET + (index - 1) * sizeof(uint32_t);
diff --git a/media/mtp/MtpProperty.cpp b/media/mtp/MtpProperty.cpp
index 8016c35..64dd45b 100644
--- a/media/mtp/MtpProperty.cpp
+++ b/media/mtp/MtpProperty.cpp
@@ -91,7 +91,7 @@
                 mDefaultValue.u.u64 = defaultValue;
                 break;
             default:
-                LOGE("unknown type %04X in MtpProperty::MtpProperty", type);
+                ALOGE("unknown type %04X in MtpProperty::MtpProperty", type);
         }
     }
 }
@@ -267,7 +267,7 @@
             mStepSize.u.u64 = step;
             break;
         default:
-            LOGE("unsupported type for MtpProperty::setRange");
+            ALOGE("unsupported type for MtpProperty::setRange");
             break;
     }
 }
@@ -306,7 +306,7 @@
                     mEnumValues[i].u.u64 = value;
                     break;
                 default:
-                    LOGE("unsupported type for MtpProperty::setEnum");
+                    ALOGE("unsupported type for MtpProperty::setEnum");
                     break;
         }
     }
@@ -320,18 +320,18 @@
     MtpString buffer;
     bool deviceProp = isDeviceProperty();
     if (deviceProp)
-        LOGI("    %s (%04X)", MtpDebug::getDevicePropCodeName(mCode), mCode);
+        ALOGI("    %s (%04X)", MtpDebug::getDevicePropCodeName(mCode), mCode);
     else
-        LOGI("    %s (%04X)", MtpDebug::getObjectPropCodeName(mCode), mCode);
-    LOGI("    type %04X", mType);
-    LOGI("    writeable %s", (mWriteable ? "true" : "false"));
+        ALOGI("    %s (%04X)", MtpDebug::getObjectPropCodeName(mCode), mCode);
+    ALOGI("    type %04X", mType);
+    ALOGI("    writeable %s", (mWriteable ? "true" : "false"));
     buffer = "    default value: ";
     print(mDefaultValue, buffer);
-    LOGI("%s", (const char *)buffer);
+    ALOGI("%s", (const char *)buffer);
     if (deviceProp) {
         buffer = "    current value: ";
         print(mCurrentValue, buffer);
-        LOGI("%s", (const char *)buffer);
+        ALOGI("%s", (const char *)buffer);
     }
     switch (mFormFlag) {
         case kFormNone:
@@ -344,7 +344,7 @@
             buffer += ", ";
             print(mStepSize, buffer);
             buffer += ")";
-            LOGI("%s", (const char *)buffer);
+            ALOGI("%s", (const char *)buffer);
             break;
         case kFormEnum:
             buffer = "    Enum { ";
@@ -353,13 +353,13 @@
                 buffer += " ";
             }
             buffer += "}";
-            LOGI("%s", (const char *)buffer);
+            ALOGI("%s", (const char *)buffer);
             break;
         case kFormDateTime:
-            LOGI("    DateTime\n");
+            ALOGI("    DateTime\n");
             break;
         default:
-            LOGI("    form %d\n", mFormFlag);
+            ALOGI("    form %d\n", mFormFlag);
             break;
     }
 }
@@ -402,7 +402,7 @@
             buffer.appendFormat("%s", value.str);
             break;
         default:
-            LOGE("unsupported type for MtpProperty::print\n");
+            ALOGE("unsupported type for MtpProperty::print\n");
             break;
     }
 }
@@ -456,7 +456,7 @@
             value.str = strdup(stringBuffer);
             break;
         default:
-            LOGE("unknown type %04X in MtpProperty::readValue", mType);
+            ALOGE("unknown type %04X in MtpProperty::readValue", mType);
     }
 }
 
@@ -511,7 +511,7 @@
                 packet.putEmptyString();
             break;
         default:
-            LOGE("unknown type %04X in MtpProperty::writeValue", mType);
+            ALOGE("unknown type %04X in MtpProperty::writeValue", mType);
     }
 }
 
diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp
index 838c13e..5606187 100644
--- a/media/mtp/MtpServer.cpp
+++ b/media/mtp/MtpServer.cpp
@@ -179,7 +179,7 @@
         if (dataIn) {
             int ret = mData.read(fd);
             if (ret < 0) {
-                LOGE("data read returned %d, errno: %d", ret, errno);
+                ALOGE("data read returned %d, errno: %d", ret, errno);
                 if (errno == ECANCELED) {
                     // return to top of loop and wait for next command
                     continue;
@@ -200,7 +200,7 @@
                 mData.dump();
                 ret = mData.write(fd);
                 if (ret < 0) {
-                    LOGE("request write returned %d, errno: %d", ret, errno);
+                    ALOGE("request write returned %d, errno: %d", ret, errno);
                     if (errno == ECANCELED) {
                         // return to top of loop and wait for next command
                         continue;
@@ -214,7 +214,7 @@
             ret = mResponse.write(fd);
             mResponse.dump();
             if (ret < 0) {
-                LOGE("request write returned %d, errno: %d", ret, errno);
+                ALOGE("request write returned %d, errno: %d", ret, errno);
                 if (errno == ECANCELED) {
                     // return to top of loop and wait for next command
                     continue;
@@ -296,7 +296,7 @@
             return;
         }
     }
-    LOGE("ObjectEdit not found in removeEditObject");
+    ALOGE("ObjectEdit not found in removeEditObject");
 }
 
 void MtpServer::commitEdit(ObjectEdit* edit) {
@@ -314,7 +314,7 @@
 
     if (mSendObjectHandle != kInvalidObjectHandle && operation != MTP_OPERATION_SEND_OBJECT) {
         // FIXME - need to delete mSendObjectHandle from the database
-        LOGE("expected SendObject after SendObjectInfo");
+        ALOGE("expected SendObject after SendObjectInfo");
         mSendObjectHandle = kInvalidObjectHandle;
     }
 
@@ -408,7 +408,7 @@
             response = doEndEditObject();
             break;
         default:
-            LOGE("got unsupported command %s", MtpDebug::getOperationCodeName(operation));
+            ALOGE("got unsupported command %s", MtpDebug::getOperationCodeName(operation));
             response = MTP_RESPONSE_OPERATION_NOT_SUPPORTED;
             break;
     }
@@ -917,7 +917,7 @@
     int ret, initialData;
 
     if (mSendObjectHandle == kInvalidObjectHandle) {
-        LOGE("Expected SendObjectInfo before SendObject");
+        ALOGE("Expected SendObjectInfo before SendObject");
         result = MTP_RESPONSE_NO_VALID_OBJECT_INFO;
         goto done;
     }
@@ -984,7 +984,7 @@
     char pathbuf[PATH_MAX];
     int pathLength = strlen(path);
     if (pathLength >= sizeof(pathbuf) - 1) {
-        LOGE("path too long: %s\n", path);
+        ALOGE("path too long: %s\n", path);
     }
     strcpy(pathbuf, path);
     if (pathbuf[pathLength - 1] != '/') {
@@ -995,7 +995,7 @@
 
     DIR* dir = opendir(path);
     if (!dir) {
-        LOGE("opendir %s failed: %s", path, strerror(errno));
+        ALOGE("opendir %s failed: %s", path, strerror(errno));
         return;
     }
 
@@ -1010,7 +1010,7 @@
 
         int nameLength = strlen(name);
         if (nameLength > pathRemaining) {
-            LOGE("path %s/%s too long\n", path, name);
+            ALOGE("path %s/%s too long\n", path, name);
             continue;
         }
         strcpy(fileSpot, name);
@@ -1036,7 +1036,7 @@
             unlink(path);
         }
     } else {
-        LOGE("deletePath stat failed for %s: %s", path, strerror(errno));
+        ALOGE("deletePath stat failed for %s: %s", path, strerror(errno));
     }
 }
 
@@ -1098,7 +1098,7 @@
 
     ObjectEdit* edit = getEditObject(handle);
     if (!edit) {
-        LOGE("object not open for edit in doSendPartialObject");
+        ALOGE("object not open for edit in doSendPartialObject");
         return MTP_RESPONSE_GENERAL_ERROR;
     }
 
@@ -1155,7 +1155,7 @@
     MtpObjectHandle handle = mRequest.getParameter(1);
     ObjectEdit* edit = getEditObject(handle);
     if (!edit) {
-        LOGE("object not open for edit in doTruncateObject");
+        ALOGE("object not open for edit in doTruncateObject");
         return MTP_RESPONSE_GENERAL_ERROR;
     }
 
@@ -1173,7 +1173,7 @@
 MtpResponseCode MtpServer::doBeginEditObject() {
     MtpObjectHandle handle = mRequest.getParameter(1);
     if (getEditObject(handle)) {
-        LOGE("object already open for edit in doBeginEditObject");
+        ALOGE("object already open for edit in doBeginEditObject");
         return MTP_RESPONSE_GENERAL_ERROR;
     }
 
@@ -1186,7 +1186,7 @@
 
     int fd = open((const char *)path, O_RDWR | O_EXCL);
     if (fd < 0) {
-        LOGE("open failed for %s in doBeginEditObject (%d)", (const char *)path, errno);
+        ALOGE("open failed for %s in doBeginEditObject (%d)", (const char *)path, errno);
         return MTP_RESPONSE_GENERAL_ERROR;
     }
 
@@ -1198,7 +1198,7 @@
     MtpObjectHandle handle = mRequest.getParameter(1);
     ObjectEdit* edit = getEditObject(handle);
     if (!edit) {
-        LOGE("object not open for edit in doEndEditObject");
+        ALOGE("object not open for edit in doEndEditObject");
         return MTP_RESPONSE_GENERAL_ERROR;
     }
 
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 8255823..72525cd 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -40,6 +40,7 @@
 #include <media/AudioTrack.h>
 #include <media/AudioRecord.h>
 #include <media/IMediaPlayerService.h>
+#include <media/IMediaDeathNotifier.h>
 
 #include <private/media/AudioTrackShared.h>
 #include <private/media/AudioEffectShared.h>
@@ -105,24 +106,22 @@
 static bool recordingAllowed() {
     if (getpid() == IPCThreadState::self()->getCallingPid()) return true;
     bool ok = checkCallingPermission(String16("android.permission.RECORD_AUDIO"));
-    if (!ok) LOGE("Request requires android.permission.RECORD_AUDIO");
+    if (!ok) ALOGE("Request requires android.permission.RECORD_AUDIO");
     return ok;
 }
 
 static bool settingsAllowed() {
     if (getpid() == IPCThreadState::self()->getCallingPid()) return true;
     bool ok = checkCallingPermission(String16("android.permission.MODIFY_AUDIO_SETTINGS"));
-    if (!ok) LOGE("Request requires android.permission.MODIFY_AUDIO_SETTINGS");
+    if (!ok) ALOGE("Request requires android.permission.MODIFY_AUDIO_SETTINGS");
     return ok;
 }
 
 // To collect the amplifier usage
 static void addBatteryData(uint32_t params) {
-    sp<IBinder> binder =
-        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");
+    sp<IMediaPlayerService> service = IMediaDeathNotifier::getMediaPlayerService();
+    if (service == NULL) {
+        // it already logged
         return;
     }
 
@@ -139,7 +138,7 @@
         goto out;
 
     rc = audio_hw_device_open(*mod, dev);
-    LOGE_IF(rc, "couldn't open audio hw device in %s.%s (%s)",
+    ALOGE_IF(rc, "couldn't open audio hw device in %s.%s (%s)",
             AUDIO_HARDWARE_MODULE_ID, if_name, strerror(-rc));
     if (rc)
         goto out;
@@ -185,13 +184,13 @@
         if (rc)
             continue;
 
-        LOGI("Loaded %s audio interface from %s (%s)", audio_interfaces[i],
+        ALOGI("Loaded %s audio interface from %s (%s)", audio_interfaces[i],
              mod->name, mod->id);
         mAudioHwDevs.push(dev);
 
         if (!mPrimaryHardwareDev) {
             mPrimaryHardwareDev = dev;
-            LOGI("Using '%s' (%s.%s) as the primary audio interface",
+            ALOGI("Using '%s' (%s.%s) as the primary audio interface",
                  mod->name, mod->id, audio_interfaces[i]);
         }
     }
@@ -199,7 +198,7 @@
     mHardwareStatus = AUDIO_HW_INIT;
 
     if (!mPrimaryHardwareDev || mAudioHwDevs.size() == 0) {
-        LOGE("Primary audio interface not found");
+        ALOGE("Primary audio interface not found");
         return;
     }
 
@@ -400,7 +399,7 @@
     int lSessionId;
 
     if (streamType >= AUDIO_STREAM_CNT) {
-        LOGE("createTrack() invalid stream type %d", streamType);
+        ALOGE("createTrack() invalid stream type %d", streamType);
         lStatus = BAD_VALUE;
         goto Exit;
     }
@@ -410,7 +409,7 @@
         PlaybackThread *thread = checkPlaybackThread_l(output);
         PlaybackThread *effectThread = NULL;
         if (thread == NULL) {
-            LOGE("unknown output thread");
+            ALOGE("unknown output thread");
             lStatus = BAD_VALUE;
             goto Exit;
         }
@@ -432,7 +431,7 @@
                     // prevent same audio session on different output threads
                     uint32_t sessions = t->hasAudioSession(*sessionId);
                     if (sessions & PlaybackThread::TRACK_SESSION) {
-                        LOGE("createTrack() session ID %d already in use", *sessionId);
+                        ALOGE("createTrack() session ID %d already in use", *sessionId);
                         lStatus = BAD_VALUE;
                         goto Exit;
                     }
@@ -484,7 +483,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 +494,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 +505,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 +516,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 +527,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 +575,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;
     }
 
@@ -663,7 +662,7 @@
     }
 
     if (stream < 0 || uint32_t(stream) >= AUDIO_STREAM_CNT) {
-        LOGE("setStreamVolume() invalid stream %d", stream);
+        ALOGE("setStreamVolume() invalid stream %d", stream);
         return BAD_VALUE;
     }
 
@@ -698,7 +697,7 @@
 
     if (stream < 0 || uint32_t(stream) >= AUDIO_STREAM_CNT ||
         uint32_t(stream) == AUDIO_STREAM_ENFORCED_AUDIBLE) {
-        LOGE("setStreamMute() invalid stream %d", stream);
+        ALOGE("setStreamMute() invalid stream %d", stream);
         return BAD_VALUE;
     }
 
@@ -1180,7 +1179,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 +1227,7 @@
     if (thread != 0) {
         thread->clearPowerManager();
     }
-    LOGW("power manager service died !!!");
+    ALOGW("power manager service died !!!");
 }
 
 void AudioFlinger::ThreadBase::setEffectSuspended(
@@ -1469,9 +1468,9 @@
 {
     status_t status = initCheck();
     if (status == NO_ERROR) {
-        LOGI("AudioFlinger's thread %p ready to run", this);
+        ALOGI("AudioFlinger's thread %p ready to run", this);
     } else {
-        LOGE("No working audio driver found.");
+        ALOGE("No working audio driver found.");
     }
     return status;
 }
@@ -1499,7 +1498,7 @@
     if (mType == DIRECT) {
         if ((format & AUDIO_FORMAT_MAIN_MASK) == AUDIO_FORMAT_PCM) {
             if (sampleRate != mSampleRate || format != mFormat || channelMask != mChannelMask) {
-                LOGE("createTrack_l() Bad parameter: sampleRate %d format %d, channelMask 0x%08x \""
+                ALOGE("createTrack_l() Bad parameter: sampleRate %d format %d, channelMask 0x%08x \""
                         "for output %p with format %d",
                         sampleRate, format, channelMask, mOutput, mFormat);
                 lStatus = BAD_VALUE;
@@ -1509,7 +1508,7 @@
     } else {
         // Resampler implementation limits input sampling rate to 2 x output sampling rate.
         if (sampleRate > mSampleRate*2) {
-            LOGE("Sample rate out of range: %d mSampleRate %d", sampleRate, mSampleRate);
+            ALOGE("Sample rate out of range: %d mSampleRate %d", sampleRate, mSampleRate);
             lStatus = BAD_VALUE;
             goto Exit;
         }
@@ -1517,7 +1516,7 @@
 
     lStatus = initCheck();
     if (lStatus != NO_ERROR) {
-        LOGE("Audio driver not initialized.");
+        ALOGE("Audio driver not initialized.");
         goto Exit;
     }
 
@@ -1534,7 +1533,7 @@
             if (t != 0) {
                 uint32_t actual = AudioSystem::getStrategyForStream((audio_stream_type_t)t->type());
                 if (sessionId == t->sessionId() && strategy != actual) {
-                    LOGE("createTrack_l() mismatched strategy; expected %u but found %u",
+                    ALOGE("createTrack_l() mismatched strategy; expected %u but found %u",
                             strategy, actual);
                     lStatus = BAD_VALUE;
                     goto Exit;
@@ -1561,7 +1560,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);
         }
@@ -1847,7 +1846,7 @@
 
     // FIXME - Current mixer implementation only supports stereo output
     if (mChannelCount == 1) {
-        LOGE("Invalid audio hardware channel count");
+        ALOGE("Invalid audio hardware channel count");
     }
 }
 
@@ -1897,7 +1896,7 @@
                 double minimum = stats.minimum();
                 double maximum = stats.maximum();
                 cpu.resetStatistics();
-                LOGI("CPU usage over past %.1f secs (%u mixer loops at %.1f mean ms per loop):\n  us per mix loop: mean=%.0f stddev=%.0f min=%.0f max=%.0f\n  %% of wall: mean=%.1f stddev=%.1f min=%.1f max=%.1f",
+                ALOGI("CPU usage over past %.1f secs (%u mixer loops at %.1f mean ms per loop):\n  us per mix loop: mean=%.0f stddev=%.0f min=%.0f max=%.0f\n  %% of wall: mean=%.1f stddev=%.1f min=%.1f max=%.1f",
                         elapsed * .000000001, n, perLoop * .000001,
                         mean * .001,
                         stddev * .001,
@@ -2038,7 +2037,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;
                 }
@@ -2102,12 +2101,13 @@
         sp<Track> t = activeTracks[i].promote();
         if (t == 0) continue;
 
+        // this const just means the local variable doesn't change
         Track* const track = t.get();
         audio_track_cblk_t* cblk = track->cblk();
 
         // The first time a track is added we wait
         // for all its buffers to be filled before processing it
-        mAudioMixer->setActiveTrack(track->name());
+        int name = track->name();
         // make sure that we have enough frames to mix one full buffer.
         // enforce this condition only once to enable draining the buffer in case the client
         // app does not call stop() and relies on underrun to stop:
@@ -2133,7 +2133,7 @@
         if ((cblk->framesReady() >= minFrames) && track->isReady() &&
                 !track->isPaused() && !track->isTerminated())
         {
-            //ALOGV("track %d u=%08x, s=%08x [OK] on thread %p", track->name(), cblk->user, cblk->server, this);
+            //ALOGV("track %d u=%08x, s=%08x [OK] on thread %p", name, cblk->user, cblk->server, this);
 
             mixedTracks++;
 
@@ -2146,8 +2146,8 @@
                 if (chain != 0) {
                     tracksWithEffect++;
                 } else {
-                    LOGW("prepareTracks_l(): track %08x attached to effect but no chain found on session %d",
-                            track->name(), track->sessionId());
+                    ALOGW("prepareTracks_l(): track %d attached to effect but no chain found on session %d",
+                            name, track->sessionId());
                 }
             }
 
@@ -2160,7 +2160,7 @@
                     track->mState = TrackBase::ACTIVE;
                     param = AudioMixer::RAMP_VOLUME;
                 }
-                mAudioMixer->setParameter(AudioMixer::RESAMPLE, AudioMixer::RESET, NULL);
+                mAudioMixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::RESET, NULL);
             } else if (cblk->server != 0) {
                 // If the track is stopped before the first frame was mixed,
                 // do not apply ramp
@@ -2212,26 +2212,31 @@
             aux = int16_t(va);
 
             // XXX: these things DON'T need to be done each time
-            mAudioMixer->setBufferProvider(track);
-            mAudioMixer->enable();
+            mAudioMixer->setBufferProvider(name, track);
+            mAudioMixer->enable(name);
 
-            mAudioMixer->setParameter(param, AudioMixer::VOLUME0, (void *)left);
-            mAudioMixer->setParameter(param, AudioMixer::VOLUME1, (void *)right);
-            mAudioMixer->setParameter(param, AudioMixer::AUXLEVEL, (void *)aux);
+            mAudioMixer->setParameter(name, param, AudioMixer::VOLUME0, (void *)left);
+            mAudioMixer->setParameter(name, param, AudioMixer::VOLUME1, (void *)right);
+            mAudioMixer->setParameter(name, param, AudioMixer::AUXLEVEL, (void *)aux);
             mAudioMixer->setParameter(
+                name,
                 AudioMixer::TRACK,
                 AudioMixer::FORMAT, (void *)track->format());
             mAudioMixer->setParameter(
+                name,
                 AudioMixer::TRACK,
                 AudioMixer::CHANNEL_MASK, (void *)track->channelMask());
             mAudioMixer->setParameter(
+                name,
                 AudioMixer::RESAMPLE,
                 AudioMixer::SAMPLE_RATE,
                 (void *)(cblk->sampleRate));
             mAudioMixer->setParameter(
+                name,
                 AudioMixer::TRACK,
                 AudioMixer::MAIN_BUFFER, (void *)track->mainBuffer());
             mAudioMixer->setParameter(
+                name,
                 AudioMixer::TRACK,
                 AudioMixer::AUX_BUFFER, (void *)track->auxBuffer());
 
@@ -2239,7 +2244,7 @@
             track->mRetryCount = kMaxTrackRetries;
             mixerStatus = MIXER_TRACKS_READY;
         } else {
-            //ALOGV("track %d u=%08x, s=%08x [NOT READY] on thread %p", track->name(), cblk->user, cblk->server, this);
+            //ALOGV("track %d u=%08x, s=%08x [NOT READY] on thread %p", name, cblk->user, cblk->server, this);
             if (track->isStopped()) {
                 track->reset();
             }
@@ -2251,7 +2256,7 @@
                 // No buffers for this track. Give it a few chances to
                 // fill a buffer, then remove it from active list.
                 if (--(track->mRetryCount) <= 0) {
-                    ALOGV("BUFFER TIMEOUT: remove(%d) from active list on thread %p", track->name(), this);
+                    ALOGV("BUFFER TIMEOUT: remove(%d) from active list on thread %p", name, this);
                     tracksToRemove->add(track);
                     // indicate to client process that the track was disabled because of underrun
                     android_atomic_or(CBLK_DISABLED_ON, &cblk->flags);
@@ -2259,7 +2264,7 @@
                     mixerStatus = MIXER_TRACKS_ENABLED;
                 }
             }
-            mAudioMixer->disable();
+            mAudioMixer->disable(name);
         }
     }
 
@@ -3158,7 +3163,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();
@@ -3232,7 +3237,7 @@
                 mBufferEnd = (uint8_t *)mBuffer + bufferSize;
             }
         } else {
-            LOGE("not enough memory for AudioTrack size=%u", size);
+            ALOGE("not enough memory for AudioTrack size=%u", size);
             client->heap()->dump("AudioTrack");
             return;
         }
@@ -3326,7 +3331,7 @@
     // Check validity of returned pointer in case the track control block would have been corrupted.
     if (bufferStart < mBuffer || bufferStart > bufferEnd || bufferEnd > mBufferEnd ||
         ((unsigned long)bufferStart & (unsigned long)(cblk->frameSize - 1))) {
-        LOGE("TrackBase::getBuffer buffer out of range:\n    start: %p, end %p , mBuffer %p mBufferEnd %p\n    \
+        ALOGE("TrackBase::getBuffer buffer out of range:\n    start: %p, end %p , mBuffer %p mBufferEnd %p\n    \
                 server %d, serverBase %d, user %d, userBase %d",
                 bufferStart, bufferEnd, mBuffer, mBufferEnd,
                 cblk->server, cblk->serverBase, cblk->user, cblk->userBase);
@@ -3362,7 +3367,7 @@
         }
         ALOGV("Track constructor name %d, calling thread %d", mName, IPCThreadState::self()->getCallingPid());
         if (mName < 0) {
-            LOGE("no more track names available");
+            ALOGE("no more track names available");
         }
         mVolume[0] = 1.0f;
         mVolume[1] = 1.0f;
@@ -3789,7 +3794,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);
     }
 }
 
@@ -3844,7 +3849,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);
                 }
             }
         }
@@ -3911,7 +3916,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);
             }
         }
     }
@@ -4254,7 +4259,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;
 }
 
@@ -4374,7 +4379,7 @@
                                 mRsmpInIndex = 0;
                             }
                             if (mBytesRead < 0) {
-                                LOGE("Error reading audio input");
+                                ALOGE("Error reading audio input");
                                 if (mActiveTrack->mState == TrackBase::ACTIVE) {
                                     // Force input into standby so that it tries to
                                     // recover at next read attempt
@@ -4420,7 +4425,7 @@
                 if (!mActiveTrack->setOverflow()) {
                     nsecs_t now = systemTime();
                     if ((now - lastWarning) > kWarningThrottleNs) {
-                        LOGW("RecordThread: buffer overflow");
+                        ALOGW("RecordThread: buffer overflow");
                         lastWarning = now;
                     }
                 }
@@ -4464,7 +4469,7 @@
 
     lStatus = initCheck();
     if (lStatus != NO_ERROR) {
-        LOGE("Audio driver not initialized.");
+        ALOGE("Audio driver not initialized.");
         goto Exit;
     }
 
@@ -4620,7 +4625,7 @@
     if (framesReady == 0) {
         mBytesRead = mInput->stream->read(mInput->stream, mRsmpInBuffer, mInputBytes);
         if (mBytesRead < 0) {
-            LOGE("RecordThread::getNextBuffer() Error reading audio input");
+            ALOGE("RecordThread::getNextBuffer() Error reading audio input");
             if (mActiveTrack->mState == TrackBase::ACTIVE) {
                 // Force input into standby so that it tries to
                 // recover at next read attempt
@@ -4961,7 +4966,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;
     }
 
@@ -5157,7 +5162,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;
     }
 
@@ -5226,7 +5231,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() {
@@ -5437,14 +5442,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;
             }
@@ -5455,13 +5460,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) {
@@ -5478,7 +5483,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
@@ -5539,7 +5544,7 @@
         if (thread == NULL) {
             thread = checkPlaybackThread_l(io);
             if (thread == NULL) {
-                LOGE("createEffect() unknown output thread");
+                ALOGE("createEffect() unknown output thread");
                 lStatus = BAD_VALUE;
                 goto Exit;
             }
@@ -5575,17 +5580,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;
     }
 
@@ -5607,7 +5612,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;
     }
@@ -5637,7 +5642,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;
             }
@@ -5679,14 +5684,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;
@@ -5696,7 +5701,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;
@@ -5805,7 +5810,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;
     }
@@ -5838,7 +5843,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());
     }
 }
 
@@ -6060,7 +6065,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) {
@@ -6702,7 +6707,8 @@
     Mutex::Autolock _l(mLock);
     mSuspended = suspended;
 }
-bool AudioFlinger::EffectModule::suspended()
+
+bool AudioFlinger::EffectModule::suspended() const
 {
     Mutex::Autolock _l(mLock);
     return mSuspended;
@@ -6822,7 +6828,7 @@
             mBuffer = (uint8_t *)mCblk + bufOffset;
          }
     } else {
-        LOGE("not enough memory for Effect size=%u", EFFECT_PARAM_BUFFER_SIZE + sizeof(effect_param_cblk_t));
+        ALOGE("not enough memory for Effect size=%u", EFFECT_PARAM_BUFFER_SIZE + sizeof(effect_param_cblk_t));
         return;
     }
 }
@@ -6957,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;
             }
@@ -7138,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) ||
@@ -7234,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
@@ -7470,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) {
@@ -7517,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) {
@@ -7597,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/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 2c34a94..ff8dedb 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -730,7 +730,7 @@
 
                     void        suspend() { mSuspended++; }
                     void        restore() { if (mSuspended) mSuspended--; }
-                    bool        isSuspended() { return (mSuspended != 0); }
+                    bool        isSuspended() const { return (mSuspended != 0); }
         virtual     String8     getParameters(const String8& keys);
         virtual     void        audioConfigChanged_l(int event, int param = 0);
         virtual     status_t    getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames);
@@ -1115,7 +1115,7 @@
         status_t         start();
         status_t         stop();
         void             setSuspended(bool suspended);
-        bool             suspended();
+        bool             suspended() const;
 
         sp<EffectHandle> controlHandle();
 
@@ -1138,7 +1138,7 @@
         status_t start_l();
         status_t stop_l();
 
-        Mutex               mLock;      // mutex for process, commands and handles list protection
+mutable Mutex               mLock;      // mutex for process, commands and handles list protection
         wp<ThreadBase>      mThread;    // parent thread
         wp<EffectChain>     mChain;     // parent effect chain
         int                 mId;        // this instance unique ID
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 977726f..8df4605 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -41,7 +41,7 @@
 // ----------------------------------------------------------------------------
 
 AudioMixer::AudioMixer(size_t frameCount, uint32_t sampleRate)
-    :   mActiveTrack(0), mTrackNames(0), mSampleRate(sampleRate)
+    :   mTrackNames(0), mSampleRate(sampleRate)
 {
     // AudioMixer is not yet capable of multi-channel beyond stereo
     assert(2 == MAX_NUM_CHANNELS);
@@ -95,16 +95,11 @@
 
 int AudioMixer::getTrackName()
 {
-    uint32_t names = mTrackNames;
-    uint32_t mask = 1;
-    int n = 0;
-    while (names & mask) {
-        mask <<= 1;
-        n++;
-    }
-    if (mask) {
+    uint32_t names = ~mTrackNames;
+    if (names != 0) {
+        int n = __builtin_ctz(names);
         ALOGV("add track (%d)", n);
-        mTrackNames |= mask;
+        mTrackNames |= 1 << n;
         return TRACK0 + n;
     }
     return -1;
@@ -140,120 +135,120 @@
     mTrackNames &= ~(1<<name);
 }
 
-void AudioMixer::enable()
+void AudioMixer::enable(int name)
 {
-    if (mState.tracks[ mActiveTrack ].enabled != 1) {
-        mState.tracks[ mActiveTrack ].enabled = 1;
-        ALOGV("enable(%d)", mActiveTrack);
-        invalidateState(1<<mActiveTrack);
+    name -= TRACK0;
+    assert(uint32_t(name) < MAX_NUM_TRACKS);
+    track_t& track = mState.tracks[name];
+
+    if (track.enabled != 1) {
+        track.enabled = 1;
+        ALOGV("enable(%d)", name);
+        invalidateState(1 << name);
     }
 }
 
-void AudioMixer::disable()
+void AudioMixer::disable(int name)
 {
-    if (mState.tracks[ mActiveTrack ].enabled != 0) {
-        mState.tracks[ mActiveTrack ].enabled = 0;
-        ALOGV("disable(%d)", mActiveTrack);
-        invalidateState(1<<mActiveTrack);
+    name -= TRACK0;
+    assert(uint32_t(name) < MAX_NUM_TRACKS);
+    track_t& track = mState.tracks[name];
+
+    if (track.enabled != 0) {
+        track.enabled = 0;
+        ALOGV("disable(%d)", name);
+        invalidateState(1 << name);
     }
 }
 
-void AudioMixer::setActiveTrack(int track)
+void AudioMixer::setParameter(int name, int target, int param, void *value)
 {
-    // this also catches track < TRACK0
-    track -= TRACK0;
-    assert(uint32_t(track) < MAX_NUM_TRACKS);
-    mActiveTrack = track;
-}
+    name -= TRACK0;
+    assert(uint32_t(name) < MAX_NUM_TRACKS);
+    track_t& track = mState.tracks[name];
 
-void AudioMixer::setParameter(int target, int name, void *value)
-{
     int valueInt = (int)value;
     int32_t *valueBuf = (int32_t *)value;
 
     switch (target) {
 
     case TRACK:
-        switch (name) {
+        switch (param) {
         case CHANNEL_MASK: {
             uint32_t mask = (uint32_t)value;
-            if (mState.tracks[ mActiveTrack ].channelMask != mask) {
+            if (track.channelMask != mask) {
                 uint8_t channelCount = popcount(mask);
                 assert((channelCount <= MAX_NUM_CHANNELS) && (channelCount));
-                mState.tracks[ mActiveTrack ].channelMask = mask;
-                mState.tracks[ mActiveTrack ].channelCount = channelCount;
+                track.channelMask = mask;
+                track.channelCount = channelCount;
                 ALOGV("setParameter(TRACK, CHANNEL_MASK, %x)", mask);
-                invalidateState(1<<mActiveTrack);
+                invalidateState(1 << name);
             }
             } break;
         case MAIN_BUFFER:
-            if (mState.tracks[ mActiveTrack ].mainBuffer != valueBuf) {
-                mState.tracks[ mActiveTrack ].mainBuffer = valueBuf;
+            if (track.mainBuffer != valueBuf) {
+                track.mainBuffer = valueBuf;
                 ALOGV("setParameter(TRACK, MAIN_BUFFER, %p)", valueBuf);
-                invalidateState(1<<mActiveTrack);
+                invalidateState(1 << name);
             }
             break;
         case AUX_BUFFER:
-            if (mState.tracks[ mActiveTrack ].auxBuffer != valueBuf) {
-                mState.tracks[ mActiveTrack ].auxBuffer = valueBuf;
+            if (track.auxBuffer != valueBuf) {
+                track.auxBuffer = valueBuf;
                 ALOGV("setParameter(TRACK, AUX_BUFFER, %p)", valueBuf);
-                invalidateState(1<<mActiveTrack);
+                invalidateState(1 << name);
             }
             break;
         default:
-            // bad name
+            // bad param
             assert(false);
         }
         break;
 
     case RESAMPLE:
-        switch (name) {
-        case SAMPLE_RATE: {
+        switch (param) {
+        case SAMPLE_RATE:
             assert(valueInt > 0);
-            track_t& track = mState.tracks[ mActiveTrack ];
             if (track.setResampler(uint32_t(valueInt), mSampleRate)) {
                 ALOGV("setParameter(RESAMPLE, SAMPLE_RATE, %u)",
                         uint32_t(valueInt));
-                invalidateState(1<<mActiveTrack);
+                invalidateState(1 << name);
             }
-            } break;
-        case RESET: {
-            track_t& track = mState.tracks[ mActiveTrack ];
+            break;
+        case RESET:
             track.resetResampler();
-            invalidateState(1<<mActiveTrack);
-            } break;
+            invalidateState(1 << name);
+            break;
         default:
-            // bad name
+            // bad param
             assert(false);
         }
         break;
 
     case RAMP_VOLUME:
     case VOLUME:
-        switch (name) {
+        switch (param) {
         case VOLUME0:
-        case VOLUME1: {
-            track_t& track = mState.tracks[ mActiveTrack ];
-            if (track.volume[name-VOLUME0] != valueInt) {
+        case VOLUME1:
+            if (track.volume[param-VOLUME0] != valueInt) {
                 ALOGV("setParameter(VOLUME, VOLUME0/1: %04x)", valueInt);
-                track.prevVolume[name-VOLUME0] = track.volume[name-VOLUME0] << 16;
-                track.volume[name-VOLUME0] = valueInt;
+                track.prevVolume[param-VOLUME0] = track.volume[param-VOLUME0] << 16;
+                track.volume[param-VOLUME0] = valueInt;
                 if (target == VOLUME) {
-                    track.prevVolume[name-VOLUME0] = valueInt << 16;
-                    track.volumeInc[name-VOLUME0] = 0;
+                    track.prevVolume[param-VOLUME0] = valueInt << 16;
+                    track.volumeInc[param-VOLUME0] = 0;
                 } else {
-                    int32_t d = (valueInt<<16) - track.prevVolume[name-VOLUME0];
+                    int32_t d = (valueInt<<16) - track.prevVolume[param-VOLUME0];
                     int32_t volInc = d / int32_t(mState.frameCount);
-                    track.volumeInc[name-VOLUME0] = volInc;
+                    track.volumeInc[param-VOLUME0] = volInc;
                     if (volInc == 0) {
-                        track.prevVolume[name-VOLUME0] = valueInt << 16;
+                        track.prevVolume[param-VOLUME0] = valueInt << 16;
                     }
                 }
-                invalidateState(1<<mActiveTrack);
+                invalidateState(1 << name);
             }
-            } break;
-        case AUXLEVEL: {
-            track_t& track = mState.tracks[ mActiveTrack ];
+            break;
+        case AUXLEVEL:
             if (track.auxLevel != valueInt) {
                 ALOGV("setParameter(VOLUME, AUXLEVEL: %04x)", valueInt);
                 track.prevAuxLevel = track.auxLevel << 16;
@@ -269,11 +264,11 @@
                         track.prevAuxLevel = valueInt << 16;
                     }
                 }
-                invalidateState(1<<mActiveTrack);
+                invalidateState(1 << name);
             }
-            } break;
+            break;
         default:
-            // bad name
+            // bad param
             assert(false);
         }
         break;
@@ -348,9 +343,11 @@
     return 0;
 }
 
-void AudioMixer::setBufferProvider(AudioBufferProvider* buffer)
+void AudioMixer::setBufferProvider(int name, AudioBufferProvider* buffer)
 {
-    mState.tracks[ mActiveTrack ].bufferProvider = buffer;
+    name -= TRACK0;
+    assert(uint32_t(name) < MAX_NUM_TRACKS);
+    mState.tracks[name].bufferProvider = buffer;
 }
 
 
@@ -363,7 +360,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;
@@ -1003,7 +1000,7 @@
         // been enabled for mixing.
         if (in == NULL || ((unsigned long)in & 3)) {
             memset(out, 0, numFrames*MAX_NUM_CHANNELS*sizeof(int16_t));
-            LOGE_IF(((unsigned long)in & 3), "process stereo track: input buffer alignment pb: buffer %p track %d, channels %d, needs %08x",
+            ALOGE_IF(((unsigned long)in & 3), "process stereo track: input buffer alignment pb: buffer %p track %d, channels %d, needs %08x",
                     in, i, t.channelCount, t.needs);
             return;
         }
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index cd70340..84f6330 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -42,7 +42,7 @@
 
     enum { // names
 
-        // track units (MAX_NUM_TRACKS units)
+        // track names (MAX_NUM_TRACKS units)
         TRACK0          = 0x1000,
 
         // 0x2000 is unused
@@ -69,16 +69,16 @@
     };
 
 
+    // For all APIs with "name": TRACK0 <= name < TRACK0 + MAX_NUM_TRACKS
     int         getTrackName();
     void        deleteTrackName(int name);
 
-    void        enable();
-    void        disable();
+    void        enable(int name);
+    void        disable(int name);
 
-    void        setActiveTrack(int track);
-    void        setParameter(int target, int name, void *value);
+    void        setParameter(int name, int target, int param, void *value);
 
-    void        setBufferProvider(AudioBufferProvider* bufferProvider);
+    void        setBufferProvider(int name, AudioBufferProvider* bufferProvider);
     void        process();
 
     uint32_t    trackNames() const { return mTrackNames; }
@@ -171,7 +171,7 @@
         track_t         tracks[MAX_NUM_TRACKS]; __attribute__((aligned(32)));
     };
 
-    int             mActiveTrack;
+    // bitmask of allocated track names, where bit 0 corresponds to TRACK0 etc.
     uint32_t        mTrackNames;
     const uint32_t  mSampleRate;
 
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index bc4c90c..f572fce 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -52,7 +52,7 @@
 static bool checkPermission() {
     if (getpid() == IPCThreadState::self()->getCallingPid()) return true;
     bool ok = checkCallingPermission(String16("android.permission.MODIFY_AUDIO_SETTINGS"));
-    if (!ok) LOGE("Request requires android.permission.MODIFY_AUDIO_SETTINGS");
+    if (!ok) ALOGE("Request requires android.permission.MODIFY_AUDIO_SETTINGS");
     return ok;
 }
 
@@ -83,18 +83,18 @@
         return;
 
     rc = audio_policy_dev_open(module, &mpAudioPolicyDev);
-    LOGE_IF(rc, "couldn't open audio policy device (%s)", strerror(-rc));
+    ALOGE_IF(rc, "couldn't open audio policy device (%s)", strerror(-rc));
     if (rc)
         return;
 
     rc = mpAudioPolicyDev->create_audio_policy(mpAudioPolicyDev, &aps_ops, this,
                                                &mpAudioPolicy);
-    LOGE_IF(rc, "couldn't create audio policy (%s)", strerror(-rc));
+    ALOGE_IF(rc, "couldn't create audio policy (%s)", strerror(-rc));
     if (rc)
         return;
 
     rc = mpAudioPolicy->init_check(mpAudioPolicy);
-    LOGE_IF(rc, "couldn't init_check the audio policy (%s)", strerror(-rc));
+    ALOGE_IF(rc, "couldn't init_check the audio policy (%s)", strerror(-rc));
     if (rc)
         return;
 
@@ -102,7 +102,7 @@
     forced_val = strtol(value, NULL, 0);
     mpAudioPolicy->set_can_mute_enforced_audible(mpAudioPolicy, !forced_val);
 
-    LOGI("Loaded audio policy from %s (%s)", module->name, module->id);
+    ALOGI("Loaded audio policy from %s (%s)", module->name, module->id);
 
     // load audio pre processing modules
     if (access(AUDIO_EFFECT_VENDOR_CONFIG_FILE, R_OK) == 0) {
@@ -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;
@@ -1027,9 +1027,9 @@
                                   audio_stream_type_t stream)
 {
     if (tone != AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION)
-        LOGE("startTone: illegal tone requested (%d)", tone);
+        ALOGE("startTone: illegal tone requested (%d)", tone);
     if (stream != AUDIO_STREAM_VOICE_CALL)
-        LOGE("startTone: illegal stream (%d) requested for tone %d", stream,
+        ALOGE("startTone: illegal stream (%d) requested for tone %d", stream,
              tone);
     mTonePlaybackThread->startToneCommand(ToneGenerator::TONE_SUP_CALL_WAITING,
                                           AUDIO_STREAM_VOICE_CALL);
@@ -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/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index 7205045..fbdcb62 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -121,7 +121,7 @@
             mPhaseFraction(0) {
     // sanity check on format
     if ((bitDepth != 16) ||(inChannelCount < 1) || (inChannelCount > 2)) {
-        LOGE("Unsupported sample format, %d bits, %d channels", bitDepth,
+        ALOGE("Unsupported sample format, %d bits, %d channels", bitDepth,
                 inChannelCount);
         // LOG_ASSERT(0);
     }
@@ -190,7 +190,7 @@
     size_t outputSampleCount = outFrameCount * 2;
     size_t inFrameCount = (outFrameCount*mInSampleRate)/mSampleRate;
 
-    // LOGE("starting resample %d frames, inputIndex=%d, phaseFraction=%d, phaseIncrement=%d\n",
+    // ALOGE("starting resample %d frames, inputIndex=%d, phaseFraction=%d, phaseIncrement=%d\n",
     //      outFrameCount, inputIndex, phaseFraction, phaseIncrement);
 
     while (outputIndex < outputSampleCount) {
@@ -203,7 +203,7 @@
                 goto resampleStereo16_exit;
             }
 
-            // LOGE("New buffer fetched: %d frames\n", mBuffer.frameCount);
+            // ALOGE("New buffer fetched: %d frames\n", mBuffer.frameCount);
             if (mBuffer.frameCount > inputIndex) break;
 
             inputIndex -= mBuffer.frameCount;
@@ -217,7 +217,7 @@
 
         // handle boundary case
         while (inputIndex == 0) {
-            // LOGE("boundary case\n");
+            // ALOGE("boundary case\n");
             out[outputIndex++] += vl * Interp(mX0L, in[0], phaseFraction);
             out[outputIndex++] += vr * Interp(mX0R, in[1], phaseFraction);
             Advance(&inputIndex, &phaseFraction, phaseIncrement);
@@ -226,7 +226,7 @@
         }
 
         // process input samples
-        // LOGE("general case\n");
+        // ALOGE("general case\n");
 
 #ifdef ASM_ARM_RESAMP1  // asm optimisation for ResamplerOrder1
         if (inputIndex + 2 < mBuffer.frameCount) {
@@ -248,13 +248,13 @@
             Advance(&inputIndex, &phaseFraction, phaseIncrement);
         }
 
-        // LOGE("loop done - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
+        // ALOGE("loop done - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
 
         // if done with buffer, save samples
         if (inputIndex >= mBuffer.frameCount) {
             inputIndex -= mBuffer.frameCount;
 
-            // LOGE("buffer done, new input index %d", inputIndex);
+            // ALOGE("buffer done, new input index %d", inputIndex);
 
             mX0L = mBuffer.i16[mBuffer.frameCount*2-2];
             mX0R = mBuffer.i16[mBuffer.frameCount*2-1];
@@ -265,7 +265,7 @@
         }
     }
 
-    // LOGE("output buffer full - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
+    // ALOGE("output buffer full - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
 
 resampleStereo16_exit:
     // save state
@@ -286,7 +286,7 @@
     size_t outputSampleCount = outFrameCount * 2;
     size_t inFrameCount = (outFrameCount*mInSampleRate)/mSampleRate;
 
-    // LOGE("starting resample %d frames, inputIndex=%d, phaseFraction=%d, phaseIncrement=%d\n",
+    // ALOGE("starting resample %d frames, inputIndex=%d, phaseFraction=%d, phaseIncrement=%d\n",
     //      outFrameCount, inputIndex, phaseFraction, phaseIncrement);
     while (outputIndex < outputSampleCount) {
         // buffer is empty, fetch a new one
@@ -298,7 +298,7 @@
                 mPhaseFraction = phaseFraction;
                 goto resampleMono16_exit;
             }
-            // LOGE("New buffer fetched: %d frames\n", mBuffer.frameCount);
+            // ALOGE("New buffer fetched: %d frames\n", mBuffer.frameCount);
             if (mBuffer.frameCount >  inputIndex) break;
 
             inputIndex -= mBuffer.frameCount;
@@ -310,7 +310,7 @@
 
         // handle boundary case
         while (inputIndex == 0) {
-            // LOGE("boundary case\n");
+            // ALOGE("boundary case\n");
             int32_t sample = Interp(mX0L, in[0], phaseFraction);
             out[outputIndex++] += vl * sample;
             out[outputIndex++] += vr * sample;
@@ -320,7 +320,7 @@
         }
 
         // process input samples
-        // LOGE("general case\n");
+        // ALOGE("general case\n");
 
 #ifdef ASM_ARM_RESAMP1  // asm optimisation for ResamplerOrder1
         if (inputIndex + 2 < mBuffer.frameCount) {
@@ -343,13 +343,13 @@
         }
 
 
-        // LOGE("loop done - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
+        // ALOGE("loop done - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
 
         // if done with buffer, save samples
         if (inputIndex >= mBuffer.frameCount) {
             inputIndex -= mBuffer.frameCount;
 
-            // LOGE("buffer done, new input index %d", inputIndex);
+            // ALOGE("buffer done, new input index %d", inputIndex);
 
             mX0L = mBuffer.i16[mBuffer.frameCount-1];
             provider->releaseBuffer(&mBuffer);
@@ -359,7 +359,7 @@
         }
     }
 
-    // LOGE("output buffer full - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
+    // ALOGE("output buffer full - outputIndex=%d, inputIndex=%d\n", outputIndex, inputIndex);
 
 resampleMono16_exit:
     // save state
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/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h
index 658e25e..34087b5 100644
--- a/services/camera/libcameraservice/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/CameraHardwareInterface.h
@@ -88,21 +88,21 @@
 
     ~CameraHardwareInterface()
     {
-        LOGI("Destroying camera %s", mName.string());
+        ALOGI("Destroying camera %s", mName.string());
         if(mDevice) {
             int rc = mDevice->common.close(&mDevice->common);
             if (rc != OK)
-                LOGE("Could not close camera %s: %d", mName.string(), rc);
+                ALOGE("Could not close camera %s: %d", mName.string(), rc);
         }
     }
 
     status_t initialize(hw_module_t *module)
     {
-        LOGI("Opening camera %s", mName.string());
+        ALOGI("Opening camera %s", mName.string());
         int rc = module->methods->open(module, mName.string(),
                                        (hw_device_t **)&mDevice);
         if (rc != OK) {
-            LOGE("Could not open camera %s: %d", mName.string(), rc);
+            ALOGE("Could not open camera %s: %d", mName.string(), rc);
             return rc;
         }
         initHalPreviewWindow();
@@ -460,7 +460,7 @@
                 static_cast<CameraHardwareInterface *>(user);
         sp<CameraHeapMemory> mem(static_cast<CameraHeapMemory *>(data->handle));
         if (index >= mem->mNumBufs) {
-            LOGE("%s: invalid buffer index %d, max allowed is %d", __FUNCTION__,
+            ALOGE("%s: invalid buffer index %d, max allowed is %d", __FUNCTION__,
                  index, mem->mNumBufs);
             return;
         }
@@ -479,7 +479,7 @@
         // MemoryHeapBase.
         sp<CameraHeapMemory> mem(static_cast<CameraHeapMemory *>(data->handle));
         if (index >= mem->mNumBufs) {
-            LOGE("%s: invalid buffer index %d, max allowed is %d", __FUNCTION__,
+            ALOGE("%s: invalid buffer index %d, max allowed is %d", __FUNCTION__,
                  index, mem->mNumBufs);
             return;
         }
diff --git a/services/camera/libcameraservice/CameraHardwareStub.cpp b/services/camera/libcameraservice/CameraHardwareStub.cpp
index f922630..cdfb2f5 100644
--- a/services/camera/libcameraservice/CameraHardwareStub.cpp
+++ b/services/camera/libcameraservice/CameraHardwareStub.cpp
@@ -57,7 +57,7 @@
     p.setPictureFormat(CameraParameters::PIXEL_FORMAT_JPEG);
 
     if (setParameters(p) != NO_ERROR) {
-        LOGE("Failed to set default parameters?!");
+        ALOGE("Failed to set default parameters?!");
     }
 }
 
@@ -340,20 +340,20 @@
 
     if (strcmp(params.getPreviewFormat(),
         CameraParameters::PIXEL_FORMAT_YUV420SP) != 0) {
-        LOGE("Only yuv420sp preview is supported");
+        ALOGE("Only yuv420sp preview is supported");
         return -1;
     }
 
     if (strcmp(params.getPictureFormat(),
         CameraParameters::PIXEL_FORMAT_JPEG) != 0) {
-        LOGE("Only jpeg still pictures are supported");
+        ALOGE("Only jpeg still pictures are supported");
         return -1;
     }
 
     int w, h;
     params.getPictureSize(&w, &h);
     if (w != kCannedJpegWidth && h != kCannedJpegHeight) {
-        LOGE("Still picture size must be size of canned JPEG (%dx%d)",
+        ALOGE("Still picture size must be size of canned JPEG (%dx%d)",
              kCannedJpegWidth, kCannedJpegHeight);
         return -1;
     }
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index d0cafb2..06fc708 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -73,7 +73,7 @@
 CameraService::CameraService()
 :mSoundRef(0), mModule(0)
 {
-    LOGI("CameraService started (pid=%d)", getpid());
+    ALOGI("CameraService started (pid=%d)", getpid());
     gCameraService = this;
 }
 
@@ -83,13 +83,13 @@
 
     if (hw_get_module(CAMERA_HARDWARE_MODULE_ID,
                 (const hw_module_t **)&mModule) < 0) {
-        LOGE("Could not load camera HAL module");
+        ALOGE("Could not load camera HAL module");
         mNumberOfCameras = 0;
     }
     else {
         mNumberOfCameras = mModule->get_number_of_cameras();
         if (mNumberOfCameras > MAX_CAMERAS) {
-            LOGE("Number of cameras(%d) > MAX_CAMERAS(%d).",
+            ALOGE("Number of cameras(%d) > MAX_CAMERAS(%d).",
                     mNumberOfCameras, MAX_CAMERAS);
             mNumberOfCameras = MAX_CAMERAS;
         }
@@ -97,22 +97,12 @@
             setCameraFree(i);
         }
     }
-
-    // Read the system property to determine if we have to use the
-    // AUDIO_STREAM_ENFORCED_AUDIBLE type.
-    char value[PROPERTY_VALUE_MAX];
-    property_get("ro.camera.sound.forced", value, "0");
-    if (strcmp(value, "0") != 0) {
-        mAudioStreamType = AUDIO_STREAM_ENFORCED_AUDIBLE;
-    } else {
-        mAudioStreamType = AUDIO_STREAM_MUSIC;
-    }
 }
 
 CameraService::~CameraService() {
     for (int i = 0; i < mNumberOfCameras; i++) {
         if (mBusy[i]) {
-            LOGE("camera %d is still in use in destructor!", i);
+            ALOGE("camera %d is still in use in destructor!", i);
         }
     }
 
@@ -148,13 +138,13 @@
     LOG1("CameraService::connect E (pid %d, id %d)", callingPid, cameraId);
 
     if (!mModule) {
-        LOGE("Camera HAL module not loaded");
+        ALOGE("Camera HAL module not loaded");
         return NULL;
     }
 
     sp<Client> client;
     if (cameraId < 0 || cameraId >= mNumberOfCameras) {
-        LOGE("CameraService::connect X (pid %d) rejected (invalid cameraId %d).",
+        ALOGE("CameraService::connect X (pid %d) rejected (invalid cameraId %d).",
             callingPid, cameraId);
         return NULL;
     }
@@ -163,7 +153,7 @@
     property_get("sys.secpolicy.camera.disabled", value, "0");
     if (strcmp(value, "1") == 0) {
         // Camera is disabled by DevicePolicyManager.
-        LOGI("Camera is disabled. connect X (pid %d) rejected", callingPid);
+        ALOGI("Camera is disabled. connect X (pid %d) rejected", callingPid);
         return NULL;
     }
 
@@ -176,7 +166,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,14 +175,14 @@
     }
 
     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;
     }
 
     struct camera_info info;
     if (mModule->get_camera_info(cameraId, &info) != OK) {
-        LOGE("Invalid camera id %d", cameraId);
+        ALOGE("Invalid camera id %d", cameraId);
         return NULL;
     }
 
@@ -263,7 +253,7 @@
                 if (!checkCallingPermission(
                         String16("android.permission.CAMERA"))) {
                     const int uid = getCallingUid();
-                    LOGE("Permission Denial: "
+                    ALOGE("Permission Denial: "
                          "can't use the camera pid=%d, uid=%d", pid, uid);
                     return PERMISSION_DENIED;
                 }
@@ -295,10 +285,10 @@
 MediaPlayer* CameraService::newMediaPlayer(const char *file) {
     MediaPlayer* mp = new MediaPlayer();
     if (mp->setDataSource(file, NULL) == NO_ERROR) {
-        mp->setAudioStreamType(mAudioStreamType);
+        mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE);
         mp->prepare();
     } else {
-        LOGE("Failed to load CameraService sounds: %s", file);
+        ALOGE("Failed to load CameraService sounds: %s", file);
         return NULL;
     }
     return mp;
@@ -390,7 +380,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;
 }
@@ -399,7 +389,7 @@
     status_t result = checkPid();
     if (result != NO_ERROR) return result;
     if (mHardware == 0) {
-        LOGE("attempt to use a camera after disconnect() (pid %d)", getCallingPid());
+        ALOGE("attempt to use a camera after disconnect() (pid %d)", getCallingPid());
         return INVALID_OPERATION;
     }
     return NO_ERROR;
@@ -429,7 +419,7 @@
     status_t result = checkPid();
     if (result == NO_ERROR) {
         if (mHardware->recordingEnabled()) {
-            LOGE("Not allowed to unlock camera during recording.");
+            ALOGE("Not allowed to unlock camera during recording.");
             return INVALID_OPERATION;
         }
         mClientPid = 0;
@@ -448,7 +438,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 +461,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 +473,7 @@
     Mutex::Autolock lock(mLock);
 
     if (checkPid() != NO_ERROR) {
-        LOGW("different client - don't disconnect");
+        ALOGW("different client - don't disconnect");
         return;
     }
 
@@ -536,7 +526,7 @@
     if (window != 0) {
         result = native_window_api_connect(window.get(), NATIVE_WINDOW_API_CAMERA);
         if (result != NO_ERROR) {
-            LOGE("native_window_api_connect failed: %s (%d)", strerror(-result),
+            ALOGE("native_window_api_connect failed: %s (%d)", strerror(-result),
                     result);
             return result;
         }
@@ -634,7 +624,7 @@
             return startPreviewMode();
         case CAMERA_RECORDING_MODE:
             if (mSurface == 0 && mPreviewWindow == 0) {
-                LOGE("mSurface or mPreviewWindow must be set before startRecordingMode.");
+                ALOGE("mSurface or mPreviewWindow must be set before startRecordingMode.");
                 return INVALID_OPERATION;
             }
             return startRecordingMode();
@@ -686,7 +676,7 @@
     mCameraService->playSound(SOUND_RECORDING);
     result = mHardware->startRecording();
     if (result != NO_ERROR) {
-        LOGE("mHardware->startRecording() failed with status %d", result);
+        ALOGE("mHardware->startRecording() failed with status %d", result);
     }
     return result;
 }
@@ -780,7 +770,7 @@
 
     if ((msgType & CAMERA_MSG_RAW_IMAGE) &&
         (msgType & CAMERA_MSG_RAW_IMAGE_NOTIFY)) {
-        LOGE("CAMERA_MSG_RAW_IMAGE and CAMERA_MSG_RAW_IMAGE_NOTIFY"
+        ALOGE("CAMERA_MSG_RAW_IMAGE and CAMERA_MSG_RAW_IMAGE_NOTIFY"
                 " cannot be both enabled");
         return BAD_VALUE;
     }
@@ -841,7 +831,7 @@
         // Disabling shutter sound is not allowed. Deny if the current
         // process is not mediaserver.
         if (getCallingPid() != getpid()) {
-            LOGE("Failed to disable shutter sound. Permission denied (pid %d)", getCallingPid());
+            ALOGE("Failed to disable shutter sound. Permission denied (pid %d)", getCallingPid());
             return PERMISSION_DENIED;
         }
     }
@@ -917,7 +907,7 @@
         }
         usleep(CHECK_MESSAGE_INTERVAL * 1000);
     }
-    LOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType);
+    ALOGW("lockIfMessageWanted(%d): dropped unwanted message", msgType);
     return false;
 }
 
@@ -936,12 +926,12 @@
 
     // The checks below are not necessary and are for debugging only.
     if (client->mCameraService.get() != gCameraService) {
-        LOGE("mismatch service!");
+        ALOGE("mismatch service!");
         return NULL;
     }
 
     if (client->mHardware == 0) {
-        LOGE("mHardware == 0: callback after disconnect()?");
+        ALOGE("mHardware == 0: callback after disconnect()?");
         return NULL;
     }
 
@@ -999,7 +989,7 @@
     if (!client->lockIfMessageWanted(msgType)) return;
 
     if (dataPtr == 0 && metadata == NULL) {
-        LOGE("Null data returned in data callback");
+        ALOGE("Null data returned in data callback");
         client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
         return;
     }
@@ -1032,7 +1022,7 @@
     if (!client->lockIfMessageWanted(msgType)) return;
 
     if (dataPtr == 0) {
-        LOGE("Null data returned in data with timestamp callback");
+        ALOGE("Null data returned in data with timestamp callback");
         client->handleGenericNotify(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0);
         return;
     }
@@ -1187,7 +1177,7 @@
         mPreviewBuffer = new MemoryHeapBase(size, 0, NULL);
     }
     if (mPreviewBuffer == 0) {
-        LOGE("failed to allocate space for preview buffer");
+        ALOGE("failed to allocate space for preview buffer");
         mLock.unlock();
         return;
     }
@@ -1197,7 +1187,7 @@
 
     sp<MemoryBase> frame = new MemoryBase(previewBuffer, 0, size);
     if (frame == 0) {
-        LOGE("failed to allocate space for frame callback");
+        ALOGE("failed to allocate space for frame callback");
         mLock.unlock();
         return;
     }
@@ -1223,7 +1213,7 @@
             return HAL_TRANSFORM_FLIP_V | HAL_TRANSFORM_ROT_90;
         }
     }
-    LOGE("Invalid setDisplayOrientation degrees=%d", degrees);
+    ALOGE("Invalid setDisplayOrientation degrees=%d", degrees);
     return -1;
 }
 
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index cdfbc56..bad41f5 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -76,7 +76,6 @@
     void                setCameraFree(int cameraId);
 
     // sounds
-    audio_stream_type_t mAudioStreamType;
     MediaPlayer*        newMediaPlayer(const char *file);
 
     Mutex               mSoundLock;
diff --git a/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp b/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp
index 69f60ca..1055538 100644
--- a/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp
+++ b/services/camera/tests/CameraServiceTest/CameraServiceTest.cpp
@@ -217,7 +217,7 @@
 
 void MCameraClient::assertTest(OP op, int v1, int v2) {
     if (!test(op, v1, v2)) {
-        LOGE("assertTest failed: op=%d, v1=%d, v2=%d", op, v1, v2);
+        ALOGE("assertTest failed: op=%d, v1=%d, v2=%d", op, v1, v2);
         ASSERT(0);
     }
 }