Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)  DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I8c589a92ddd26c0c3a12f24cf1633ab5b4d828c6
diff --git a/libaudio-qdsp5v2/AudioHardware.cpp b/libaudio-qdsp5v2/AudioHardware.cpp
index e44c945..97c34b2 100644
--- a/libaudio-qdsp5v2/AudioHardware.cpp
+++ b/libaudio-qdsp5v2/AudioHardware.cpp
@@ -223,7 +223,7 @@
         ALOGV("open pcm_out driver");
         status = ::open("/dev/msm_pcm_out", O_RDWR);
         if (status < 0) {
-                LOGE("Cannot open /dev/msm_pcm_out errno: %d", errno);
+                ALOGE("Cannot open /dev/msm_pcm_out errno: %d", errno);
             goto Error;
         }
         mFd = status;
@@ -233,7 +233,7 @@
         struct msm_audio_config config;
         status = ioctl(mFd, AUDIO_GET_CONFIG, &config);
         if (status < 0) {
-            LOGE("Cannot read pcm_out config");
+            ALOGE("Cannot read pcm_out config");
             goto Error;
         }
 
@@ -245,7 +245,7 @@
 //        config.codec_type = CODEC_TYPE_PCM;
         status = ioctl(mFd, AUDIO_SET_CONFIG, &config);
         if (status < 0) {
-            LOGE("Cannot set config");
+            ALOGE("Cannot set config");
             goto Error;
         }
 
@@ -257,13 +257,13 @@
 #if 0
         status = ioctl(mFd, AUDIO_START, &acdb_id);
         if (status < 0) {
-            LOGE("Cannot start pcm playback");
+            ALOGE("Cannot start pcm playback");
             goto Error;
         }
 
         status = ioctl(mFd, AUDIO_SET_VOLUME, &stream_volume);
         if (status < 0) {
-            LOGE("Cannot start pcm playback");
+            ALOGE("Cannot start pcm playback");
             goto Error;
         }
 #endif
diff --git a/libaudio-qdsp5v2/AudioPolicyManager.cpp b/libaudio-qdsp5v2/AudioPolicyManager.cpp
index 29c7052..ea2ff46 100644
--- a/libaudio-qdsp5v2/AudioPolicyManager.cpp
+++ b/libaudio-qdsp5v2/AudioPolicyManager.cpp
@@ -109,7 +109,7 @@
             }
             device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_EARPIECE;
             if (device == 0) {
-                LOGE("getDeviceForStrategy() earpiece device not found");
+                ALOGE("getDeviceForStrategy() earpiece device not found");
             }
             break;
 
@@ -132,7 +132,7 @@
             }
             device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
             if (device == 0) {
-                LOGE("getDeviceForStrategy() speaker device not found");
+                ALOGE("getDeviceForStrategy() speaker device not found");
             }
             break;
         }
@@ -152,7 +152,7 @@
         if (mForceUse[AudioSystem::FOR_DOCK] != AudioSystem::FORCE_BT_CAR_DOCK) {
             device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
             if (device == 0) {
-                LOGE("getDeviceForStrategy() speaker device not found");
+                ALOGE("getDeviceForStrategy() speaker device not found");
             }
             if (mForceUse[AudioSystem::FOR_DOCK] == AudioSystem::FORCE_BT_DESK_DOCK) {
                 if (mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE) {
@@ -212,7 +212,7 @@
         // device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION, 0 otherwise
         device |= device2;
         if (device == 0) {
-            LOGE("getDeviceForStrategy() speaker device not found");
+            ALOGE("getDeviceForStrategy() speaker device not found");
         }
         // Do not play media stream if in call and the requested device would change the hardware
         // output routing
diff --git a/libaudio-qsd8k/AudioHardware.cpp b/libaudio-qsd8k/AudioHardware.cpp
index b935912..fdc0038 100644
--- a/libaudio-qsd8k/AudioHardware.cpp
+++ b/libaudio-qsd8k/AudioHardware.cpp
@@ -127,7 +127,7 @@
     }
     set_acoustic_parameters = (int (*)(void))::dlsym(acoustic, "set_acoustic_parameters");
     if ((*set_acoustic_parameters) == 0 ) {
-        LOGE("Could not open set_acoustic_parameters()");
+        ALOGE("Could not open set_acoustic_parameters()");
         return;
     }
 
@@ -163,7 +163,7 @@
     ept = mBTEndpoints;
     snd_get_bt_endpoint = (int (*)(msm_bt_endpoint *))::dlsym(acoustic, "snd_get_bt_endpoint");
     if ((*snd_get_bt_endpoint) == 0 ) {
-        LOGE("Could not open snd_get_bt_endpoint()");
+        ALOGE("Could not open snd_get_bt_endpoint()");
         return;
     }
     snd_get_bt_endpoint(mBTEndpoints);
@@ -341,12 +341,12 @@
     int fd = -1;
     fd = open("/dev/msm_audio_ctl", O_RDWR);
     if (fd < 0) {
-        LOGE("Cannot open msm_audio_ctl device\n");
+        ALOGE("Cannot open msm_audio_ctl device\n");
         return -1;
     }
     ALOGD("Setting mic mute to %d\n", mute);
     if (ioctl(fd, AUDIO_SET_MUTE, &mute)) {
-        LOGE("Cannot set mic mute on current device\n");
+        ALOGE("Cannot set mic mute on current device\n");
         close(fd);
         return -1;
     }
@@ -459,7 +459,7 @@
                 if (fd_a1026 < 0) {
                     fd_a1026 = open("/dev/audience_a1026", O_RDWR);
                     if (fd_a1026 < 0) {
-                        LOGE("Cannot open audience_a1026 device (%d)\n", fd_a1026);
+                        ALOGE("Cannot open audience_a1026 device (%d)\n", fd_a1026);
                         mA1026Lock.unlock();
                         return -1;
                     }
@@ -470,7 +470,7 @@
                 if (!rc) {
                     mNoiseSuppressionState = noiseSuppressionState;
                 } else {
-                    LOGE("Failed to set noise suppression %s", value.string());
+                    ALOGE("Failed to set noise suppression %s", value.string());
                 }
                 close(fd_a1026);
                 fd_a1026 = -1;
@@ -597,7 +597,7 @@
     int fd = -1;
     fd = open("/dev/msm_audio_ctl", O_RDWR);
     if (fd < 0) {
-        LOGE("Cannot open msm_audio_ctl device\n");
+        ALOGE("Cannot open msm_audio_ctl device\n");
         return -1;
     }
     volume *= 20; //percentage
@@ -715,7 +715,7 @@
         mic_device = TTY_HEADSET_MIC;
         ALOGD("TTY HCO headset");
     } else {
-        LOGE("unknown device %d", device);
+        ALOGE("unknown device %d", device);
         return -1;
     }
 
@@ -725,7 +725,7 @@
         if (fd_fm_device < 0) {
             fd_fm_device = open("/dev/msm_htc_fm", O_RDWR);
             if (fd_fm_device < 0) {
-                LOGE("Cannot open msm_htc_fm device");
+                ALOGE("Cannot open msm_htc_fm device");
                 return -1;
             }
             ALOGD("Opened msm_htc_fm for FM radio");
@@ -739,20 +739,20 @@
 
     fd = open("/dev/msm_audio_ctl", O_RDWR);
     if (fd < 0)        {
-       LOGE("Cannot open msm_audio_ctl");
+       ALOGE("Cannot open msm_audio_ctl");
        return -1;
     }
     path[0] = out_device;
     path[1] = rx_acdb_id;
     if (ioctl(fd, AUDIO_SWITCH_DEVICE, &path)) {
-       LOGE("Cannot switch audio device");
+       ALOGE("Cannot switch audio device");
        close(fd);
        return -1;
     }
     path[0] = mic_device;
     path[1] = tx_acdb_id;
     if (ioctl(fd, AUDIO_SWITCH_DEVICE, &path)) {
-       LOGE("Cannot switch mic device");
+       ALOGE("Cannot switch mic device");
        close(fd);
        return -1;
     }
@@ -765,14 +765,14 @@
             fd = open("/dev/msm_audio_ctl", O_RDWR);
 
             if (fd < 0) {
-                LOGE("Cannot open msm_audio_ctl");
+                ALOGE("Cannot open msm_audio_ctl");
                 return -1;
             }
         }
         path[0] = rx_acdb_id;
         path[1] = tx_acdb_id;
         if (ioctl(fd, AUDIO_START_VOICE, &path)) {
-            LOGE("Cannot start voice");
+            ALOGE("Cannot start voice");
             close(fd);
             return -1;
         }
@@ -784,12 +784,12 @@
             fd = open("/dev/msm_audio_ctl", O_RDWR);
 
             if (fd < 0) {
-                LOGE("Cannot open msm_audio_ctl");
+                ALOGE("Cannot open msm_audio_ctl");
                 return -1;
             }
         }
         if (ioctl(fd, AUDIO_STOP_VOICE, NULL)) {
-               LOGE("Cannot stop voice");
+               ALOGE("Cannot stop voice");
                close(fd);
                return -1;
         }
@@ -880,12 +880,12 @@
     char get_batt_temp[6] = { 0 };
 
     if ((fd = open(fn, O_RDONLY)) < 0) {
-        LOGE("%s: cannot open %s: %s\n", __FUNCTION__, fn, strerror(errno));
+        ALOGE("%s: cannot open %s: %s\n", __FUNCTION__, fn, strerror(errno));
         return UNKNOWN_ERROR;
     }
 
     if ((len = read(fd, get_batt_temp, sizeof(get_batt_temp))) <= 1) {
-        LOGE("read battery temp fail: %s\n", strerror(errno));
+        ALOGE("read battery temp fail: %s\n", strerror(errno));
         close(fd);
         return BAD_VALUE;
     }
@@ -915,14 +915,14 @@
         fd_a1026 = open(path, O_RDWR | O_NONBLOCK, 0);
 
     if (fd_a1026 < 0) {
-        LOGE("Cannot open %s %d\n", path, fd_a1026);
+        ALOGE("Cannot open %s %d\n", path, fd_a1026);
         support_a1026 = 0;
         goto open_drv_err;
     }
 
     fw_fd = open(fn, O_RDONLY);
     if (fw_fd < 0) {
-        LOGE("Fail to open %s\n", fn);
+        ALOGE("Fail to open %s\n", fn);
         goto ld_img_error;
     } else {
         ALOGD("open %s success\n", fn);
@@ -930,7 +930,7 @@
 
     rc = fstat(fw_fd, &fw_stat);
     if (rc < 0) {
-        LOGE("Cannot stat file %s: %s\n", fn, strerror(errno));
+        ALOGE("Cannot stat file %s: %s\n", fn, strerror(errno));
         goto ld_img_error;
     }
 
@@ -939,7 +939,7 @@
     ALOGD("Firmware %s size %d\n", fn, remaining);
 
     if (remaining > sizeof(local_vpimg_buf)) {
-        LOGE("File %s size %d exceeds internal limit %d\n",
+        ALOGE("File %s size %d exceeds internal limit %d\n",
              fn, remaining, sizeof(local_vpimg_buf));
         goto ld_img_error;
     }
@@ -947,7 +947,7 @@
     while (remaining) {
         nr = read(fw_fd, ptr, remaining);
         if (nr < 0) {
-            LOGE("Error reading firmware: %s\n", strerror(errno));
+            ALOGE("Error reading firmware: %s\n", strerror(errno));
             goto ld_img_error;
         }
         else if (!nr) {
@@ -972,7 +972,7 @@
         ALOGD("audience_a1026 init OK\n");
         mA1026Init = 1;
     } else
-        LOGE("audience_a1026 init failed\n");
+        ALOGE("audience_a1026 init failed\n");
 
 ld_img_error:
     if (fw_fd >= 0)
@@ -1084,7 +1084,7 @@
 
         fd = open("/dev/tpa2018d1", O_RDWR);
         if (fd < 0) {
-            LOGE("can't open /dev/tpa2018d1 %d", fd);
+            ALOGE("can't open /dev/tpa2018d1 %d", fd);
             return -1;
         }
 
@@ -1095,7 +1095,7 @@
         } while (--retry);
 
         if (rc < 0) {
-            LOGE("ioctl TPA2018_SET_MODE failed: %s", strerror(errno));
+            ALOGE("ioctl TPA2018_SET_MODE failed: %s", strerror(errno));
         } else
             ALOGD("Update TPA2018_SET_MODE to mode %d success", mode);
 
@@ -1118,7 +1118,7 @@
     if (fd_a1026 < 0) {
         fd_a1026 = open("/dev/audience_a1026", O_RDWR);
         if (fd_a1026 < 0) {
-            LOGE("Cannot open audience_a1026 device (%d)\n", fd_a1026);
+            ALOGE("Cannot open audience_a1026 device (%d)\n", fd_a1026);
             mA1026Lock.unlock();
             return -1;
         }
@@ -1308,17 +1308,17 @@
                 /* after doA1026_init(), fd_a1026 is -1*/
                 fd_a1026 = open("/dev/audience_a1026", O_RDWR);
                 if (fd_a1026 < 0) {
-                    LOGE("A1026 Fatal Error: unable to open A1026 after hard reset\n");
+                    ALOGE("A1026 Fatal Error: unable to open A1026 after hard reset\n");
                 } else {
                     rc = ioctl(fd_a1026, A1026_SET_CONFIG, &new_pathid);
                     if (!rc) {
                         old_pathid = new_pathid;
                     } else {
-                        LOGE("A1026 Fatal Error: unable to A1026_SET_CONFIG after hard reset\n");
+                        ALOGE("A1026 Fatal Error: unable to A1026_SET_CONFIG after hard reset\n");
                     }
                 }
             } else
-                LOGE("A1026 Fatal Error: Re-init A1026 Failed\n");
+                ALOGE("A1026 Fatal Error: Re-init A1026 Failed\n");
         }
     }
 
@@ -1597,7 +1597,7 @@
         status = ::open("/dev/msm_pcm_out", O_RDWR);
         if (status < 0) {
             if (errCount++ < 10) {
-                LOGE("Cannot open /dev/msm_pcm_out errno: %d", errno);
+                ALOGE("Cannot open /dev/msm_pcm_out errno: %d", errno);
             }
             release_wake_lock(kOutputWakelockStr);
             goto Error;
@@ -1610,7 +1610,7 @@
         struct msm_audio_config config;
         status = ioctl(mFd, AUDIO_GET_CONFIG, &config);
         if (status < 0) {
-            LOGE("Cannot read pcm_out config");
+            ALOGE("Cannot read pcm_out config");
             goto Error;
         }
 
@@ -1622,7 +1622,7 @@
         config.codec_type = CODEC_TYPE_PCM;
         status = ioctl(mFd, AUDIO_SET_CONFIG, &config);
         if (status < 0) {
-            LOGE("Cannot set config");
+            ALOGE("Cannot set config");
             goto Error;
         }
 
@@ -1634,13 +1634,13 @@
         uint32_t acdb_id = mHardware->getACDB(MOD_PLAY, mHardware->get_snd_dev());
         status = ioctl(mFd, AUDIO_START, &acdb_id);
         if (status < 0) {
-            LOGE("Cannot start pcm playback");
+            ALOGE("Cannot start pcm playback");
             goto Error;
         }
 
         status = ioctl(mFd, AUDIO_SET_VOLUME, &stream_volume);
         if (status < 0) {
-            LOGE("Cannot start pcm playback");
+            ALOGE("Cannot start pcm playback");
             goto Error;
         }
     }
@@ -1800,7 +1800,7 @@
 
     ALOGV("AudioStreamInMSM72xx::set(%d, %d, %u)", *pFormat, *pChannels, *pRate);
     if (mFd >= 0) {
-        LOGE("Audio record already open");
+        ALOGE("Audio record already open");
         return -EPERM;
     }
 
@@ -1837,7 +1837,7 @@
             // open audio input device
             status = ::open("/dev/msm_pcm_in", O_RDWR);
             if (status < 0) {
-                LOGE("Cannot open /dev/msm_pcm_in errno: %d", errno);
+                ALOGE("Cannot open /dev/msm_pcm_in errno: %d", errno);
                 ALOGV("release input wakelock");
                 release_wake_lock(kInputWakelockStr);
                 goto Error;
@@ -1850,7 +1850,7 @@
             struct msm_audio_config config;
             status = ioctl(mFd, AUDIO_GET_CONFIG, &config);
             if (status < 0) {
-                LOGE("Cannot read config");
+                ALOGE("Cannot read config");
                 goto Error;
             }
 
@@ -1862,7 +1862,7 @@
             config.codec_type = CODEC_TYPE_PCM;
             status = ioctl(mFd, AUDIO_SET_CONFIG, &config);
             if (status < 0) {
-                LOGE("Cannot set config");
+                ALOGE("Cannot set config");
                 goto Error;
             }
 
@@ -1879,7 +1879,7 @@
 
         uint32_t acdb_id = mHardware->getACDB(MOD_REC, mHardware->get_snd_dev());
         if (ioctl(mFd, AUDIO_START, &acdb_id)) {
-            LOGE("Error starting record");
+            ALOGE("Error starting record");
             goto Error;
         }
     }
diff --git a/libaudio-qsd8k/AudioPolicyManager.cpp b/libaudio-qsd8k/AudioPolicyManager.cpp
index d3bd0ce..8bdad87 100644
--- a/libaudio-qsd8k/AudioPolicyManager.cpp
+++ b/libaudio-qsd8k/AudioPolicyManager.cpp
@@ -109,7 +109,7 @@
             }
             device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_EARPIECE;
             if (device == 0) {
-                LOGE("getDeviceForStrategy() earpiece device not found");
+                ALOGE("getDeviceForStrategy() earpiece device not found");
             }
             break;
 
@@ -132,7 +132,7 @@
             }
             device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
             if (device == 0) {
-                LOGE("getDeviceForStrategy() speaker device not found");
+                ALOGE("getDeviceForStrategy() speaker device not found");
             }
             break;
         }
@@ -152,7 +152,7 @@
         if (mForceUse[AudioSystem::FOR_DOCK] != AudioSystem::FORCE_BT_CAR_DOCK) {
             device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
             if (device == 0) {
-                LOGE("getDeviceForStrategy() speaker device not found");
+                ALOGE("getDeviceForStrategy() speaker device not found");
             }
             if (mForceUse[AudioSystem::FOR_DOCK] == AudioSystem::FORCE_BT_DESK_DOCK) {
                 if (mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE) {
@@ -212,7 +212,7 @@
         // device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION, 0 otherwise
         device |= device2;
         if (device == 0) {
-            LOGE("getDeviceForStrategy() speaker device not found");
+            ALOGE("getDeviceForStrategy() speaker device not found");
         }
         // Do not play media stream if in call and the requested device would change the hardware
         // output routing
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp
index 5a20f00..d7b455d 100644
--- a/libaudio/AudioHardware.cpp
+++ b/libaudio/AudioHardware.cpp
@@ -71,7 +71,7 @@
 
     acoustic = ::dlopen("/system/lib/libhtc_acoustic.so", RTLD_NOW);
     if (acoustic == NULL ) {
-        LOGE("Could not open libhtc_acoustic.so");
+        ALOGE("Could not open libhtc_acoustic.so");
         /* this is not really an error on non-htc devices... */
         mNumSndEndpoints = 0;
         mInit = true;
@@ -80,19 +80,19 @@
 
     set_acoustic_parameters = (int (*)(void))::dlsym(acoustic, "set_acoustic_parameters");
     if ((*set_acoustic_parameters) == 0 ) {
-        LOGE("Could not open set_acoustic_parameters()");
+        ALOGE("Could not open set_acoustic_parameters()");
         return;
     }
 
     int rc = set_acoustic_parameters();
     if (rc < 0) {
-        LOGE("Could not set acoustic parameters to share memory: %d", rc);
+        ALOGE("Could not set acoustic parameters to share memory: %d", rc);
 //        return;
     }
 
     snd_get_num = (int (*)(void))::dlsym(acoustic, "snd_get_num_endpoints");
     if ((*snd_get_num) == 0 ) {
-        LOGE("Could not open snd_get_num()");
+        ALOGE("Could not open snd_get_num()");
 //        return;
     }
 
@@ -104,7 +104,7 @@
     ept = mSndEndpoints;
     snd_get_endpoint = (int (*)(int, msm_snd_endpoint *))::dlsym(acoustic, "snd_get_endpoint");
     if ((*snd_get_endpoint) == 0 ) {
-        LOGE("Could not open snd_get_endpoint()");
+        ALOGE("Could not open snd_get_endpoint()");
         return;
     }
 
@@ -370,7 +370,7 @@
 
     fd = open("/dev/msm_snd", O_RDWR);
     if (fd < 0) {
-        LOGE("Can not open snd device");
+        ALOGE("Can not open snd device");
         return -EPERM;
     }
     /* rpc_snd_set_volume(
@@ -388,7 +388,7 @@
      args.volume = volume;
 
      if (ioctl(fd, SND_SET_VOLUME, &args) < 0) {
-         LOGE("snd_set_volume error.");
+         ALOGE("snd_set_volume error.");
          close(fd);
          return -EIO;
      }
@@ -445,7 +445,7 @@
 
     fd = open("/dev/msm_snd", O_RDWR);
     if (fd < 0) {
-        LOGE("Can not open snd device");
+        ALOGE("Can not open snd device");
         return -EPERM;
     }
     // RPC call to switch audio path
@@ -464,7 +464,7 @@
     args.mic_mute = mic_mute ? SND_MUTE_MUTED : SND_MUTE_UNMUTED;
 
     if (ioctl(fd, SND_SET_DEVICE, &args) < 0) {
-        LOGE("snd_set_device error.");
+        ALOGE("snd_set_device error.");
         close(fd);
         return -EIO;
     }
@@ -577,7 +577,7 @@
     if (sndDevice != -1 && sndDevice != mCurSndDevice) {
         ret = doAudioRouteOrMute(sndDevice);
         if ((*msm72xx_enable_audpp) == 0 ) {
-            LOGE("Could not open msm72xx_enable_audpp()");
+            ALOGE("Could not open msm72xx_enable_audpp()");
         } else {
             msm72xx_enable_audpp(audProcess);
         }
@@ -713,7 +713,7 @@
         ALOGV("open driver");
         status = ::open("/dev/msm_pcm_out", O_RDWR);
         if (status < 0) {
-            LOGE("Cannot open /dev/msm_pcm_out errno: %d", errno);
+            ALOGE("Cannot open /dev/msm_pcm_out errno: %d", errno);
             goto Error;
         }
         mFd = status;
@@ -723,7 +723,7 @@
         struct msm_audio_config config;
         status = ioctl(mFd, AUDIO_GET_CONFIG, &config);
         if (status < 0) {
-            LOGE("Cannot read config");
+            ALOGE("Cannot read config");
             goto Error;
         }
 
@@ -735,7 +735,7 @@
         config.codec_type = CODEC_TYPE_PCM;
         status = ioctl(mFd, AUDIO_SET_CONFIG, &config);
         if (status < 0) {
-            LOGE("Cannot set config");
+            ALOGE("Cannot set config");
             goto Error;
         }
 
@@ -904,14 +904,14 @@
 
     ALOGV("AudioStreamInMSM72xx::set(%d, %d, %u)", *pFormat, *pChannels, *pRate);
     if (mFd >= 0) {
-        LOGE("Audio record already open");
+        ALOGE("Audio record already open");
         return -EPERM;
     }
 
     // open audio input device
     status_t status = ::open("/dev/msm_pcm_in", O_RDWR);
     if (status < 0) {
-        LOGE("Cannot open /dev/msm_pcm_in errno: %d", errno);
+        ALOGE("Cannot open /dev/msm_pcm_in errno: %d", errno);
         goto Error;
     }
     mFd = status;
@@ -921,7 +921,7 @@
     struct msm_audio_config config;
     status = ioctl(mFd, AUDIO_GET_CONFIG, &config);
     if (status < 0) {
-        LOGE("Cannot read config");
+        ALOGE("Cannot read config");
         goto Error;
     }
 
@@ -933,7 +933,7 @@
     config.codec_type = CODEC_TYPE_PCM;
     status = ioctl(mFd, AUDIO_SET_CONFIG, &config);
     if (status < 0) {
-        LOGE("Cannot set config");
+        ALOGE("Cannot set config");
         if (ioctl(mFd, AUDIO_GET_CONFIG, &config) == 0) {
             if (config.channel_count == 1) {
                 *pChannels = AudioSystem::CHANNEL_IN_MONO;
@@ -948,7 +948,7 @@
     ALOGV("confirm config");
     status = ioctl(mFd, AUDIO_GET_CONFIG, &config);
     if (status < 0) {
-        LOGE("Cannot read config");
+        ALOGE("Cannot read config");
         goto Error;
     }
     ALOGV("buffer_size: %u", config.buffer_size);
@@ -979,14 +979,14 @@
     msm72xx_set_audpre_params = (int (*)(int, int))::dlsym(acoustic, "msm72xx_set_audpre_params");
     status = msm72xx_set_audpre_params(audpre_index, tx_iir_index);
     if (status < 0)
-        LOGE("Cannot set audpre parameters");
+        ALOGE("Cannot set audpre parameters");
 
     int (*msm72xx_enable_audpre)(int, int, int);
     msm72xx_enable_audpre = (int (*)(int, int, int))::dlsym(acoustic, "msm72xx_enable_audpre");
     mAcoustics = acoustic_flags;
     status = msm72xx_enable_audpre((int)acoustic_flags, audpre_index, tx_iir_index);
     if (status < 0)
-        LOGE("Cannot enable audpre");
+        ALOGE("Cannot enable audpre");
 
     return NO_ERROR;
 
@@ -1025,7 +1025,7 @@
         mHardware->clearCurDevice();
         mHardware->doRouting();
         if (ioctl(mFd, AUDIO_START, 0)) {
-            LOGE("Error starting record");
+            ALOGE("Error starting record");
             standby();
             return -1;
         }
diff --git a/libcamera/QualcommCameraHardware.cpp b/libcamera/QualcommCameraHardware.cpp
index f0c5fd2..aa5e911 100644
--- a/libcamera/QualcommCameraHardware.cpp
+++ b/libcamera/QualcommCameraHardware.cpp
@@ -362,7 +362,7 @@
         p.set("iso-values", "auto,high");
 
         if (setParameters(p) != NO_ERROR) {
-            LOGE("Failed to set default parameters?!");
+            ALOGE("Failed to set default parameters?!");
         }
     }
 
@@ -378,7 +378,7 @@
             ALOGV("loading libqcamera");
             libqcamera = ::dlopen("liboemcamera.so", RTLD_NOW);
             if (!libqcamera) {
-                LOGE("FATAL ERROR: could not dlopen liboemcamera.so: %s", dlerror());
+                ALOGE("FATAL ERROR: could not dlopen liboemcamera.so: %s", dlerror());
                 return;
             }
   
@@ -584,7 +584,7 @@
                             "snapshot camera");
 
         if (!mRawHeap->initialized()) {
-            LOGE("initRaw X failed: error initializing mRawHeap");
+            ALOGE("initRaw X failed: error initializing mRawHeap");
             mRawHeap = NULL;
             return false;
         }
@@ -598,7 +598,7 @@
                                0,
                                "jpeg");
             if (!mJpegHeap->initialized()) {
-                LOGE("initRaw X failed: error initializing mJpegHeap.");
+                ALOGE("initRaw X failed: error initializing mJpegHeap.");
                 mJpegHeap = NULL;
                 mRawHeap = NULL;
                 return false;
@@ -620,7 +620,7 @@
         // is in the idle or init state before destroying this object.
 
         if (mCameraState != QCS_IDLE && mCameraState != QCS_INIT) {
-            LOGE("Serious error: the camera state is %s, "
+            ALOGE("Serious error: the camera state is %s, "
                  "not QCS_IDLE or QCS_INIT!",
                  getCameraStateStr(mCameraState));
         }
@@ -702,7 +702,7 @@
         ALOGV("startPreview E");
 
         if (mCameraState == QCS_PREVIEW_IN_PROGRESS) {
-            LOGE("startPreview is already in progress, doing nothing.");
+            ALOGE("startPreview is already in progress, doing nothing.");
             // We might want to change the callback functions while preview is
             // streaming, for example to enable or disable recording.
             setCallbacks(pcb, puser, rcb, ruser);
@@ -726,13 +726,13 @@
         }
 
         if (mCameraState != QCS_IDLE) {
-            LOGE("startPreview X Camera state is %s, expecting QCS_IDLE!",
+            ALOGE("startPreview X Camera state is %s, expecting QCS_IDLE!",
                 getCameraStateStr(mCameraState));
             return INVALID_OPERATION;
         }
 
         if (!initPreview()) {
-            LOGE("startPreview X initPreview failed.  Not starting preview.");
+            ALOGE("startPreview X initPreview failed.  Not starting preview.");
             return UNKNOWN_ERROR;
         }
 
@@ -752,7 +752,7 @@
             }
         }
         else {
-            LOGE("startPreview failed: sensor error.");
+            ALOGE("startPreview failed: sensor error.");
             mCameraState = QCS_ERROR;
         }
 
@@ -766,7 +766,7 @@
         ALOGV("stopPreviewInternal E");
 
         if (mCameraState != QCS_PREVIEW_IN_PROGRESS) {
-            LOGE("Preview not in progress!");
+            ALOGE("Preview not in progress!");
             return;
         }
 
@@ -870,7 +870,7 @@
         Mutex::Autolock lock(&mStateLock);
 
         if (mCameraState != QCS_PREVIEW_IN_PROGRESS) {
-            LOGE("Invalid camera state %s: expecting QCS_PREVIEW_IN_PROGRESS,"
+            ALOGE("Invalid camera state %s: expecting QCS_PREVIEW_IN_PROGRESS,"
                  " cannot start autofocus!",
                  getCameraStateStr(mCameraState));
             return INVALID_OPERATION;
@@ -921,7 +921,7 @@
         }
 
         if (mCameraState != QCS_IDLE) {
-            LOGE("takePicture: %sunexpected state %d, expecting QCS_IDLE",
+            ALOGE("takePicture: %sunexpected state %d, expecting QCS_IDLE",
                  (last_state == QCS_PREVIEW_IN_PROGRESS ?
                   "(stop preview) " : ""),
                  mCameraState);
@@ -934,12 +934,12 @@
         }
 
         if (!initRaw(jpeg_cb != NULL)) {
-            LOGE("initRaw failed.  Not taking picture.");
+            ALOGE("initRaw failed.  Not taking picture.");
             return UNKNOWN_ERROR;
         }
 
         if (mCameraState != QCS_IDLE) {
-            LOGE("takePicture: (init raw) "
+            ALOGE("takePicture: (init raw) "
                  "unexpected state %d, expecting QCS_IDLE",
                 mCameraState);
             // If we had to stop preview in order to take a picture, and
@@ -1033,7 +1033,7 @@
         // correct setting is yuv420sp.
         if ((strcmp(params.getPreviewFormat(), "yuv420sp") != 0) &&
                 (strcmp(params.getPreviewFormat(), "yuv422sp") != 0)) {
-            LOGE("Only yuv420sp preview is supported");
+            ALOGE("Only yuv420sp preview is supported");
             return INVALID_OPERATION;
         }
 
@@ -1274,7 +1274,7 @@
                 LINK_camera_release_frame();
             }
         }
-        else LOGE("Preview frame virtual address %p is out of range!",
+        else ALOGE("Preview frame virtual address %p is out of range!",
                   frame->buf_Virt_Addr);
     }
 
@@ -1335,7 +1335,7 @@
                 mRawPictureCallback(mRawHeap->mBuffers[offset],
                                     mPictureCallbackCookie);
             }
-            else LOGE("receiveRawPicture: virtual address %p is out of range!",
+            else ALOGE("receiveRawPicture: virtual address %p is out of range!",
                       frame->buf_Virt_Addr);
         }
         else ALOGV("Raw-picture callback was canceled--skipping.");
@@ -1370,7 +1370,7 @@
                     if (sscanf(what##_str, fmt, &what) == 1)                              \
                         pt.what = what;                                                   \
                     else {                                                                \
-                        LOGE("GPS " #what " %s could not"                                 \
+                        ALOGE("GPS " #what " %s could not"                                 \
                               " be parsed as a " #desc,                                   \
                               what##_str);                                                \
                         encode_location = false;                                          \
@@ -1395,7 +1395,7 @@
                 ALOGV("receiveRawPicture: setting image location ALT %d LAT %lf LON %lf",
                      pt.altitude, pt.latitude, pt.longitude);
                 if (LINK_camera_set_position(&pt, NULL, NULL) != CAMERA_SUCCESS) {
-                    LOGE("receiveRawPicture: camera_set_position: error");
+                    ALOGE("receiveRawPicture: camera_set_position: error");
                     /* return; */ // not a big deal
                 }
             }
@@ -1444,7 +1444,7 @@
              size);
 
         if (size > remaining) {
-            LOGE("receiveJpegPictureFragment: size %d exceeds what "
+            ALOGE("receiveJpegPictureFragment: size %d exceeds what "
                  "remains in JPEG heap (%d), truncating",
                  size,
                  remaining);
@@ -1605,7 +1605,7 @@
             rotation = 0;
         }
         else if (rotation % 90) {
-            LOGE("rotation %d is not a multiple of 90 degrees!  Defaulting to zero.",
+            ALOGE("rotation %d is not a multiple of 90 degrees!  Defaulting to zero.",
                  rotation);
             rotation = 0;
         }
@@ -1676,7 +1676,7 @@
                  th_w, th_h, th_q);
             int ret = LINK_camera_set_thumbnail_properties(th_w, th_h, th_q);
             if (ret != CAMERA_SUCCESS) {
-                LOGE("LINK_camera_set_thumbnail_properties returned %d", ret);
+                ALOGE("LINK_camera_set_thumbnail_properties returned %d", ret);
             }
         }
 
@@ -1706,7 +1706,7 @@
     void QualcommCameraHardware::setCameraDimensions()
     {
         if (mCameraState != QCS_IDLE) {
-            LOGE("set camera dimensions: expecting state QCS_IDLE, not %s",
+            ALOGE("set camera dimensions: expecting state QCS_IDLE, not %s",
                  getCameraStateStr(mCameraState));
             return;
         }
@@ -1780,7 +1780,7 @@
         // Promote the singleton to make sure that we do not get destroyed
         // while this callback is executing.
         if (UNLIKELY(getInstance() == NULL)) {
-            LOGE("camera object has been destroyed--returning immediately");
+            ALOGE("camera object has been destroyed--returning immediately");
             return;
         }
 
@@ -1792,7 +1792,7 @@
             // Autofocus failures occur relatively often and are not fatal, so
             // we do not transition to QCS_ERROR for them.
             if (func != CAMERA_FUNC_START_FOCUS) {
-                LOGE("QualcommCameraHardware::camera_cb: @CAMERA_EXIT_CB_FAILURE(%d) in state %s.",
+                ALOGE("QualcommCameraHardware::camera_cb: @CAMERA_EXIT_CB_FAILURE(%d) in state %s.",
                      parm4,
                      obj->getCameraStateStr(obj->mCameraState));
                 TRANSITION_ALWAYS(QCS_ERROR);
@@ -1814,12 +1814,12 @@
                             obj->receivePreviewFrame((camera_frame_type *)parm4);
                         break;
                     case QCS_INTERNAL_PREVIEW_STOPPING:
-                        LOGE("camera cb: discarding preview frame "
+                        ALOGE("camera cb: discarding preview frame "
                              "while stopping preview");
                         break;
                     default:
                         // transition to QCS_ERROR
-                        LOGE("camera cb: invalid state %s for preview!",
+                        ALOGE("camera cb: invalid state %s for preview!",
                              obj->getCameraStateStr(obj->mCameraState));
                         break;
                     }
@@ -1829,7 +1829,7 @@
                     break;
                 default:
                     // transition to QCS_ERROR
-                    LOGE("unexpected cb %d for CAMERA_FUNC_START_PREVIEW.",
+                    ALOGE("unexpected cb %d for CAMERA_FUNC_START_PREVIEW.",
                          cb);
                 }
                 break;
@@ -1872,7 +1872,7 @@
                     }
                 } else {  // transition to QCS_ERROR
                     if (obj->mCameraState == QCS_ERROR) {
-                        LOGE("camera cb: invalid state %s for taking a picture!",
+                        ALOGE("camera cb: invalid state %s for taking a picture!",
                              obj->getCameraStateStr(obj->mCameraState));
                         obj->mRawPictureCallback(NULL, obj->mPictureCallbackCookie);
                         obj->mJpegPictureCallback(NULL, obj->mPictureCallbackCookie);
@@ -1892,7 +1892,7 @@
                         obj->receiveJpegPictureFragment(
                             (JPEGENC_CBrtnType *)parm4);
                     }
-                    else LOGE("camera cb: invalid state %s for receiving "
+                    else ALOGE("camera cb: invalid state %s for receiving "
                               "JPEG fragment!",
                               obj->getCameraStateStr(obj->mCameraState));
                     break;
@@ -1916,13 +1916,13 @@
                         TRANSITION(QCS_WAITING_JPEG, QCS_IDLE);
                     }
                     // transition to QCS_ERROR
-                    else LOGE("camera cb: invalid state %s for "
+                    else ALOGE("camera cb: invalid state %s for "
                               "receiving JPEG!",
                               obj->getCameraStateStr(obj->mCameraState));
                     break;
                 default:
                     // transition to QCS_ERROR
-                    LOGE("camera cb: unknown cb %d for JPEG!", cb);
+                    ALOGE("camera cb: unknown cb %d for JPEG!", cb);
                 }
             break;
             CAMERA_STATE(CAMERA_FUNC_START_FOCUS) {
@@ -1946,10 +1946,10 @@
                     }
                         break;
                     case CAMERA_EXIT_CB_ABORT:
-                        LOGE("camera cb: autofocus aborted");
+                        ALOGE("camera cb: autofocus aborted");
                         break;
                     case CAMERA_EXIT_CB_FAILED: {
-                        LOGE("camera cb: autofocus failed");
+                        ALOGE("camera cb: autofocus failed");
                         Mutex::Autolock lock(&obj->mStateLock);
                         if (obj->mAutoFocusCallback) {
                             obj->mAutoFocusCallback(false,
@@ -1959,14 +1959,14 @@
                     }
                         break;
                     default:
-                        LOGE("camera cb: unknown cb %d for "
+                        ALOGE("camera cb: unknown cb %d for "
                              "CAMERA_FUNC_START_FOCUS!", cb);
                     }
                 }
             } break;
         default:
             // transition to QCS_ERROR
-            LOGE("Unknown camera-callback status %d", cb);
+            ALOGE("Unknown camera-callback status %d", cb);
         }
     }
 
@@ -2073,7 +2073,7 @@
             
             mFd = mHeap->getHeapID();
             if (::ioctl(mFd, PMEM_GET_SIZE, &mSize)) {
-                LOGE("pmem pool %s ioctl(PMEM_GET_SIZE) error %s (%d)",
+                ALOGE("pmem pool %s ioctl(PMEM_GET_SIZE) error %s (%d)",
                      pmem_pool,
                      ::strerror(errno), errno);
                 mHeap.clear();
@@ -2086,7 +2086,7 @@
             
             completeInitialization();
         }
-        else LOGE("pmem pool %s error: could not create master heap!",
+        else ALOGE("pmem pool %s error: could not create master heap!",
                   pmem_pool);
     }
 
diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp
index ae782cd..f5326e2 100644
--- a/libcopybit/copybit.cpp
+++ b/libcopybit/copybit.cpp
@@ -205,7 +205,7 @@
 {
     int err = ioctl(dev->mFD, MSMFB_BLIT,
                     (struct mdp_blit_req_list const*)list);
-    LOGE_IF(err<0, "copyBits failed (%s)", strerror(errno));
+    ALOGE_IF(err<0, "copyBits failed (%s)", strerror(errno));
     if (err == 0) {
         return 0;
     } else {
@@ -269,7 +269,7 @@
                 ctx->mFlags |= MDP_ROT_270;
                 break;
             default:
-                LOGE("Invalid value for COPYBIT_ROTATION_DEG");
+                ALOGE("Invalid value for COPYBIT_ROTATION_DEG");
                 status = -EINVAL;
                 break;
             }
@@ -456,7 +456,7 @@
     
     if (ctx->mFD < 0) {
         status = errno;
-        LOGE("Error opening frame buffer errno=%d (%s)",
+        ALOGE("Error opening frame buffer errno=%d (%s)",
              status, strerror(status));
         status = -status;
     } else {
@@ -466,11 +466,11 @@
                 /* Success */
                 status = 0;
             } else {
-                LOGE("Error not msm frame buffer");
+                ALOGE("Error not msm frame buffer");
                 status = -EINVAL;
             }
         } else {
-            LOGE("Error executing ioctl for screen info");
+            ALOGE("Error executing ioctl for screen info");
             status = -errno;
         }
     }
diff --git a/libgralloc-qsd8k/allocator.cpp b/libgralloc-qsd8k/allocator.cpp
index e7645b1..f2a3c6b 100644
--- a/libgralloc-qsd8k/allocator.cpp
+++ b/libgralloc-qsd8k/allocator.cpp
@@ -113,7 +113,7 @@
                 mList.insertBefore(free_chunk, split);
             }
 
-            LOGE_IF(((free_chunk->start*kMemoryAlign)&(pagesize-1)),
+            ALOGE_IF(((free_chunk->start*kMemoryAlign)&(pagesize-1)),
                     "page is not aligned!!!");
 
             const ssize_t tail_free = free_size - (size+extra);
diff --git a/libgralloc-qsd8k/framebuffer.cpp b/libgralloc-qsd8k/framebuffer.cpp
index 45a418c..0f71078 100644
--- a/libgralloc-qsd8k/framebuffer.cpp
+++ b/libgralloc-qsd8k/framebuffer.cpp
@@ -115,7 +115,7 @@
         m->info.activate = FB_ACTIVATE_VBL;
         m->info.yoffset = offset / m->finfo.line_length;
         if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) {
-            LOGE("FBIOPUT_VSCREENINFO failed");
+            ALOGE("FBIOPUT_VSCREENINFO failed");
             m->base.unlock(&m->base, buffer); 
             return -errno;
         }
@@ -334,7 +334,7 @@
 
     void* vaddr = mmap(0, fbSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
     if (vaddr == MAP_FAILED) {
-        LOGE("Error mapping the framebuffer (%s)", strerror(errno));
+        ALOGE("Error mapping the framebuffer (%s)", strerror(errno));
         return -errno;
     }
     module->framebuffer->base = intptr_t(vaddr);
@@ -449,5 +449,5 @@
     blit.req.src_rect.h = blit.req.dst_rect.h = h;
 
     if (ioctl(fd, MSMFB_BLIT, &blit))
-        LOGE("MSMFB_BLIT failed = %d", -errno);
+        ALOGE("MSMFB_BLIT failed = %d", -errno);
 }
diff --git a/libgralloc-qsd8k/gpu.cpp b/libgralloc-qsd8k/gpu.cpp
index 90ff445..1ed7264 100644
--- a/libgralloc-qsd8k/gpu.cpp
+++ b/libgralloc-qsd8k/gpu.cpp
@@ -148,7 +148,7 @@
 
         if ((flags & private_handle_t::PRIV_FLAGS_USES_PMEM) != 0) {
           if ((flags & private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP) != 0) {
-              LOGE("attempting to allocate a gralloc buffer with both the "
+              ALOGE("attempting to allocate a gralloc buffer with both the "
                    "USES_PMEM and USES_PMEM_ADSP flags.  Unsetting the "
                    "USES_PMEM_ADSP flag.");
               flags &= ~private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP;
@@ -171,14 +171,14 @@
                 err = 0;
                 goto try_ashmem;
             } else {
-                LOGE("couldn't open pmem (%s)", strerror(errno));
+                ALOGE("couldn't open pmem (%s)", strerror(errno));
             }
         }
     } else {
 try_ashmem:
         fd = deps.ashmem_create_region("gralloc-buffer", size);
         if (fd < 0) {
-            LOGE("couldn't create ashmem (%s)", strerror(errno));
+            ALOGE("couldn't create ashmem (%s)", strerror(errno));
             err = -errno;
         }
     }
@@ -191,7 +191,7 @@
         *pHandle = hnd;
     }
 
-    LOGE_IF(err, "gralloc failed err=%s", strerror(-err));
+    ALOGE_IF(err, "gralloc failed err=%s", strerror(-err));
 
     return err;
 }
@@ -240,7 +240,7 @@
 
         case HAL_PIXEL_FORMAT_YV12:
             if ((w&1) || (h&1)) {
-                LOGE("w or h is odd for HAL_PIXEL_FORMAT_YV12");
+                ALOGE("w or h is odd for HAL_PIXEL_FORMAT_YV12");
                 return -EINVAL;
             }
             alignedw = ALIGN(w, 16);
@@ -250,7 +250,7 @@
             break;
 
         default:
-            LOGE("unrecognized pixel format: %d", format);
+            ALOGE("unrecognized pixel format: %d", format);
             return -EINVAL;
     }
 
diff --git a/libgralloc-qsd8k/gralloc_priv.h b/libgralloc-qsd8k/gralloc_priv.h
index c573941..2aca95f 100644
--- a/libgralloc-qsd8k/gralloc_priv.h
+++ b/libgralloc-qsd8k/gralloc_priv.h
@@ -147,7 +147,7 @@
                 h->numInts != sNumInts || h->numFds != sNumFds ||
                 hnd->magic != sMagic) 
         {
-            LOGE("invalid gralloc handle (at %p)", h);
+            ALOGE("invalid gralloc handle (at %p)", h);
             return -EINVAL;
         }
         return 0;
diff --git a/libgralloc-qsd8k/mapper.cpp b/libgralloc-qsd8k/mapper.cpp
index ef24270..753686e 100644
--- a/libgralloc-qsd8k/mapper.cpp
+++ b/libgralloc-qsd8k/mapper.cpp
@@ -63,7 +63,7 @@
         void* mappedAddress = mmap(0, size,
                 PROT_READ|PROT_WRITE, MAP_SHARED, hnd->fd, 0);
         if (mappedAddress == MAP_FAILED) {
-            LOGE("Could not mmap handle %p, fd=%d (%s)",
+            ALOGE("Could not mmap handle %p, fd=%d (%s)",
                     handle, hnd->fd, strerror(errno));
             hnd->base = 0;
             return -errno;
@@ -89,7 +89,7 @@
 #endif
         //ALOGD("unmapping from %p, size=%d", base, size);
         if (munmap(base, size) < 0) {
-            LOGE("Could not unmap %s", strerror(errno));
+            ALOGE("Could not unmap %s", strerror(errno));
         }
     }
     hnd->base = 0;
@@ -141,7 +141,7 @@
 
     private_handle_t* hnd = (private_handle_t*)handle;
     
-    LOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
+    ALOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
             "[unregister] handle %p still locked (state=%08x)",
             hnd, hnd->lockState);
 
@@ -165,7 +165,7 @@
      * to un-map it. It's an error to be here with a locked buffer.
      */
 
-    LOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
+    ALOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
             "[terminate] handle %p still locked (state=%08x)",
             hnd, hnd->lockState);
 
@@ -206,12 +206,12 @@
 
         if (current_value & private_handle_t::LOCK_STATE_WRITE) {
             // already locked for write 
-            LOGE("handle %p already locked for write", handle);
+            ALOGE("handle %p already locked for write", handle);
             return -EBUSY;
         } else if (current_value & private_handle_t::LOCK_STATE_READ_MASK) {
             // already locked for read
             if (usage & (GRALLOC_USAGE_SW_WRITE_MASK | GRALLOC_USAGE_HW_RENDER)) {
-                LOGE("handle %p already locked for read", handle);
+                ALOGE("handle %p already locked for read", handle);
                 return -EBUSY;
             } else {
                 // this is not an error
@@ -285,7 +285,7 @@
         region.offset = hnd->offset;
         region.len = hnd->size;
         err = ioctl(hnd->fd, PMEM_CACHE_FLUSH, &region);
-        LOGE_IF(err < 0, "cannot flush handle %p (offs=%x len=%x)\n",
+        ALOGE_IF(err < 0, "cannot flush handle %p (offs=%x len=%x)\n",
                 hnd, hnd->offset, hnd->size);
         hnd->flags &= ~private_handle_t::PRIV_FLAGS_NEEDS_FLUSH;
     }
@@ -303,7 +303,7 @@
         }
 
         if ((new_value & private_handle_t::LOCK_STATE_READ_MASK) == 0) {
-            LOGE("handle %p not locked", handle);
+            ALOGE("handle %p not locked", handle);
             return -EINVAL;
         }
 
diff --git a/libgralloc-qsd8k/pmemalloc.cpp b/libgralloc-qsd8k/pmemalloc.cpp
index 895e53d..73093ed 100644
--- a/libgralloc-qsd8k/pmemalloc.cpp
+++ b/libgralloc-qsd8k/pmemalloc.cpp
@@ -89,7 +89,7 @@
         size_t size = 0;
         err = deps.getPmemTotalSize(fd, &size);
         if (err < 0) {
-            LOGE("%s: PMEM_GET_TOTAL_SIZE failed (%d), limp mode", pmemdev,
+            ALOGE("%s: PMEM_GET_TOTAL_SIZE failed (%d), limp mode", pmemdev,
                     err);
             size = 8<<20;   // 8 MiB
         }
@@ -98,7 +98,7 @@
         void* base = deps.mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
                 0);
         if (base == MAP_FAILED) {
-            LOGE("%s: failed to map pmem master fd: %s", pmemdev,
+            ALOGE("%s: failed to map pmem master fd: %s", pmemdev,
                     strerror(deps.getErrno()));
             err = -deps.getErrno();
             base = 0;
@@ -109,7 +109,7 @@
             master_base = base;
         }
     } else {
-        LOGE("%s: failed to open pmem device: %s", pmemdev,
+        ALOGE("%s: failed to open pmem device: %s", pmemdev,
                 strerror(deps.getErrno()));
         err = -deps.getErrno();
     }
@@ -127,7 +127,7 @@
         // first time, try to initialize pmem
         err = init_pmem_area_locked();
         if (err) {
-            LOGE("%s: failed to initialize pmem area", pmemdev);
+            ALOGE("%s: failed to initialize pmem area", pmemdev);
             master_fd = err;
         }
     } else if (err < 0) {
@@ -152,7 +152,7 @@
         int offset = allocator.allocate(size);
         if (offset < 0) {
             // no more pmem memory
-            LOGE("%s: no more pmem available", pmemdev);
+            ALOGE("%s: no more pmem available", pmemdev);
             err = -ENOMEM;
         } else {
             int openFlags = get_open_flags(usage);
@@ -172,7 +172,7 @@
                 err = deps.mapPmem(fd, offset, size);
 
             if (err < 0) {
-                LOGE("%s: failed to initialize pmem sub-heap: %d", pmemdev,
+                ALOGE("%s: failed to initialize pmem sub-heap: %d", pmemdev,
                         err);
                 err = -deps.getErrno();
                 deps.close(fd);
@@ -199,7 +199,7 @@
     int err = 0;
     if (fd >= 0) {
         int err = deps.unmapPmem(fd, offset, size);
-        LOGE_IF(err<0, "PMEM_UNMAP failed (%s), fd=%d, sub.offset=%u, "
+        ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), fd=%d, sub.offset=%u, "
                 "sub.size=%u", strerror(deps.getErrno()), fd, offset, size);
         if (err == 0) {
             // we can't deallocate the memory in case of UNMAP failure
@@ -281,7 +281,7 @@
 
     void* base = deps.mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
     if (base == MAP_FAILED) {
-        LOGE("%s: failed to map pmem fd: %s", pmemdev,
+        ALOGE("%s: failed to map pmem fd: %s", pmemdev,
              strerror(deps.getErrno()));
         err = -deps.getErrno();
         deps.close(fd);
diff --git a/libgralloc/allocator.cpp b/libgralloc/allocator.cpp
index e7645b1..f2a3c6b 100644
--- a/libgralloc/allocator.cpp
+++ b/libgralloc/allocator.cpp
@@ -113,7 +113,7 @@
                 mList.insertBefore(free_chunk, split);
             }
 
-            LOGE_IF(((free_chunk->start*kMemoryAlign)&(pagesize-1)),
+            ALOGE_IF(((free_chunk->start*kMemoryAlign)&(pagesize-1)),
                     "page is not aligned!!!");
 
             const ssize_t tail_free = free_size - (size+extra);
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index b27f0d9..fffbbb1 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -101,7 +101,7 @@
         m->info.activate = FB_ACTIVATE_VBL;
         m->info.yoffset = offset / m->finfo.line_length;
         if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) {
-            LOGE("FBIOPUT_VSCREENINFO failed");
+            ALOGE("FBIOPUT_VSCREENINFO failed");
             m->base.unlock(&m->base, buffer); 
             return -errno;
         }
@@ -298,7 +298,7 @@
 
     void* vaddr = mmap(0, fbSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
     if (vaddr == MAP_FAILED) {
-        LOGE("Error mapping the framebuffer (%s)", strerror(errno));
+        ALOGE("Error mapping the framebuffer (%s)", strerror(errno));
         return -errno;
     }
     module->framebuffer->base = intptr_t(vaddr);
@@ -412,5 +412,5 @@
     blit.req.src_rect.h = blit.req.dst_rect.h = h;
 
     if (ioctl(fd, MSMFB_BLIT, &blit))
-        LOGE("MSMFB_BLIT failed = %d", -errno);
+        ALOGE("MSMFB_BLIT failed = %d", -errno);
 }
diff --git a/libgralloc/gralloc.cpp b/libgralloc/gralloc.cpp
index 894b51b..4b6b4ac 100644
--- a/libgralloc/gralloc.cpp
+++ b/libgralloc/gralloc.cpp
@@ -200,7 +200,7 @@
         size_t size;
         pmem_region region;
         if (ioctl(master_fd, PMEM_GET_TOTAL_SIZE, &region) < 0) {
-            LOGE("PMEM_GET_TOTAL_SIZE failed, limp mode");
+            ALOGE("PMEM_GET_TOTAL_SIZE failed, limp mode");
             size = 8<<20;   // 8 MiB
         } else {
             size = region.len;
@@ -247,11 +247,11 @@
 {
     int err = 0;
     int gpu = open("/dev/msm_hw3dm", O_RDWR, 0);
-    LOGE_IF(gpu<0, "could not open hw3dm (%s)", strerror(errno));
+    ALOGE_IF(gpu<0, "could not open hw3dm (%s)", strerror(errno));
     if (gpu >= 0) {
         struct hw3d_region regions[HW3D_NUM_REGIONS];
         if (ioctl(gpu, HW3D_GET_REGIONS, regions) < 0) {
-            LOGE("HW3D_GET_REGIONS failed (%s)", strerror(errno));
+            ALOGE("HW3D_GET_REGIONS failed (%s)", strerror(errno));
             err = -errno;
         } else {
             ALOGD("smi: offset=%08lx, len=%08lx, phys=%p", 
@@ -272,7 +272,7 @@
                     gpu, regions[FB_ARENA].map_offset);
 
             if (base == MAP_FAILED) {
-                LOGE("mmap EBI1 (%s)", strerror(errno));
+                ALOGE("mmap EBI1 (%s)", strerror(errno));
                 err = -errno;
                 base = 0;
                 close(gpu);
@@ -338,7 +338,7 @@
 try_ashmem:
         fd = ashmem_create_region("gralloc-buffer", size);
         if (fd < 0) {
-            LOGE("couldn't create ashmem (%s)", strerror(errno));
+            ALOGE("couldn't create ashmem (%s)", strerror(errno));
             err = -errno;
         }
     } else if ((usage & GRALLOC_USAGE_HW_RENDER) == 0) {
@@ -384,7 +384,7 @@
                 err = 0;
                 goto try_ashmem;
             } else {
-                LOGE("couldn't open pmem (%s)", strerror(errno));
+                ALOGE("couldn't open pmem (%s)", strerror(errno));
             }
         }
     } else {
@@ -451,7 +451,7 @@
         }
     }
     
-    LOGE_IF(err, "gralloc failed err=%s", strerror(-err));
+    ALOGE_IF(err, "gralloc failed err=%s", strerror(-err));
     
     return err;
 }
@@ -534,7 +534,7 @@
             if (hnd->fd >= 0) {
                 struct pmem_region sub = { hnd->offset, hnd->size };
                 int err = ioctl(hnd->fd, PMEM_UNMAP, &sub);
-                LOGE_IF(err<0, "PMEM_UNMAP failed (%s), "
+                ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), "
                         "fd=%d, sub.offset=%lu, sub.size=%lu",
                         strerror(errno), hnd->fd, hnd->offset, hnd->size);
                 if (err == 0) {
diff --git a/libgralloc/gralloc_priv.h b/libgralloc/gralloc_priv.h
index 3925d79..921c385 100644
--- a/libgralloc/gralloc_priv.h
+++ b/libgralloc/gralloc_priv.h
@@ -109,7 +109,7 @@
                 h->numInts != sNumInts || h->numFds != sNumFds ||
                 hnd->magic != sMagic) 
         {
-            LOGE("invalid gralloc handle (at %p)", h);
+            ALOGE("invalid gralloc handle (at %p)", h);
             return -EINVAL;
         }
         return 0;
diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp
index 33a0de2..d20a5f0 100644
--- a/libgralloc/mapper.cpp
+++ b/libgralloc/mapper.cpp
@@ -63,7 +63,7 @@
         void* mappedAddress = mmap(0, size,
                 PROT_READ|PROT_WRITE, MAP_SHARED, hnd->fd, 0);
         if (mappedAddress == MAP_FAILED) {
-            LOGE("Could not mmap handle %p, fd=%d (%s)",
+            ALOGE("Could not mmap handle %p, fd=%d (%s)",
                     handle, hnd->fd, strerror(errno));
             hnd->base = 0;
             return -errno;
@@ -89,7 +89,7 @@
 #endif
         //ALOGD("unmapping from %p, size=%d, flags=%08x", base, size, hnd->flags);
         if (munmap(base, size) < 0) {
-            LOGE("Could not unmap %s", strerror(errno));
+            ALOGE("Could not unmap %s", strerror(errno));
         }
     }
     hnd->base = 0;
diff --git a/liblights/lights.c b/liblights/lights.c
index c7ddd9a..fed150c 100644
--- a/liblights/lights.c
+++ b/liblights/lights.c
@@ -113,7 +113,7 @@
         return amt == -1 ? -errno : 0;
     } else {
         if (already_warned == 0) {
-            LOGE("write_int failed to open %s\n", path);
+            ALOGE("write_int failed to open %s\n", path);
             already_warned = 1;
         }
         return -errno;
diff --git a/librpc/debug.h b/librpc/debug.h
index 4c6bdc3..fb42214 100644
--- a/librpc/debug.h
+++ b/librpc/debug.h
@@ -52,14 +52,14 @@
 #define E(x...) do {                                        \
         fprintf(stderr, "%s(%d) ", __FUNCTION__, __LINE__); \
         fprintf(stderr, ##x);                               \
-        LOGE(x);                                            \
+        ALOGE(x);                                            \
     } while(0)
 
 #define FAILIF(cond, msg...) do {                                              \
         if (__builtin_expect (cond, 0)) {                                      \
             fprintf(stderr, "%s:%s:(%d): ", __FILE__, __FUNCTION__, __LINE__); \
             fprintf(stderr, ##msg);                                            \
-            LOGE(msg);                                                         \
+            ALOGE(msg);                                                         \
         }                                                                      \
     } while(0)