am c88d0868: (-s ours) am 6afd0fdf: am 55d470d3: wingray: update kernel -- DO NOT MERGE

* commit 'c88d0868ff03824547b8976824f5d82309afedae':
  wingray: update kernel -- DO NOT MERGE
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 38c1de5..b6f829f 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -87,3 +87,7 @@
 # Avoid the generation of ldrcc instructions
 NEED_WORKAROUND_CORTEX_A9_745320 := true
 BOARD_KERNEL_CMDLINE := androidboot.carrier=wifi-only product_type=w
+
+# Use the open-source board-info file if none was set by the vendor
+# config.
+TARGET_BOARD_INFO_FILE ?= device/moto/wingray/board-info.txt
diff --git a/CleanSpec.mk b/CleanSpec.mk
index df5b41e..14f65d3 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -48,3 +48,4 @@
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/root/default.prop)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.wifi.direct.xml)
diff --git a/device_base.mk b/device_base.mk
index 485ace9..5a97f1a 100644
--- a/device_base.mk
+++ b/device_base.mk
@@ -18,8 +18,7 @@
     device/moto/wingray/overlay
 
 PRODUCT_PROPERTY_OVERRIDES := \
-    wifi.interface=wlan0 \
-    wifi.supplicant_scan_interval=15
+    wifi.interface=wlan0
 
 # Set default USB interface
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
@@ -91,6 +90,10 @@
 PRODUCT_COPY_FILES += \
     device/moto/wingray/media_profiles.xml:system/etc/media_profiles.xml
 
+# media codec config xml file
+PRODUCT_COPY_FILES += \
+    device/moto/wingray/media_codecs.xml:system/etc/media_codecs.xml
+
 # Bluetooth config file
 PRODUCT_COPY_FILES += \
     system/bluetooth/data/main.nonsmartphone.conf:system/etc/bluetooth/main.conf \
diff --git a/egl.cfg b/egl.cfg
index a609179..c27a6c8 100644
--- a/egl.cfg
+++ b/egl.cfg
@@ -1,2 +1 @@
-0 0 android
-0 1 tegra
+0 0 tegra
diff --git a/full_wingray.mk b/full_wingray.mk
index 771f4b2..b8f1d8f 100644
--- a/full_wingray.mk
+++ b/full_wingray.mk
@@ -25,10 +25,6 @@
 	LiveWallpapersPicker \
 	VisualizationWallpapers
 
-# Camera
-PRODUCT_PACKAGES += \
-    Camera
-
 # Inherit from those products. Most specific first.
 $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
 # This is where we'd set a backup provider if we had one
diff --git a/init.stingray.rc b/init.stingray.rc
index ba964a6..07f7825 100644
--- a/init.stingray.rc
+++ b/init.stingray.rc
@@ -171,7 +171,7 @@
     group compass misc input
 
 service wpa_supplicant /system/bin/wpa_supplicant \
-    -Dnl80211 -iwlan0 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin
+    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
 #   we will start as root and wpa_supplicant will switch to user wifi
 #   after setting up the capabilities required for WEXT
 #   user wifi
@@ -181,7 +181,7 @@
     disabled
     oneshot
 
-service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
+service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
     class main
     disabled
     oneshot
diff --git a/init.stingray.usb.rc b/init.stingray.usb.rc
index 5ffd949..0559568 100644
--- a/init.stingray.usb.rc
+++ b/init.stingray.usb.rc
@@ -1,7 +1,7 @@
 on boot
-    write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
-    write /sys/class/android_usb/android0/iProduct $ro.boot.modelno
-    write /sys/class/android_usb/android0/iSerial $ro.serialno
+    write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
+    write /sys/class/android_usb/android0/iProduct ${ro.boot.modelno}
+    write /sys/class/android_usb/android0/iSerial ${ro.serialno}
     write /sys/class/android_usb/android0/f_rndis/manufacturer Motorola
     write /sys/class/android_usb/android0/f_rndis/vendorID 22b8
     write /sys/class/android_usb/android0/f_rndis/wceis 1
@@ -10,65 +10,65 @@
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70a8
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=mtp,adb
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70a9
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
     start adbd
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=rndis
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70ae
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/bDeviceClass 224
     write /sys/class/android_usb/android0/enable 1
     write /sys/class/net/rndis0/mtu 1428
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=rndis,adb
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70af
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/bDeviceClass 224
     write /sys/class/android_usb/android0/enable 1
     start adbd
     write /sys/class/net/rndis0/mtu 1428
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=ptp
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70b4
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=ptp,adb
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70b5
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
     start adbd
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 # factory test
 on property:sys.usb.config=usbnet
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70a3
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/android0/enable 1
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 # factory test with adb on. Note adb over TCP will be used.
 on property:sys.usb.config=usbnet,adb
@@ -77,7 +77,7 @@
     write /sys/class/android_usb/android0/idProduct 70a3
     write /sys/class/android_usb/android0/functions usbnet
     write /sys/class/android_usb/android0/enable 1
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
     setprop service.adb.tcp.port 5555
     start adbd
 
@@ -86,39 +86,39 @@
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70b0
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/f_acm/instances 3
     write /sys/class/android_usb/android0/enable 1
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=acm,usbnet,adb
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70b1
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/f_acm/instances 3
     write /sys/class/android_usb/android0/enable 1
     start adbd
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=rndis,acm,usbnet
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70b2
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/f_acm/instances 3
     write /sys/class/android_usb/android0/enable 1
     write /sys/class/net/rndis0/mtu 1428
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 on property:sys.usb.config=rndis,acm,usbnet,adb
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 22b8
     write /sys/class/android_usb/android0/idProduct 70b3
-    write /sys/class/android_usb/android0/functions $sys.usb.config
+    write /sys/class/android_usb/android0/functions ${sys.usb.config}
     write /sys/class/android_usb/f_acm/instances 3
     write /sys/class/android_usb/android0/enable 1
     start adbd
     write /sys/class/net/rndis0/mtu 1428
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
diff --git a/kernel b/kernel
index 31ef936..5ae06ef 100644
--- a/kernel
+++ b/kernel
Binary files differ
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp
index fac9a63..cd94132 100644
--- a/libaudio/AudioHardware.cpp
+++ b/libaudio/AudioHardware.cpp
@@ -58,7 +58,7 @@
     /*mCpcapGain*/
     mSpkrVolume(-1), mMicVolume(-1), mEcnsEnabled(0), mEcnsRequested(0), mBtScoOn(false)
 {
-    LOGV("AudioHardware constructor");
+    ALOGV("AudioHardware constructor");
 }
 
 // designed to be called multiple times for retries
@@ -70,25 +70,25 @@
 
     mCpcapCtlFd = ::open("/dev/audio_ctl", O_RDWR);
     if (mCpcapCtlFd < 0) {
-        LOGE("open /dev/audio_ctl failed: %s", strerror(errno));
+        ALOGE("open /dev/audio_ctl failed: %s", strerror(errno));
         goto error;
     }
 
     if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_OUT_GET_OUTPUT, &mCurOutDevice) < 0) {
-        LOGE("could not get output device: %s", strerror(errno));
+        ALOGE("could not get output device: %s", strerror(errno));
         goto error;
     }
     if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_IN_GET_INPUT, &mCurInDevice) < 0) {
-        LOGE("could not get input device: %s", strerror(errno));
+        ALOGE("could not get input device: %s", strerror(errno));
         goto error;
     }
     // For bookkeeping only
     if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_OUT_GET_RATE, &mHwOutRate) < 0) {
-        LOGE("could not get output rate: %s", strerror(errno));
+        ALOGE("could not get output rate: %s", strerror(errno));
         goto error;
     }
     if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_IN_GET_RATE, &mHwInRate) < 0) {
-        LOGE("could not get input rate: %s", strerror(errno));
+        ALOGE("could not get input rate: %s", strerror(errno));
         goto error;
     }
 
@@ -112,7 +112,7 @@
 
 AudioHardware::~AudioHardware()
 {
-    LOGV("AudioHardware destructor");
+    ALOGV("AudioHardware destructor");
     for (size_t index = 0; index < mInputs.size(); index++) {
         closeInputStream((AudioStreamIn*)mInputs[index]);
     }
@@ -136,12 +136,12 @@
         ::read(fd, &version, sizeof(uint32_t));
         ::read(fd, &barker, sizeof(uint32_t));
         rc = ::read(fd, mCpcapGain, sizeof(mCpcapGain));
-        LOGD("Read gain file, format %X version %X", format, version);
+        ALOGD("Read gain file, format %X version %X", format, version);
         ::close(fd);
     }
     if (rc != sizeof(mCpcapGain) || format != 0x30303032) {
         int gain;
-        LOGE("CPCAP gain file not valid. Using defaults.");
+        ALOGE("CPCAP gain file not valid. Using defaults.");
         for (int i=0; i<AUDIO_HW_GAIN_NUM_DIRECTIONS; i++) {
             if (i==AUDIO_HW_GAIN_SPKR_GAIN)
                 gain = 11;
@@ -179,13 +179,13 @@
         for (unsigned tries = 0; tries < MAX_INIT_TRIES; ++tries) {
             if (NO_ERROR == out->init())
                 break;
-            LOGW("AudioStreamOutTegra::init failed soft, retrying");
+            ALOGW("AudioStreamOutTegra::init failed soft, retrying");
             sleep(1);
         }
         status_t lStatus;
         lStatus = out->initCheck();
         if (NO_ERROR != lStatus) {
-            LOGE("AudioStreamOutTegra::init failed hard");
+            ALOGE("AudioStreamOutTegra::init failed hard");
         } else {
             lStatus = out->set(this, devices, format, channels, sampleRate);
         }
@@ -207,7 +207,7 @@
 void AudioHardware::closeOutputStream(AudioStreamOut* out) {
     Mutex::Autolock lock(mLock);
     if (mOutput == 0 || mOutput != out) {
-        LOGW("Attempt to close invalid output stream");
+        ALOGW("Attempt to close invalid output stream");
     }
     else {
         // AudioStreamOutTegra destructor calls standby which locks
@@ -253,7 +253,7 @@
 
     ssize_t index = mInputs.indexOf((AudioStreamInTegra *)in);
     if (index < 0) {
-        LOGW("Attempt to close invalid input stream");
+        ALOGW("Attempt to close invalid input stream");
     } else {
         mInputs.removeAt(index);
         mLock.unlock();
@@ -266,7 +266,7 @@
 {
     AutoMutex lock(mLock);
     bool wasInCall = isInCall();
-    LOGV("setMode() : new %d, old %d", mode, mMode);
+    ALOGV("setMode() : new %d, old %d", mode, mMode);
     status_t status = AudioHardwareBase::setMode(mode);
     if (status == NO_ERROR) {
         if (wasInCall ^ isInCall()) {
@@ -286,13 +286,13 @@
     status_t status = NO_ERROR;
     struct cpcap_audio_stream standby;
 
-    LOGV("AudioHardware::doStandby() putting %s in %s mode",
+    ALOGV("AudioHardware::doStandby() putting %s in %s mode",
             output ? "output" : "input",
             enable ? "standby" : "online" );
 
 // Debug code
     if (!mLock.tryLock()) {
-        LOGE("doStandby called without mLock held.");
+        ALOGE("doStandby called without mLock held.");
         mLock.unlock();
     }
 // end Debug code
@@ -311,16 +311,16 @@
         }
 
         if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_OUT_SET_OUTPUT, &standby) < 0) {
-            LOGE("could not turn off current output device: %s",
+            ALOGE("could not turn off current output device: %s",
                  strerror(errno));
             status = errno;
         }
 
         if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_OUT_GET_OUTPUT, &mCurOutDevice) < 0) {
-            LOGE("could not get current output device after standby: %s",
+            ALOGE("could not get current output device after standby: %s",
                  strerror(errno));
         }
-        LOGV("%s: after standby %s, output device %d is %s", __FUNCTION__,
+        ALOGV("%s: after standby %s, output device %d is %s", __FUNCTION__,
              enable ? "enable" : "disable", mCurOutDevice.id,
              mCurOutDevice.on ? "on" : "off");
     } else {
@@ -332,20 +332,20 @@
              * CPCAP to not send data through the i2s interface, and read()
              * will block until recording is resumed.
              */
-            LOGV("%s: stop recording", __FUNCTION__);
+            ALOGV("%s: stop recording", __FUNCTION__);
             if (::ioctl(stop_fd, TEGRA_AUDIO_IN_STOP) < 0) {
-                LOGE("could not stop recording: %s",
+                ALOGE("could not stop recording: %s",
                      strerror(errno));
             }
         }
 
         if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_IN_SET_INPUT, &standby) < 0) {
-            LOGE("could not turn off current input device: %s",
+            ALOGE("could not turn off current input device: %s",
                  strerror(errno));
             status = errno;
         }
         ::ioctl(mCpcapCtlFd, CPCAP_AUDIO_IN_GET_INPUT, &mCurInDevice);
-        LOGV("%s: after standby %s, input device %d is %s", __FUNCTION__,
+        ALOGV("%s: after standby %s, input device %d is %s", __FUNCTION__,
              enable ? "enable" : "disable", mCurInDevice.id,
              mCurInDevice.on ? "on" : "off");
     }
@@ -363,7 +363,7 @@
 {
     if (mMicMute != state) {
         mMicMute = state;
-        LOGV("setMicMute() %s", (state)?"ON":"OFF");
+        ALOGV("setMicMute() %s", (state)?"ON":"OFF");
     }
     return NO_ERROR;
 }
@@ -384,7 +384,7 @@
     const char BT_NREC_VALUE_ON[] = "on";
 
 
-    LOGV("setParameters() %s", keyValuePairs.string());
+    ALOGV("setParameters() %s", keyValuePairs.string());
 
     if (keyValuePairs.length() == 0) return BAD_VALUE;
 
@@ -392,10 +392,10 @@
     if (param.get(key, value) == NO_ERROR) {
         if (value == BT_NREC_VALUE_ON) {
             mBluetoothNrec = true;
-            LOGD("Turn on bluetooth NREC");
+            ALOGD("Turn on bluetooth NREC");
         } else {
             mBluetoothNrec = false;
-            LOGD("Turning noise reduction and echo cancellation off for BT "
+            ALOGD("Turning noise reduction and echo cancellation off for BT "
                  "headset");
         }
         doRouting();
@@ -407,13 +407,13 @@
         for (int i = 0; i < mNumSndEndpoints; i++) {
             if (!strcasecmp(value.string(), mSndEndpoints[i].name)) {
                 mBluetoothId = mSndEndpoints[i].id;
-                LOGD("Using custom acoustic parameters for %s", value.string());
+                ALOGD("Using custom acoustic parameters for %s", value.string());
                 break;
             }
         }
 #endif
         if (mBluetoothId == 0) {
-            LOGD("Using default acoustic parameters "
+            ALOGD("Using default acoustic parameters "
                  "(%s not in acoustic database)", value.string());
             doRouting();
         }
@@ -428,7 +428,7 @@
     String8 value;
     String8 key;
 
-    LOGV("getParameters() %s", keys.string());
+    ALOGV("getParameters() %s", keys.string());
 
 #ifdef USE_PROPRIETARY_AUDIO_EXTENSIONS
     key = "ec_supported";
@@ -446,11 +446,11 @@
     size_t bufsize;
 
     if (format != AudioSystem::PCM_16_BIT) {
-        LOGW("getInputBufferSize bad format: %d", format);
+        ALOGW("getInputBufferSize bad format: %d", format);
         return 0;
     }
     if (channelCount < 1 || channelCount > 2) {
-        LOGW("getInputBufferSize bad channel count: %d", channelCount);
+        ALOGW("getInputBufferSize bad channel count: %d", channelCount);
         return 0;
     }
 
@@ -461,7 +461,7 @@
        bufsize +=8;
        bufsize &= ~0x7;
     }
-    LOGV("%s: returns %d for rate %d", __FUNCTION__, bufsize, sampleRate);
+    ALOGV("%s: returns %d for rate %d", __FUNCTION__, bufsize, sampleRate);
     return bufsize;
 }
 
@@ -476,7 +476,7 @@
     else if (v > 1.0)
         v = 1.0;
 
-    LOGV("Setting unused in-call vol to %f",v);
+    ALOGV("Setting unused in-call vol to %f",v);
     mVoiceVol = v;
 
     return NO_ERROR;
@@ -489,7 +489,7 @@
     else if (v > 1.0)
         v = 1.0;
 
-    LOGV("Set master vol to %f.", v);
+    ALOGV("Set master vol to %f.", v);
     mMasterVol = v;
     Mutex::Autolock lock(mLock);
     int useCase = AUDIO_HW_GAIN_USECASE_MM;
@@ -519,19 +519,19 @@
 
     spkr = ceil(v * spkr);
     if (mSpkrVolume != spkr) {
-        LOGV("Set tx volume to %d", spkr);
+        ALOGV("Set tx volume to %d", spkr);
         int ret = ::ioctl(mCpcapCtlFd, CPCAP_AUDIO_OUT_SET_VOLUME, spkr);
         if (ret < 0) {
-            LOGE("could not set spkr volume: %s", strerror(errno));
+            ALOGE("could not set spkr volume: %s", strerror(errno));
             return ret;
         }
         mSpkrVolume = spkr;
     }
     if (mMicVolume != mic) {
-        LOGV("Set rx volume to %d", mic);
+        ALOGV("Set rx volume to %d", mic);
         int ret = ::ioctl(mCpcapCtlFd, CPCAP_AUDIO_IN_SET_VOLUME, mic);
         if (ret < 0) {
-            LOGE("could not set mic volume: %s", strerror(errno));
+            ALOGE("could not set mic volume: %s", strerror(errno));
             return ret;
         }
         mMicVolume = mic;
@@ -546,7 +546,7 @@
     AudioStreamInTegra *input = getActiveInput_l();
     uint32_t inDev = (input == NULL) ? 0 : input->devices();
     if (!mOutput) {
-       LOGE("No output device.");
+       ALOGE("No output device.");
        return 0;
     }
     uint32_t outDev = mOutput->devices();
@@ -564,7 +564,7 @@
     else
        path = AUDIO_HW_GAIN_SPEAKERPHONE;
 
-    LOGV("Picked gain[%d][%d][%d] which is %d.",direction, usecase, path,
+    ALOGV("Picked gain[%d][%d][%d] which is %d.",direction, usecase, path,
           mCpcapGain[direction][usecase][path]);
 
     return mCpcapGain[direction][usecase][path];
@@ -605,7 +605,7 @@
     int sndInDevice = -1;
     bool btScoOn = btScoOutDevices||btScoInDevice;
 
-    LOGV("%s: inputDevice %x, outputDevices %x", __FUNCTION__,
+    ALOGV("%s: inputDevice %x, outputDevices %x", __FUNCTION__,
          inputDevice, outputDevices);
 
     switch (inputDevice) {
@@ -646,7 +646,7 @@
 
     if (sndInDevice != (int)mCurInDevice.id) {
         if (sndInDevice == -1) {
-            LOGV("input device set %x not supported, defaulting to on-board mic",
+            ALOGV("input device set %x not supported, defaulting to on-board mic",
                  inputDevice);
             mCurInDevice.id = CPCAP_AUDIO_IN_MIC1;
         }
@@ -655,17 +655,17 @@
 
         if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_IN_SET_INPUT,
                   &mCurInDevice) < 0)
-            LOGE("could not set input (%d, on %d): %s",
+            ALOGE("could not set input (%d, on %d): %s",
                  mCurInDevice.id, mCurInDevice.on, strerror(errno));
 
-        LOGV("current input %d, %s",
+        ALOGV("current input %d, %s",
              mCurInDevice.id,
              mCurInDevice.on ? "on" : "off");
     }
 
     if (sndOutDevice != (int)mCurOutDevice.id) {
         if (sndOutDevice == -1) {
-            LOGW("output device set %x not supported, defaulting to speaker",
+            ALOGW("output device set %x not supported, defaulting to speaker",
                  outputDevices);
             mCurOutDevice.id = CPCAP_AUDIO_OUT_SPEAKER;
         }
@@ -674,11 +674,11 @@
 
         if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_OUT_SET_OUTPUT,
                   &mCurOutDevice) < 0)
-            LOGE("could not set output (%d, on %d): %s",
+            ALOGE("could not set output (%d, on %d): %s",
                  mCurOutDevice.id, mCurOutDevice.on,
                  strerror(errno));
 
-        LOGV("current output %d, %s",
+        ALOGV("current output %d, %s",
              mCurOutDevice.id,
              mCurOutDevice.on ? "on" : "off");
     }
@@ -702,7 +702,7 @@
         } else {
             mHwOutRate = AUDIO_HW_OUT_SAMPLERATE;
         }
-        LOGD("EC/NS active, requests rate as %d for in/out", mHwInRate);
+        ALOGD("EC/NS active, requests rate as %d for in/out", mHwInRate);
     }
     else
 #endif
@@ -711,12 +711,12 @@
             mHwInRate = getActiveInputRate();
         }
         mHwOutRate = AUDIO_HW_OUT_SAMPLERATE;
-        LOGV("No EC/NS, set input rate %d, output %d.", mHwInRate, mHwOutRate);
+        ALOGV("No EC/NS, set input rate %d, output %d.", mHwInRate, mHwOutRate);
     }
     if (btScoOn) {
         mHwOutRate = 8000;
         mHwInRate = 8000;
-        LOGD("Bluetooth SCO active, rate forced to 8K");
+        ALOGD("Bluetooth SCO active, rate forced to 8K");
     }
 
     if (input) {
@@ -767,14 +767,14 @@
             bit_format = TEGRA_AUDIO_BIT_FORMAT_DSP;
             is_bt_bypass = true;
         }
-        LOGV("%s: bluetooth state changed. is_bt_bypass %d bit_format %d",
+        ALOGV("%s: bluetooth state changed. is_bt_bypass %d bit_format %d",
              __FUNCTION__, is_bt_bypass, bit_format);
         // Setup the I2S2-> DAP2/4 capture/playback path.
         if (::ioctl(mOutput->mBtFdIoCtl, TEGRA_AUDIO_SET_BIT_FORMAT, &bit_format) < 0) {
-            LOGE("could not set bit format %s", strerror(errno));
+            ALOGE("could not set bit format %s", strerror(errno));
         }
         if (::ioctl(mCpcapCtlFd, CPCAP_AUDIO_SET_BLUETOOTH_BYPASS, is_bt_bypass) < 0) {
-            LOGE("could not set bluetooth bypass %s", strerror(errno));
+            ALOGE("could not set bluetooth bypass %s", strerror(errno));
         }
 
         mBtScoOn = btScoOn;
@@ -892,7 +892,7 @@
         mSrcBuffer = new char[src_memory_required_stereo(MAX_FRAME_LEN, MAX_CONVERT_RATIO)];
     }
     if (mSrcBuffer == NULL) {
-        LOGE("Failed to allocate memory for sample rate converter.");
+        ALOGE("Failed to allocate memory for sample rate converter.");
         return;
     }
     mSrcInit.memory = (SRC16*)(mSrcBuffer);
@@ -924,7 +924,7 @@
     mState(AUDIO_STREAM_IDLE), /*mSrc*/ mLocked(false), mDriverRate(AUDIO_HW_OUT_SAMPLERATE),
     mInit(false)
 {
-    LOGV("AudioStreamOutTegra constructor");
+    ALOGV("AudioStreamOutTegra constructor");
 }
 
 // designed to be called multiple times for retries
@@ -936,7 +936,7 @@
 
 #define OPEN_FD(fd, dev)    fd = ::open(dev, O_RDWR);                              \
                             if (fd < 0) {                                          \
-                                LOGE("open " dev " failed: %s", strerror(errno));   \
+                                ALOGE("open " dev " failed: %s", strerror(errno));   \
                                 goto error;                                         \
                             }
     OPEN_FD(mFd, "/dev/audio0_out")
@@ -979,7 +979,7 @@
 void AudioHardware::AudioStreamOutTegra::setDriver_l(
         bool speaker, bool bluetooth, bool spdif, int sampleRate)
 {
-    LOGV("Out setDriver_l() Analog speaker? %s. Bluetooth? %s. S/PDIF? %s. sampleRate %d",
+    ALOGV("Out setDriver_l() Analog speaker? %s. Bluetooth? %s. S/PDIF? %s. sampleRate %d",
         speaker?"yes":"no", bluetooth?"yes":"no", spdif?"yes":"no", sampleRate);
 
     // force some reconfiguration at next write()
@@ -1035,10 +1035,10 @@
                 mBtFdCtl >= 0 &&
                 mBtFdIoCtl >= 0) {
         if (mSpdifFd < 0 || mSpdifFdCtl < 0)
-            LOGW("s/pdif driver not present");
+            ALOGW("s/pdif driver not present");
         return NO_ERROR;
     } else {
-        LOGE("Problem opening device files - Is your kernel compatible?");
+        ALOGE("Problem opening device files - Is your kernel compatible?");
         return NO_INIT;
     }
 }
@@ -1061,10 +1061,10 @@
 {
     status_t status;
     if (!mHardware) {
-        LOGE("%s: mHardware is null", __FUNCTION__);
+        ALOGE("%s: mHardware is null", __FUNCTION__);
         return NO_INIT;
     }
-    // LOGD("AudioStreamOutTegra::write(%p, %u) TID %d", buffer, bytes, gettid());
+    // ALOGD("AudioStreamOutTegra::write(%p, %u) TID %d", buffer, bytes, gettid());
     // Protect output state during the write process.
 
     if (mSleepReq) {
@@ -1125,9 +1125,9 @@
             Mutex::Autolock lock2(mFdLock);
             if (mSpdifFd >= 0) {
                 writtenToSpdif = ::write(mSpdifFd, buffer, outsize);
-                LOGV("%s: written %d bytes to SPDIF", __FUNCTION__, (int)writtenToSpdif);
+                ALOGV("%s: written %d bytes to SPDIF", __FUNCTION__, (int)writtenToSpdif);
             } else {
-                LOGW("s/pdif enabled but unavailable");
+                ALOGW("s/pdif enabled but unavailable");
             }
         }
         if (mIsBtEnabled) {
@@ -1144,7 +1144,7 @@
             if (!mSrc.initted() ||
                  mSrc.inRate() != (int)sampleRate() ||
                  mSrc.outRate() != mDriverRate) {
-                LOGD("%s: downconvert started from %d to %d",__FUNCTION__,
+                ALOGD("%s: downconvert started from %d to %d",__FUNCTION__,
                      sampleRate(), mDriverRate);
                 mSrc.init(sampleRate(), mDriverRate);
                 if (!mSrc.initted()) {
@@ -1187,7 +1187,7 @@
                 mSrc.mIoData.output_count--;
             }
             mSrc.srcConvert();
-            LOGV("Converted %d bytes at %d to %d bytes at %d",
+            ALOGV("Converted %d bytes at %d to %d bytes at %d",
                  outsize, sampleRate(), mSrc.mIoData.output_count*2, mDriverRate);
             if (mHaveSpareSample) {
                 int16_t *bufp = (int16_t*)buffer;
@@ -1196,7 +1196,7 @@
                 mHaveSpareSample = false;
             }
             outsize = mSrc.mIoData.output_count*2;
-            LOGV("Outsize is now %d", outsize);
+            ALOGV("Outsize is now %d", outsize);
         }
         if (mHardware->mAudioPP.isEcEnabled()) {
             // EC/NS is a blocking interface, to synchronise with read.
@@ -1208,7 +1208,7 @@
             // Indicate that it is safe to call setDriver_l() without locking mLock: if the input
             // stream is started, doRouting_l() will not block when setDriver_l() is called.
             mLocked = true;
-            LOGV("writeDownlinkEcns size %d", outsize);
+            ALOGV("writeDownlinkEcns size %d", outsize);
             written = mHardware->mAudioPP.writeDownlinkEcns(outFd,(void *)buffer,
                                                             stereo, outsize, &mFdLock);
             mLocked = false;
@@ -1233,7 +1233,7 @@
             // The sample rate conversion modifies the output size.
             if (outsize&0x3) {
                 int16_t* bufp = (int16_t *)buffer;
-//                LOGV("Keep the spare sample away from the driver.");
+//                ALOGV("Keep the spare sample away from the driver.");
                 mHaveSpareSample = true;
                 mSpareSample = bufp[outsize/2 - 1];
             }
@@ -1250,19 +1250,19 @@
             }
         }
         if (written < 0) {
-            LOGE("Error writing %d bytes to output: %s", outsize, strerror(errno));
+            ALOGE("Error writing %d bytes to output: %s", outsize, strerror(errno));
             status = written;
             goto error;
         }
 
         // Sample rate converter may be stashing a couple of bytes here or there,
         // so just report that all bytes were consumed. (it would be a bug not to.)
-        LOGV("write() written %d", bytes);
+        ALOGV("write() written %d", bytes);
         return bytes;
 
     }
 error:
-    LOGE("write(): error, return %d", status);
+    ALOGE("write(): error, return %d", status);
     standby();
     usleep(bytes * 1000 / frameSize() / sampleRate() * 1000);
 
@@ -1278,14 +1278,14 @@
 
 void AudioHardware::AudioStreamOutTegra::flush_l()
 {
-    LOGV("AudioStreamOutTegra::flush()");
+    ALOGV("AudioStreamOutTegra::flush()");
     if (::ioctl(mFdCtl, TEGRA_AUDIO_OUT_FLUSH) < 0)
-       LOGE("could not flush playback: %s", strerror(errno));
+       ALOGE("could not flush playback: %s", strerror(errno));
     if (::ioctl(mBtFdCtl, TEGRA_AUDIO_OUT_FLUSH) < 0)
-       LOGE("could not flush bluetooth: %s", strerror(errno));
+       ALOGE("could not flush bluetooth: %s", strerror(errno));
     if (mSpdifFdCtl >= 0 && ::ioctl(mSpdifFdCtl, TEGRA_AUDIO_OUT_FLUSH) < 0)
-       LOGE("could not flush spdif: %s", strerror(errno));
-    LOGV("AudioStreamOutTegra::flush() returns");
+       ALOGE("could not flush spdif: %s", strerror(errno));
+    ALOGV("AudioStreamOutTegra::flush() returns");
 }
 
 // FIXME: this is a workaround for issue 3387419 with impact on latency
@@ -1293,9 +1293,9 @@
 void AudioHardware::AudioStreamOutTegra::setNumBufs(int numBufs)
 {
     Mutex::Autolock lock(mFdLock);
-    LOGV("AudioStreamOutTegra::setNumBufs(%d)", numBufs);
+    ALOGV("AudioStreamOutTegra::setNumBufs(%d)", numBufs);
     if (::ioctl(mFdCtl, TEGRA_AUDIO_OUT_SET_NUM_BUFS, &numBufs) < 0)
-       LOGE("could not set number of output buffers: %s", strerror(errno));
+       ALOGE("could not set number of output buffers: %s", strerror(errno));
 }
 
 // Called with mLock and mHardware->mLock held
@@ -1305,7 +1305,7 @@
 
     if (mState < AUDIO_STREAM_NEW_RATE_REQ) {
         if (mState == AUDIO_STREAM_IDLE) {
-            LOGV("output %p going online", this);
+            ALOGV("output %p going online", this);
             mState = AUDIO_STREAM_CONFIG_REQ;
             // update EC state if necessary
             if (mHardware->getActiveInput_l() && mHardware->isEcRequested()) {
@@ -1343,7 +1343,7 @@
     // Now the DMA is empty, change the rate.
     if (::ioctl(mHardware->mCpcapCtlFd, CPCAP_AUDIO_OUT_SET_RATE,
               speaker_rate) < 0)
-        LOGE("could not set output rate(%d): %s",
+        ALOGE("could not set output rate(%d): %s",
               speaker_rate, strerror(errno));
 
     mDriverRate = mHardware->mHwOutRate;
@@ -1381,7 +1381,7 @@
     Mutex::Autolock lock2(mLock);
 
     if (mState != AUDIO_STREAM_IDLE) {
-        LOGV("output %p going into standby", this);
+        ALOGV("output %p going into standby", this);
         mState = AUDIO_STREAM_IDLE;
 
         // update EC state if necessary
@@ -1452,12 +1452,12 @@
     String8 key = String8(AudioParameter::keyRouting);
     status_t status = NO_ERROR;
     int device;
-    LOGV("AudioStreamOutTegra::setParameters() %s", keyValuePairs.string());
+    ALOGV("AudioStreamOutTegra::setParameters() %s", keyValuePairs.string());
 
     if (param.getInt(key, device) == NO_ERROR) {
         if (device != 0) {
             mDevices = device;
-            LOGV("set output routing %x", mDevices);
+            ALOGV("set output routing %x", mDevices);
             status = mHardware->doRouting();
         }
         param.remove(key);
@@ -1476,11 +1476,11 @@
     String8 key = String8(AudioParameter::keyRouting);
 
     if (param.get(key, value) == NO_ERROR) {
-        LOGV("get routing %x", mDevices);
+        ALOGV("get routing %x", mDevices);
         param.addInt(key, (int)mDevices);
     }
 
-    LOGV("AudioStreamOutTegra::getParameters() %s", param.toString().string());
+    ALOGV("AudioStreamOutTegra::getParameters() %s", param.toString().string());
     return param.toString();
 }
 
@@ -1502,7 +1502,7 @@
     mSource(AUDIO_SOURCE_DEFAULT), mLocked(false), mTotalBuffersRead(0),
     mDriverRate(AUDIO_HW_IN_SAMPLERATE), mEcnsRequested(0)
 {
-    LOGV("AudioStreamInTegra constructor");
+    ALOGV("AudioStreamInTegra constructor");
 }
 
 // serves a similar purpose as init()
@@ -1516,7 +1516,7 @@
     if (pFormat == 0)
         return status;
     if (*pFormat != AUDIO_HW_IN_FORMAT) {
-        LOGE("wrong in format %d, expecting %lld", *pFormat, AUDIO_HW_IN_FORMAT);
+        ALOGE("wrong in format %d, expecting %lld", *pFormat, AUDIO_HW_IN_FORMAT);
         *pFormat = AUDIO_HW_IN_FORMAT;
         return status;
     }
@@ -1526,7 +1526,7 @@
 
     uint32_t rate = hw->getInputSampleRate(*pRate);
     if (rate != *pRate) {
-        LOGE("wrong sample rate %d, expecting %d", *pRate, rate);
+        ALOGE("wrong sample rate %d, expecting %d", *pRate, rate);
         *pRate = rate;
         return status;
     }
@@ -1536,12 +1536,12 @@
 
     if (*pChannels != AudioSystem::CHANNEL_IN_MONO &&
         *pChannels != AudioSystem::CHANNEL_IN_STEREO) {
-        LOGE("wrong number of channels %d", *pChannels);
+        ALOGE("wrong number of channels %d", *pChannels);
         *pChannels = AUDIO_HW_IN_CHANNELS;
         return status;
     }
 
-    LOGV("AudioStreamInTegra::set(%d, %d, %u)", *pFormat, *pChannels, *pRate);
+    ALOGV("AudioStreamInTegra::set(%d, %d, %u)", *pFormat, *pChannels, *pRate);
 
     mDevices = devices;
     mFormat = AUDIO_HW_IN_FORMAT;
@@ -1554,7 +1554,7 @@
 
 AudioHardware::AudioStreamInTegra::~AudioStreamInTegra()
 {
-    LOGV("AudioStreamInTegra destructor");
+    ALOGV("AudioStreamInTegra destructor");
 
     standby();
 
@@ -1563,7 +1563,7 @@
 // Called with mHardware->mLock and mLock held.
 void AudioHardware::AudioStreamInTegra::setDriver_l(bool mic, bool bluetooth, int sampleRate)
 {
-    LOGV("In setDriver_l() Analog mic? %s. Bluetooth? %s.", mic?"yes":"no", bluetooth?"yes":"no");
+    ALOGV("In setDriver_l() Analog mic? %s. Bluetooth? %s.", mic?"yes":"no", bluetooth?"yes":"no");
 
     // force some reconfiguration at next read()
     // Note: mState always == AUDIO_STREAM_CONFIGURED when setDriver_l() is called on an input
@@ -1582,11 +1582,11 @@
 {
     status_t status;
     if (!mHardware) {
-        LOGE("%s: mHardware is null", __FUNCTION__);
+        ALOGE("%s: mHardware is null", __FUNCTION__);
         return NO_INIT;
     }
     //
-    LOGV("AudioStreamInTegra::read(%p, %ld) TID %d", buffer, bytes, gettid());
+    ALOGV("AudioStreamInTegra::read(%p, %ld) TID %d", buffer, bytes, gettid());
 
     if (mSleepReq) {
         // sleep a few milliseconds so that the processor can be given to the thread attempting to
@@ -1616,7 +1616,7 @@
             status = online_l();
             mHardware->mLock.unlock();
             if (status != NO_ERROR) {
-               LOGE("%s: Problem switching to online.",__FUNCTION__);
+               ALOGE("%s: Problem switching to online.",__FUNCTION__);
                goto error;
             }
         }
@@ -1626,11 +1626,11 @@
 #ifdef USE_PROPRIETARY_AUDIO_EXTENSIONS
         if (srcReqd) {
             hwReadBytes = ( bytes*mDriverRate/mSampleRate ) & (~0x7);
-            LOGV("Running capture SRC.  HW=%d bytes at %d, Flinger=%d bytes at %d",
+            ALOGV("Running capture SRC.  HW=%d bytes at %d, Flinger=%d bytes at %d",
                   hwReadBytes, mDriverRate, (int)bytes, mSampleRate);
             inbuf = mInScratch;
             if ((size_t)bytes > sizeof(mInScratch)) {
-                LOGE("read: buf size problem. %d>%d",(int)bytes,sizeof(mInScratch));
+                ALOGE("read: buf size problem. %d>%d",(int)bytes,sizeof(mInScratch));
                 status = BAD_VALUE;
                 goto error;
             }
@@ -1638,7 +1638,7 @@
             if (!mSrc.initted() ||
                  mSrc.inRate() != mDriverRate ||
                  mSrc.outRate() != (int)mSampleRate) {
-                LOGD ("%s: Upconvert started from %d to %d", __FUNCTION__,
+                ALOGD ("%s: Upconvert started from %d to %d", __FUNCTION__,
                        mDriverRate, mSampleRate);
                 mSrc.init(mDriverRate, mSampleRate);
                 if (!mSrc.initted()) {
@@ -1666,12 +1666,12 @@
             mSrc.srcConvert();
             ret = mSrc.mIoData.output_count*sizeof(SRC16);
             if (ret > bytes) {
-                LOGE("read: buffer overrun");
+                ALOGE("read: buffer overrun");
             }
         }
 #else
         if (srcReqd) {
-            LOGE("%s: sample rate mismatch HAL %d, driver %d",
+            ALOGE("%s: sample rate mismatch HAL %d, driver %d",
                  __FUNCTION__, mSampleRate, mDriverRate);
             status = INVALID_OPERATION;
             goto error;
@@ -1688,11 +1688,11 @@
         bool muted;
         mHardware->getMicMute(&muted);
         if (muted) {
-            LOGV("%s muted",__FUNCTION__);
+            ALOGV("%s muted",__FUNCTION__);
             memset(buffer, 0, bytes);
         }
 
-        LOGV("%s returns %d.",__FUNCTION__, (int)ret);
+        ALOGV("%s returns %d.",__FUNCTION__, (int)ret);
         if (ret < 0) {
             status = ret;
             goto error;
@@ -1706,7 +1706,7 @@
     }
 
 error:
-    LOGE("read(): error, return %d", status);
+    ALOGE("read(): error, return %d", status);
     standby();
     usleep(bytes * 1000 / frameSize() / sampleRate() * 1000);
     return status;
@@ -1727,7 +1727,7 @@
     Mutex::Autolock lock2(mLock);
     status_t status = NO_ERROR;
     if (mState != AUDIO_STREAM_IDLE) {
-        LOGV("input %p going into standby", this);
+        ALOGV("input %p going into standby", this);
         mState = AUDIO_STREAM_IDLE;
         // stopping capture now so that the input stream state (AUDIO_STREAM_IDLE)
         // is consistent with the driver state when doRouting_l() is executed.
@@ -1772,7 +1772,7 @@
 
         if (mState == AUDIO_STREAM_IDLE) {
             mState = AUDIO_STREAM_CONFIG_REQ;
-            LOGV("input %p going online", this);
+            ALOGV("input %p going online", this);
             // apply pre processing requested for this input
             mHardware->setEcnsRequested_l(mEcnsRequested, true);
             // setDriver_l() will not try to lock mLock when called by doRouting_l()
@@ -1790,7 +1790,7 @@
         struct tegra_audio_in_config config;
         status = ::ioctl(mFdCtl, TEGRA_AUDIO_IN_GET_CONFIG, &config);
         if (status < 0) {
-            LOGE("cannot read input config: %s", strerror(errno));
+            ALOGE("cannot read input config: %s", strerror(errno));
             return status;
         }
         config.stereo = AudioSystem::popCount(mChannels) == 2;
@@ -1798,7 +1798,7 @@
         status = ::ioctl(mFdCtl, TEGRA_AUDIO_IN_SET_CONFIG, &config);
 
         if (status < 0) {
-            LOGE("cannot set input config: %s", strerror(errno));
+            ALOGE("cannot set input config: %s", strerror(errno));
             if (::ioctl(mFdCtl, TEGRA_AUDIO_IN_GET_CONFIG, &config) == 0) {
                 if (config.stereo) {
                     mChannels = AudioSystem::CHANNEL_IN_STEREO;
@@ -1815,7 +1815,7 @@
 
     if (::ioctl(mHardware->mCpcapCtlFd, CPCAP_AUDIO_IN_SET_RATE,
                 mDriverRate) < 0)
-        LOGE("could not set input rate(%d): %s", mDriverRate, strerror(errno));
+        ALOGE("could not set input rate(%d): %s", mDriverRate, strerror(errno));
 
     mState = AUDIO_STREAM_CONFIGURED;
 
@@ -1833,7 +1833,7 @@
 #endif
     // Need to "restart" the driver when changing the buffer configuration.
     if (mFdCtl >= 0 && ::ioctl(mFdCtl, TEGRA_AUDIO_IN_STOP) < 0) {
-        LOGE("%s: could not stop recording: %s", __FUNCTION__, strerror(errno));
+        ALOGE("%s: could not stop recording: %s", __FUNCTION__, strerror(errno));
     }
     if (mFd >= 0) {
         ::close(mFd);
@@ -1847,11 +1847,11 @@
     // This does not have a retry loop to avoid blocking if another record session already in progress
     mFd = ::open("/dev/audio1_in", O_RDWR);
     if (mFd < 0) {
-        LOGE("open /dev/audio1_in failed: %s", strerror(errno));
+        ALOGE("open /dev/audio1_in failed: %s", strerror(errno));
     }
     mFdCtl = ::open("/dev/audio1_in_ctl", O_RDWR);
     if (mFdCtl < 0) {
-        LOGE("open /dev/audio1_in_ctl failed: %s", strerror(errno));
+        ALOGE("open /dev/audio1_in_ctl failed: %s", strerror(errno));
         if (mFd >= 0) {
             ::close(mFd);
             mFd = -1;
@@ -1895,7 +1895,7 @@
     status_t status = NO_ERROR;
     int device;
     int source;
-    LOGV("AudioStreamInTegra::setParameters() %s", keyValuePairs.string());
+    ALOGV("AudioStreamInTegra::setParameters() %s", keyValuePairs.string());
 
     // read source before device so that it is upto date when doRouting() is called
     if (param.getInt(String8(AudioParameter::keyInputSource), source) == NO_ERROR) {
@@ -1904,7 +1904,7 @@
     }
 
     if (param.getInt(key, device) == NO_ERROR) {
-        LOGV("set input routing %x", device);
+        ALOGV("set input routing %x", device);
         if (device & (device - 1)) {
             status = BAD_VALUE;
         } else {
@@ -1929,11 +1929,11 @@
     String8 key = String8(AudioParameter::keyRouting);
 
     if (param.get(key, value) == NO_ERROR) {
-        LOGV("get routing %x", mDevices);
+        ALOGV("get routing %x", mDevices);
         param.addInt(key, (int)mDevices);
     }
 
-    LOGV("AudioStreamInTegra::getParameters() %s", param.toString().string());
+    ALOGV("AudioStreamInTegra::getParameters() %s", param.toString().string());
     return param.toString();
 }
 
@@ -1948,7 +1948,7 @@
         uint64_t actualFrames = (uint64_t)mTotalBuffersRead * framesPerBuffer;
         if (expectedFrames > actualFrames) {
             lostFrames = (unsigned int)(expectedFrames - actualFrames);
-            LOGW("getInputFramesLost() expected %d actual %d lost %d",
+            ALOGW("getInputFramesLost() expected %d actual %d lost %d",
                  (unsigned int)expectedFrames, (unsigned int)actualFrames, lostFrames);
         }
     }
@@ -1962,11 +1962,11 @@
 // must be called with mLock and mFdLock held
 void AudioHardware::AudioStreamInTegra::stop_l()
 {
-    LOGV("AudioStreamInTegra::stop_l() starts");
+    ALOGV("AudioStreamInTegra::stop_l() starts");
     if (::ioctl(mFdCtl, TEGRA_AUDIO_IN_STOP) < 0) {
-        LOGE("could not stop recording: %d %s", errno, strerror(errno));
+        ALOGE("could not stop recording: %d %s", errno, strerror(errno));
     }
-    LOGV("AudioStreamInTegra::stop_l() returns");
+    ALOGV("AudioStreamInTegra::stop_l() returns");
 }
 
 void AudioHardware::AudioStreamInTegra::updateEcnsRequested(effect_handle_t effect, bool enabled)
@@ -1981,7 +1981,7 @@
         } else if (memcmp(&desc.type, FX_IID_NS, sizeof(effect_uuid_t)) == 0) {
             ecns = PREPROC_NS;
         }
-        LOGV("AudioStreamInTegra::updateEcnsRequested() %s effect %s",
+        ALOGV("AudioStreamInTegra::updateEcnsRequested() %s effect %s",
              enabled ? "enabling" : "disabling", desc.name);
         if (enabled) {
             mEcnsRequested |= ecns;
@@ -2012,11 +2012,11 @@
     for (unsigned tries = 0; tries < MAX_INIT_TRIES; ++tries) {
         if (NO_ERROR == hw->init())
             break;
-        LOGW("AudioHardware::init failed soft, retrying");
+        ALOGW("AudioHardware::init failed soft, retrying");
         sleep(1);
     }
     if (NO_ERROR != hw->initCheck()) {
-        LOGE("AudioHardware::init failed hard");
+        ALOGE("AudioHardware::init failed hard");
         delete hw;
         hw = NULL;
     }
diff --git a/libaudio/AudioPostProcessor.cpp b/libaudio/AudioPostProcessor.cpp
index a94204d..e757edb 100644
--- a/libaudio/AudioPostProcessor.cpp
+++ b/libaudio/AudioPostProcessor.cpp
@@ -53,7 +53,7 @@
 AudioPostProcessor::AudioPostProcessor() :
     mEcnsScratchBuf(0), mLogNumPoints(0),  mEcnsDlBuf(0), mEcnsDlBufSize(0), mEcnsThread(0)
 {
-    LOGD("%s",__FUNCTION__);
+    ALOGD("%s",__FUNCTION__);
 
     // One-time CTO Audio configuration
     mAudioMmEnvVar.cto_audio_mm_param_block_ptr              = HC_CTO_AUDIO_MM_PARAMETER_TABLE;
@@ -73,7 +73,7 @@
 AudioPostProcessor::~AudioPostProcessor()
 {
     if (mEcnsRunning) {
-        LOGD("%s",__FUNCTION__);
+        ALOGD("%s",__FUNCTION__);
         enableEcns(0);
     }
 }
@@ -127,20 +127,20 @@
 void AudioPostProcessor::configMmAudio()
 {
     if (mAudioMmEnvVar.accy != CTO_AUDIO_MM_ACCY_INVALID) {
-        LOGD("Configure CTO Audio MM processing");
+        ALOGD("Configure CTO Audio MM processing");
         // fetch the corresponding runtime audio parameter
         api_cto_audio_mm_param_parser(&(mAudioMmEnvVar), (int16_t *)0, (int16_t *)0);
         // Initialize algorithm static memory
         api_cto_audio_mm_init(&(mAudioMmEnvVar), (int16_t *)0, (int16_t *)0);
     } else {
-        LOGD("CTO Audio MM processing is disabled.");
+        ALOGD("CTO Audio MM processing is disabled.");
     }
 }
 
 void AudioPostProcessor::enableEcns(int value)
 {
     if (mEcnsEnabled!=value) {
-        LOGD("enableEcns() new %08x old %08x)", value, mEcnsEnabled);
+        ALOGD("enableEcns() new %08x old %08x)", value, mEcnsEnabled);
         mEcnsThread->requestExitAndWait();
         stopEcns();
         cleanupEcns();
@@ -184,7 +184,7 @@
         stopEcns();
     }
 
-    LOGV("setAudioDev %d", outDev->id);
+    ALOGV("setAudioDev %d", outDev->id);
     if (mm_accy != mAudioMmEnvVar.accy) {
         mAudioMmEnvVar.accy = mm_accy;
         configMmAudio();
@@ -197,7 +197,7 @@
     uint32_t rate = convRateToCto(sampRate);
     Mutex::Autolock lock(mMmLock);
 
-    LOGD("AudioPostProcessor::setPlayAudioRate %d", sampRate);
+    ALOGD("AudioPostProcessor::setPlayAudioRate %d", sampRate);
     if (rate != mAudioMmEnvVar.sample_rate) {
         mAudioMmEnvVar.sample_rate = rate;
         configMmAudio();
@@ -223,12 +223,12 @@
 
 void AudioPostProcessor::initEcns(int rate, int bytes)
 {
-    LOGD("%s",__FUNCTION__);
+    ALOGD("%s",__FUNCTION__);
     CTO_AUDIO_USECASES_CTRL mode;
     Mutex::Autolock lock(mEcnsBufLock);
 
     if (rate != 8000 && rate != 16000) {
-        LOGW("Invalid rate for EC/NS, disabling");
+        ALOGW("Invalid rate for EC/NS, disabling");
         mEcnsEnabled = 0;
         mEcnsRunning = 0;
         return;
@@ -239,7 +239,7 @@
        // Offset to the 16K (WB) block in the coefficients file
        mode = CTO_AUDIO_USECASES_CTRL(mode + CTO_AUDIO_USECASE_WB_HANDSET);
     }
-    LOGD("%s for mode %d at %d size %d",__FUNCTION__, mode, mEcnsRate, bytes);
+    ALOGD("%s for mode %d at %d size %d",__FUNCTION__, mode, mEcnsRate, bytes);
     mEcnsCtrl.framesize = bytes/2;
     mEcnsCtrl.micFlag = 0; // 0- one mic.  1- dual mic. 2- three mic.
     mEcnsCtrl.digital_mode = (rate == 8000) ? 0 : 1;  // 8K or 16K
@@ -252,7 +252,7 @@
     FILE * fp = fopen("/system/etc/voip_aud_params.bin", "r");
     if (fp) {
         if (fread(mParamTable, sizeof(mParamTable), 1, fp) < 1) {
-            LOGE("Cannot read VOIP parameter file.  Disabling EC/NS.");
+            ALOGE("Cannot read VOIP parameter file.  Disabling EC/NS.");
             fclose(fp);
             mEcnsEnabled = 0;
             mEcnsRunning = 0;
@@ -261,7 +261,7 @@
         fclose(fp);
     }
     else {
-        LOGE("Cannot open VOIP parameter file.  Disabling EC/NS.");
+        ALOGE("Cannot open VOIP parameter file.  Disabling EC/NS.");
         mEcnsEnabled = 0;
         mEcnsRunning = 0;
         return;
@@ -281,7 +281,7 @@
 {
     AutoMutex lock(mEcnsBufLock);
     if (mEcnsRunning) {
-        LOGD("%s",__FUNCTION__);
+        ALOGD("%s",__FUNCTION__);
         mEcnsRunning = 0;
     }
 }
@@ -329,7 +329,7 @@
     if (mEcnsEnabled && !mEcnsRunning) {
         long usecs = 20*1000;
         // Give the read thread a chance to catch up.
-        LOGV("%s: delay %d msecs for ec/ns to start",__FUNCTION__, (int)(usecs/1000));
+        ALOGV("%s: delay %d msecs for ec/ns to start",__FUNCTION__, (int)(usecs/1000));
         mEcnsBufLock.unlock();
         usleep(usecs);
         mEcnsBufLock.lock();
@@ -344,10 +344,10 @@
         mEcnsOutFdLockp = fdLock;
         mEcnsOutStereo = stereo;
         if (mEcnsBufCond.waitRelative(mEcnsBufLock, seconds(1)) != NO_ERROR) {
-            LOGE("%s: Capture thread is stalled.", __FUNCTION__);
+            ALOGE("%s: Capture thread is stalled.", __FUNCTION__);
         }
         if (mEcnsOutBufSize != 0)
-            LOGD("%s: Buffer not consumed", __FUNCTION__);
+            ALOGD("%s: Buffer not consumed", __FUNCTION__);
         else
             written = bytes;  // All data consumed
     }
@@ -364,7 +364,7 @@
     ssize_t ret;
     ret = ::read(fd, buffer, bytes);
     if (ret < 0)
-        LOGE("Error reading from audio in: %s", strerror(errno));
+        ALOGE("Error reading from audio in: %s", strerror(errno));
     return (int)ret;
 }
 
@@ -382,7 +382,7 @@
     if (!mEcnsEnabled)
         return 0;
 
-    LOGV("%s %d bytes at %d Hz",__FUNCTION__, bytes, rate);
+    ALOGV("%s %d bytes at %d Hz",__FUNCTION__, bytes, rate);
     if (mEcnsEnabled && !mEcnsRunning) {
         initEcns(rate, bytes);
         onetime=true;
@@ -396,7 +396,7 @@
     }
 
     if (!mEcnsRunning) {
-        LOGE("EC/NS failed to init, read returns.");
+        ALOGE("EC/NS failed to init, read returns.");
         if (mEcnsEnabled & AEC) {
             mEcnsBufCond.signal();
         }
@@ -426,7 +426,7 @@
         if (mEcnsScratchBuf && mEcnsScratchBufSize) {
             dl_buf_bytes = mEcnsScratchBufSize > bytes ? bytes:mEcnsScratchBufSize;
             memcpy(dl_buf, mEcnsScratchBuf, dl_buf_bytes);
-            //LOGD("Took %d bytes from mEcnsScratchBuf", dl_buf_bytes);
+            //ALOGD("Took %d bytes from mEcnsScratchBuf", dl_buf_bytes);
             mEcnsScratchBufSize -= dl_buf_bytes;
             if (mEcnsScratchBufSize==0) {
                 // This should always be true.
@@ -446,22 +446,22 @@
                        bytes_to_copy);
                 dl_buf_bytes += bytes_to_copy;
             }
-            //LOGD("Took %d bytes from mEcnsOutBuf.  Need %d more.", bytes_to_copy,
+            //ALOGD("Took %d bytes from mEcnsOutBuf.  Need %d more.", bytes_to_copy,
             //      bytes-dl_buf_bytes);
             mEcnsOutBufReadOffset += bytes_to_copy;
             if (mEcnsOutBufSize - mEcnsOutBufReadOffset < bytes) {
                 // We've depleted the output buffer, it's smaller than one uplink "frame".
                 // First take any unused data into scratch, then free the write thread.
                 if (mEcnsScratchBuf) {
-                    LOGE("Memleak - coding error");
+                    ALOGE("Memleak - coding error");
                     free(mEcnsScratchBuf);
                 }
                 if (mEcnsOutBufSize - mEcnsOutBufReadOffset > 0) {
                     if ((mEcnsScratchBuf=malloc(mEcnsOutBufSize - mEcnsOutBufReadOffset)) == 0) {
-                        LOGE("%s: Alloc failed, scratch data lost.",__FUNCTION__);
+                        ALOGE("%s: Alloc failed, scratch data lost.",__FUNCTION__);
                     } else {
                         mEcnsScratchBufSize = mEcnsOutBufSize - mEcnsOutBufReadOffset;
-                        //LOGD("....store %d bytes into scratch buf %p",
+                        //ALOGD("....store %d bytes into scratch buf %p",
                         //     mEcnsScratchBufSize, mEcnsScratchBuf);
                         memcpy(mEcnsScratchBuf,
                                (void *)((unsigned int)mEcnsOutBuf+mEcnsOutBufReadOffset),
@@ -471,12 +471,12 @@
                 mEcnsOutBuf = 0;
                 mEcnsOutBufSize = 0;
                 mEcnsOutBufReadOffset = 0;
-                //LOGD("Signal write thread - need data.");
+                //ALOGD("Signal write thread - need data.");
                 mEcnsBufCond.signal();
             }
         }
 
-        LOGV_IF(dl_buf_bytes < bytes, "%s:EC/NS Starved for downlink data. have %d need %d.",
+        ALOGV_IF(dl_buf_bytes < bytes, "%s:EC/NS Starved for downlink data. have %d need %d.",
              __FUNCTION__,dl_buf_bytes, bytes);
 
         mEcnsBufLock.unlock();
@@ -538,8 +538,8 @@
         if (!mLogBuf[0]) {
             mLogNumPoints = 0;
             mLogOffset = 0;
-            LOGE("EC/NS AUDIO LOGGER CONFIGURATION:");
-            LOGE("log enable %04X",
+            ALOGE("EC/NS AUDIO LOGGER CONFIGURATION:");
+            ALOGE("log enable %04X",
                 audioProfile[ECNS_LOG_ENABLE_OFFSET]);
             mkdir(ECNSLOGPATH, 00770);
             for (uint16_t i=1; i>0; i<<=1) {
@@ -547,14 +547,14 @@
                    mLogNumPoints++;
                 }
             }
-            LOGE("Number of log points is %d.", mLogNumPoints);
+            ALOGE("Number of log points is %d.", mLogNumPoints);
             logp = mMotDatalog;
             mLogSize = 10*60*50*bytes;
             for (int i=0; i<mLogNumPoints; i++) {
                 // Allocate 10 minutes of logging per point
                 mLogBuf[i]=(char *)malloc(mLogSize);
                 if (!mLogBuf[i]) {
-                    LOGE("%s: Memory allocation failed.", __FUNCTION__);
+                    ALOGE("%s: Memory allocation failed.", __FUNCTION__);
                     for (int j=0; j<i; j++) {
                         free(mLogBuf[j]);
                         mLogBuf[j]=0;
@@ -572,7 +572,7 @@
                 memcpy(&mLogBuf[i][mLogOffset], &logp[4], logp[2]*sizeof(uint16_t));
                 logp += 4+logp[2];
             } else {
-                LOGE("EC/NS logging enabled, but memory not allocated");
+                ALOGE("EC/NS logging enabled, but memory not allocated");
             }
         }
         mLogOffset += bytes;
@@ -588,11 +588,11 @@
             sprintf(fname, ECNSLOGPATH"/log-0x%04X.pcm", mLogPoint[i]);
             fp = fopen((const char *)fname, "w");
             if (fp) {
-                LOGE("Writing %d bytes to %s", mLogOffset, fname);
+                ALOGE("Writing %d bytes to %s", mLogOffset, fname);
                 fwrite(mLogBuf[i], mLogOffset, 1, fp);
                 fclose(fp);
             } else {
-                LOGE("Problem writing to %s", fname);
+                ALOGE("Problem writing to %s", fname);
             }
         }
     }
@@ -617,22 +617,22 @@
     if (fd >= 0) {
         int amt = ::read(fd, buffer, SIZE-1);
         if (amt != SIZE-1) {
-	    LOGE("Incomplete dock property read, cannot validate dock");
+	    ALOGE("Incomplete dock property read, cannot validate dock");
 	    return -1;
         }
         spkr_dock_prop = strtoul(buffer, NULL, 16);
 	if (spkr_dock_prop <= 0) {
-	    LOGE("dock property conversion error");
+	    ALOGE("dock property conversion error");
 	    return -EINVAL;
         }
         close(fd);
-        LOGV("buffer = %s, spkr_dock_prop = 0x%lX", buffer, spkr_dock_prop);
+        ALOGV("buffer = %s, spkr_dock_prop = 0x%lX", buffer, spkr_dock_prop);
         spkr_dock_prop = spkr_dock_prop ^ basic_dock_prop;
-        LOGV("dock_prop returned = %lX", spkr_dock_prop);
+        ALOGV("dock_prop returned = %lX", spkr_dock_prop);
         return spkr_dock_prop;
     } else {
         if (already_warned == -1) {
-            LOGE("read_dock_prop failed to open %s\n", path);
+            ALOGE("read_dock_prop failed to open %s\n", path);
             already_warned = 1;
         }
         return -errno;
@@ -654,7 +654,7 @@
 int AudioPostProcessor::EcnsThread::readData(int fd, void * buffer, int bytes, int rate,
                                              AudioPostProcessor * pp)
 {
-    LOGV("%s: read %d bytes at %d rate", __FUNCTION__, bytes, rate);
+    ALOGV("%s: read %d bytes at %d rate", __FUNCTION__, bytes, rate);
     Mutex::Autolock lock(mEcnsReadLock);
     mProcessor = pp;
     mFd = fd;
@@ -662,12 +662,12 @@
     mReadSize = bytes;
     mRate = rate;
     if (!mIsRunning) {
-        LOGD("Create (run) the ECNS thread");
+        ALOGD("Create (run) the ECNS thread");
         run("AudioPostProcessor::EcnsThread", ANDROID_PRIORITY_HIGHEST);
         mIsRunning = true;
     }
     if (mEcnsReadCond.waitRelative(mEcnsReadLock, seconds(1)) != NO_ERROR) {
-        LOGE("%s: ECNS thread is stalled.", __FUNCTION__);
+        ALOGE("%s: ECNS thread is stalled.", __FUNCTION__);
         mClientBuf = 0;
         return -1;
     }
@@ -688,7 +688,7 @@
     bool half_done = false;
     int ecnsStatus = 0;
 
-    LOGD("%s: Enter thread loop size %d rate %d", __FUNCTION__,
+    ALOGD("%s: Enter thread loop size %d rate %d", __FUNCTION__,
                                           mReadSize, mRate);
 
     mReadBuf = (int16_t *) malloc(mReadSize);
@@ -706,7 +706,7 @@
         if(exitPending())
             goto error;
         if (ret1 <= 0 || ret2 <= 0) {
-            LOGE("%s: Problem reading.", __FUNCTION__);
+            ALOGE("%s: Problem reading.", __FUNCTION__);
             goto error;
         }
         GETTIMEOFDAY(&mtv3, NULL);
@@ -723,7 +723,7 @@
             mClientBuf = 0;
         } else {
             half_done = false;
-            LOGV("%s: Read overflow (ECNS sanity preserved)", __FUNCTION__);
+            ALOGV("%s: Read overflow (ECNS sanity preserved)", __FUNCTION__);
         }
         mEcnsReadLock.unlock();
         GETTIMEOFDAY(&mtv8, NULL);
@@ -748,31 +748,31 @@
                 large_jitter++;
             else
                 medium_jitter++;
-            LOGD("jitter: usecs = %d should be 20000", usecs);
-            LOGD("Point 1 (      start): %03d.%06d:", (int)mtv1.tv_sec, (int)mtv1.tv_usec);
-            LOGD("Point 2 (after read1): %03d.%06d:", (int)mtv2.tv_sec, (int)mtv2.tv_usec);
-            LOGD("Point 3 (after read2): %03d.%06d:", (int)mtv3.tv_sec, (int)mtv3.tv_usec);
-            LOGD("Point 4 (before ECNS): %03d.%06d:", (int)mtv4.tv_sec, (int)mtv4.tv_usec);
-            LOGD("Point 5 (after  ECNS): %03d.%06d:", (int)mtv5.tv_sec, (int)mtv5.tv_usec);
-            LOGD("Point 6 (after write): %03d.%06d:", (int)mtv6.tv_sec, (int)mtv6.tv_usec);
-            LOGD("Point 7 (before sgnl): %03d.%06d:", (int)mtv7.tv_sec, (int)mtv7.tv_usec);
-            LOGD("Point 8 (after unlck): %03d.%06d:", (int)mtv8.tv_sec, (int)mtv8.tv_usec);
+            ALOGD("jitter: usecs = %d should be 20000", usecs);
+            ALOGD("Point 1 (      start): %03d.%06d:", (int)mtv1.tv_sec, (int)mtv1.tv_usec);
+            ALOGD("Point 2 (after read1): %03d.%06d:", (int)mtv2.tv_sec, (int)mtv2.tv_usec);
+            ALOGD("Point 3 (after read2): %03d.%06d:", (int)mtv3.tv_sec, (int)mtv3.tv_usec);
+            ALOGD("Point 4 (before ECNS): %03d.%06d:", (int)mtv4.tv_sec, (int)mtv4.tv_usec);
+            ALOGD("Point 5 (after  ECNS): %03d.%06d:", (int)mtv5.tv_sec, (int)mtv5.tv_usec);
+            ALOGD("Point 6 (after write): %03d.%06d:", (int)mtv6.tv_sec, (int)mtv6.tv_usec);
+            ALOGD("Point 7 (before sgnl): %03d.%06d:", (int)mtv7.tv_sec, (int)mtv7.tv_usec);
+            ALOGD("Point 8 (after unlck): %03d.%06d:", (int)mtv8.tv_sec, (int)mtv8.tv_usec);
         } else if ((usecs > 22000) || (usecs < 18000)) {
             small_jitter++;
-            LOGD("jitter: usecs = %d should be 20000", usecs);
+            ALOGD("jitter: usecs = %d should be 20000", usecs);
         }
         if ((count % 500)== 0) {
-            LOGD("====================================== Statistics ===========================");
-            LOGD(" After %d seconds:", count/50);
-            LOGD(" Small jitters-  %d (%02.5f%%)", small_jitter, ((float)small_jitter)*100/count);
-            LOGD(" Medium jitters- %d (%02.5f%%)", medium_jitter, ((float)medium_jitter)*100/count);
-            LOGD(" Large jitters-  %d (%02.5f%%)", large_jitter, ((float)large_jitter)*100/count);
-            LOGD("=============================================================================");
+            ALOGD("====================================== Statistics ===========================");
+            ALOGD(" After %d seconds:", count/50);
+            ALOGD(" Small jitters-  %d (%02.5f%%)", small_jitter, ((float)small_jitter)*100/count);
+            ALOGD(" Medium jitters- %d (%02.5f%%)", medium_jitter, ((float)medium_jitter)*100/count);
+            ALOGD(" Large jitters-  %d (%02.5f%%)", large_jitter, ((float)large_jitter)*100/count);
+            ALOGD("=============================================================================");
         }
 #endif
     }
 error:
-    LOGD("%s: Exit thread loop, enabled = %d", __FUNCTION__,mProcessor->isEcnsEnabled());
+    ALOGD("%s: Exit thread loop, enabled = %d", __FUNCTION__,mProcessor->isEcnsEnabled());
     if (mReadBuf) {
         free (mReadBuf);
         mReadBuf = 0;
diff --git a/media_codecs.xml b/media_codecs.xml
new file mode 100644
index 0000000..3c6968c
--- /dev/null
+++ b/media_codecs.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright (C) 2012 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+<!DOCTYPE MediaCodecs [
+<!ELEMENT MediaCodecs (Decoders,Encoders)>
+<!ELEMENT Decoders (MediaCodec*)>
+<!ELEMENT Encoders (MediaCodec*)>
+<!ELEMENT MediaCodec (Type*,Quirk*)>
+<!ATTLIST MediaCodec name CDATA #REQUIRED>
+<!ATTLIST MediaCodec type CDATA>
+<!ELEMENT Type EMPTY>
+<!ATTLIST Type name CDATA #REQUIRED>
+<!ELEMENT Quirk EMPTY>
+<!ATTLIST Quirk name CDATA #REQUIRED>
+]>
+
+There's a simple and a complex syntax to declare the availability of a
+media codec:
+
+A codec that properly follows the OpenMax spec and therefore doesn't have any
+quirks and that only supports a single content type can be declared like so:
+
+    <MediaCodec name="OMX.foo.bar" type="something/interesting" />
+
+If a codec has quirks OR supports multiple content types, the following syntax
+can be used:
+
+    <MediaCodec name="OMX.foo.bar" >
+        <Type name="something/interesting" />
+        <Type name="something/else" />
+        ...
+        <Quirk name="requires-allocate-on-input-ports" />
+        <Quirk name="requires-allocate-on-output-ports" />
+        <Quirk name="output-buffers-are-unreadable" />
+    </MediaCodec>
+
+Only the three quirks included above are recognized at this point:
+
+"requires-allocate-on-input-ports"
+    must be advertised if the component does not properly support specification
+    of input buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"requires-allocate-on-output-ports"
+    must be advertised if the component does not properly support specification
+    of output buffers using the OMX_UseBuffer(...) API but instead requires
+    OMX_AllocateBuffer to be used.
+
+"output-buffers-are-unreadable"
+    must be advertised if the emitted output buffers of a decoder component
+    are not readable, i.e. use a custom format even though abusing one of
+    the official OMX colorspace constants.
+    Clients of such decoders will not be able to access the decoded data,
+    naturally making the component much less useful. The only use for
+    a component with this quirk is to render the output to the screen.
+    Audio decoders MUST NOT advertise this quirk.
+    Video decoders that advertise this quirk must be accompanied by a
+    corresponding color space converter for thumbnail extraction,
+    matching surfaceflinger support that can render the custom format to
+    a texture and possibly other code, so just DON'T USE THIS QUIRK.
+
+-->
+
+<MediaCodecs>
+    <Decoders>
+        <MediaCodec name="OMX.Nvidia.mp4.decode" type="video/mp4v-es" />
+        <MediaCodec name="OMX.Nvidia.h263.decode" type="video/3gpp" />
+        <MediaCodec name="OMX.Nvidia.h264.decode" type="video/avc" />
+        <MediaCodec name="OMX.Nvidia.mpeg2v.decode" type="video/mpeg2" />
+        <MediaCodec name="OMX.Nvidia.mp2.decoder" type="audio/mpeg-L2" />
+
+        <MediaCodec name="OMX.google.mp3.decoder" type="audio/mpeg" />
+        <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
+        <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
+        <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
+        <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
+        <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
+        <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
+
+        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
+        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
+        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
+        <MediaCodec name="OMX.google.vpx.decoder" type="video/x-vnd.on2.vp8" />
+    </Decoders>
+
+    <Encoders>
+        <MediaCodec name="OMX.Nvidia.mp4.encoder" type="video/mp4v-es" />
+        <MediaCodec name="OMX.Nvidia.h263.encoder" type="video/3gpp" />
+        <MediaCodec name="OMX.Nvidia.h264.encoder" type="video/avc" />
+
+        <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
+        <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
+        <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
+    </Encoders>
+</MediaCodecs>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 2a0706e..a42b3a2 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -209,25 +209,11 @@
     <!-- Enable puk unlockscreen -->
     <bool name="config_enable_puk_unlock_screen">true</bool>
 
-    <!-- Number of database connections opened and managed by framework layer
-         to handle queries on each database. -->
-    <integer name="db_connection_pool_size">3</integer>
-
     <!-- Max space (in MB) allocated to DownloadManager to store the downloaded files
          if they are to be stored in DownloadManager's data dir,
          which typically is /data/data/com.android.providers.downloads/files. -->
     <integer name="config_downloadDataDirSize">200</integer>
 
-    <!-- When the free space available in DownloadManager's data dir falls
-         below the percentage value specified by this param, DownloadManager
-         starts removing files to try to make percentage of available
-         free space above this threshold value. --> 
-    <integer name="config_downloadDataDirLowSpaceThreshold">10</integer>
-
-    <!-- When a database query is executed, the results retuned are paginated
-         in pages of size (in KB) indicated by this value -->
-    <integer name="config_cursorWindowSize">2048</integer>
-
     <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
     <bool name="config_intrusiveNotificationLed">true</bool>