diff --git a/adb/usb_vendors.c b/adb/usb_vendors.c
index f67e883..a8b0ca2 100644
--- a/adb/usb_vendors.c
+++ b/adb/usb_vendors.c
@@ -115,7 +115,8 @@
 #define VENDOR_ID_FUJITSU       0x04C5
 // Lumigon's USB Vendor ID
 #define VENDOR_ID_LUMIGON       0x25E3
-
+//Intel's USB Vendor ID
+#define VENDOR_ID_INTEL         0x8087
 
 /** built-in vendor list */
 int builtInVendorIds[] = {
@@ -159,6 +160,7 @@
     VENDOR_ID_POSITIVO,
     VENDOR_ID_FUJITSU,
     VENDOR_ID_LUMIGON,
+    VENDOR_ID_INTEL,
 };
 
 #define BUILT_IN_VENDOR_COUNT    (sizeof(builtInVendorIds)/sizeof(builtInVendorIds[0]))
diff --git a/include/cutils/log.h b/include/cutils/log.h
index 42d7382..2997a0c 100644
--- a/include/cutils/log.h
+++ b/include/cutils/log.h
@@ -47,7 +47,7 @@
 // ---------------------------------------------------------------------
 
 /*
- * Normally we strip LOGV (VERBOSE messages) from release builds.
+ * Normally we strip ALOGV (VERBOSE messages) from release builds.
  * You can modify this (for example with "#define LOG_NDEBUG 0"
  * at the top of your source file) to change that behavior.
  */
@@ -73,81 +73,121 @@
 /*
  * Simplified macro to send a verbose log message using the current LOG_TAG.
  */
-#ifndef LOGV
+#ifndef ALOGV
 #if LOG_NDEBUG
-#define LOGV(...)   ((void)0)
+#define ALOGV(...)   ((void)0)
 #else
-#define LOGV(...) ((void)LOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#endif
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGV
+#define LOGV ALOGV
 #endif
 #endif
 
 #define CONDITION(cond)     (__builtin_expect((cond)!=0, 0))
 
-#ifndef LOGV_IF
+#ifndef ALOGV_IF
 #if LOG_NDEBUG
-#define LOGV_IF(cond, ...)   ((void)0)
+#define ALOGV_IF(cond, ...)   ((void)0)
 #else
-#define LOGV_IF(cond, ...) \
+#define ALOGV_IF(cond, ...) \
     ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
+    ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
 #endif
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGV_IF
+#define LOGV_IF ALOGV_IF
+#endif
 #endif
 
 /*
  * Simplified macro to send a debug log message using the current LOG_TAG.
  */
+#ifndef ALOGD
+#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+// Temporary measure for code still using old LOG macros.
 #ifndef LOGD
-#define LOGD(...) ((void)LOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#define LOGD ALOGD
+#endif
 #endif
 
-#ifndef LOGD_IF
-#define LOGD_IF(cond, ...) \
+#ifndef ALOGD_IF
+#define ALOGD_IF(cond, ...) \
     ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
+    ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGD_IF
+#define LOGD_IF ALOGD_IF
+#endif
 #endif
 
 /*
  * Simplified macro to send an info log message using the current LOG_TAG.
  */
+#ifndef ALOGI
+#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
+// Temporary measure for code still using old LOG macros.
 #ifndef LOGI
-#define LOGI(...) ((void)LOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
+#define LOGI ALOGI
+#endif
 #endif
 
-#ifndef LOGI_IF
-#define LOGI_IF(cond, ...) \
+#ifndef ALOGI_IF
+#define ALOGI_IF(cond, ...) \
     ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
+    ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGI_IF
+#define LOGI_IF ALOGI_IF
+#endif
 #endif
 
 /*
  * Simplified macro to send a warning log message using the current LOG_TAG.
  */
+#ifndef ALOGW
+#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
+// Temporary measure for code still using old LOG macros.
 #ifndef LOGW
-#define LOGW(...) ((void)LOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
+#define LOGW ALOGW
+#endif
 #endif
 
-#ifndef LOGW_IF
-#define LOGW_IF(cond, ...) \
+#ifndef ALOGW_IF
+#define ALOGW_IF(cond, ...) \
     ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
+    ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGW_IF
+#define LOGW_IF ALOGW_IF
+#endif
 #endif
 
 /*
  * Simplified macro to send an error log message using the current LOG_TAG.
  */
+#ifndef ALOGE
+#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+// Temporary measure for code still using old LOG macros.
 #ifndef LOGE
-#define LOGE(...) ((void)LOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#define LOGE ALOGE
+#endif
 #endif
 
-#ifndef LOGE_IF
-#define LOGE_IF(cond, ...) \
+#ifndef ALOGE_IF
+#define ALOGE_IF(cond, ...) \
     ( (CONDITION(cond)) \
-    ? ((void)LOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
+    ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
     : (void)0 )
+// Temporary measure for code still using old LOG macros.
+#ifndef LOGE_IF
+#define LOGE_IF ALOGE_IF
+#endif
 #endif
 
 // ---------------------------------------------------------------------
@@ -156,11 +196,15 @@
  * Conditional based on whether the current LOG_TAG is enabled at
  * verbose priority.
  */
-#ifndef IF_LOGV
+#ifndef IF_ALOGV
 #if LOG_NDEBUG
-#define IF_LOGV() if (false)
+#define IF_ALOGV() if (false)
 #else
-#define IF_LOGV() IF_LOG(LOG_VERBOSE, LOG_TAG)
+#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
+#endif
+// Temporary measure for code still using old LOG macros.
+#ifndef IF_LOGV
+#define IF_LOGV IF_ALOGV
 #endif
 #endif
 
@@ -168,32 +212,48 @@
  * Conditional based on whether the current LOG_TAG is enabled at
  * debug priority.
  */
+#ifndef IF_ALOGD
+#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
+// Temporary measure for code still using old LOG macros.
 #ifndef IF_LOGD
-#define IF_LOGD() IF_LOG(LOG_DEBUG, LOG_TAG)
+#define IF_LOGD IF_ALOGD
+#endif
 #endif
 
 /*
  * Conditional based on whether the current LOG_TAG is enabled at
  * info priority.
  */
+#ifndef IF_ALOGI
+#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG)
+// Temporary measure for code still using old LOG macros.
 #ifndef IF_LOGI
-#define IF_LOGI() IF_LOG(LOG_INFO, LOG_TAG)
+#define IF_LOGI IF_ALOGI
+#endif
 #endif
 
 /*
  * Conditional based on whether the current LOG_TAG is enabled at
  * warn priority.
  */
+#ifndef IF_ALOGW
+#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG)
+// Temporary measure for code still using old LOG macros.
 #ifndef IF_LOGW
-#define IF_LOGW() IF_LOG(LOG_WARN, LOG_TAG)
+#define IF_LOGW IF_ALOGW
+#endif
 #endif
 
 /*
  * Conditional based on whether the current LOG_TAG is enabled at
  * error priority.
  */
+#ifndef IF_ALOGE
+#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
+// Temporary measure for code still using old LOG macros.
 #ifndef IF_LOGE
-#define IF_LOGE() IF_LOG(LOG_ERROR, LOG_TAG)
+#define IF_LOGE IF_ALOGE
+#endif
 #endif
 
 
@@ -329,9 +389,13 @@
  * Assertion that generates a log message when the assertion fails.
  * Stripped out of release builds.  Uses the current LOG_TAG.
  */
+#ifndef ALOG_ASSERT
+#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)
+//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond)
+// Temporary measure for code still using old LOG macros.
 #ifndef LOG_ASSERT
-#define LOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)
-//#define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond)
+#define LOG_ASSERT ALOG_ASSERT
+#endif
 #endif
 
 // ---------------------------------------------------------------------
@@ -340,13 +404,17 @@
  * Basic log message macro.
  *
  * Example:
- *  LOG(LOG_WARN, NULL, "Failed with error %d", errno);
+ *  ALOG(LOG_WARN, NULL, "Failed with error %d", errno);
  *
  * The second argument may be NULL or "" to indicate the "global" tag.
  */
-#ifndef LOG
-#define LOG(priority, tag, ...) \
+#ifndef ALOG
+#define ALOG(priority, tag, ...) \
     LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
+// Temporary measure for code still using old LOG macros.
+#ifndef LOG
+#define LOG ALOG
+#endif
 #endif
 
 /*
@@ -368,9 +436,13 @@
 /*
  * Conditional given a desired logging priority and tag.
  */
-#ifndef IF_LOG
-#define IF_LOG(priority, tag) \
+#ifndef IF_ALOG
+#define IF_ALOG(priority, tag) \
     if (android_testLog(ANDROID_##priority, tag))
+// Temporary measure for code still using old LOG macros.
+#ifndef IF_LOG
+#define IF_LOG IF_ALOG
+#endif
 #endif
 
 // ---------------------------------------------------------------------
@@ -424,7 +496,7 @@
     __android_log_vprint(prio, tag, fmt)
 
 /* XXX Macros to work around syntax errors in places where format string
- * arg is not passed to LOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF
+ * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF
  * (happens only in debug builds).
  */
 
diff --git a/init/builtins.c b/init/builtins.c
index eccda3f..3781dcd 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -31,6 +31,7 @@
 #include <sys/resource.h>
 #include <linux/loop.h>
 #include <cutils/partition_utils.h>
+#include <sys/system_properties.h>
 
 #include "init.h"
 #include "keywords.h"
@@ -448,22 +449,15 @@
 {
     const char *name = args[1];
     const char *value = args[2];
+    char prop_val[PROP_VALUE_MAX];
+    int ret;
 
-    if (value[0] == '$') {
-        /* Use the value of a system property if value starts with '$' */
-        value++;
-        if (value[0] != '$') {
-            value = property_get(value);
-            if (!value) {
-                ERROR("property %s has no value for assigning to %s\n", value, name);
-                return -EINVAL;
-            }
-        } /* else fall through to support double '$' prefix for setting properties
-           * to string literals that start with '$'
-           */
+    ret = expand_props(prop_val, value, sizeof(prop_val));
+    if (ret) {
+        ERROR("cannot expand '%s' while assigning to '%s'\n", value, name);
+        return -EINVAL;
     }
-
-    property_set(name, value);
+    property_set(name, prop_val);
     return 0;
 }
 
@@ -547,21 +541,15 @@
 {
     const char *path = args[1];
     const char *value = args[2];
-    if (value[0] == '$') {
-        /* Write the value of a system property if value starts with '$' */
-        value++;
-        if (value[0] != '$') {
-            value = property_get(value);
-            if (!value) {
-                ERROR("property %s has no value for writing to %s\n", value, path);
-                return -EINVAL;
-            }
-        } /* else fall through to support double '$' prefix for writing
-           * string literals that start with '$'
-           */
-    }
+    char prop_val[PROP_VALUE_MAX];
+    int ret;
 
-    return write_file(path, value);
+    ret = expand_props(prop_val, value, sizeof(prop_val));
+    if (ret) {
+        ERROR("cannot expand '%s' while writing to '%s'\n", value, path);
+        return -EINVAL;
+    }
+    return write_file(path, prop_val);
 }
 
 int do_copy(int nargs, char **args)
diff --git a/init/init.c b/init/init.c
index 165fea0..c3be93d 100755
--- a/init/init.c
+++ b/init/init.c
@@ -59,13 +59,8 @@
 #endif
 
 static char console[32];
-static char serialno[32];
 static char bootmode[32];
-static char baseband[32];
-static char carrier[32];
-static char bootloader[32];
 static char hardware[32];
-static char modelno[32];
 static unsigned revision = 0;
 static char qemu[32];
 
@@ -421,47 +416,6 @@
     }
 }
 
-static void import_kernel_nv(char *name, int in_qemu)
-{
-    char *value = strchr(name, '=');
-
-    if (value == 0) return;
-    *value++ = 0;
-    if (*name == 0) return;
-
-    if (!in_qemu)
-    {
-        /* on a real device, white-list the kernel options */
-        if (!strcmp(name,"qemu")) {
-            strlcpy(qemu, value, sizeof(qemu));
-        } else if (!strcmp(name,"androidboot.console")) {
-            strlcpy(console, value, sizeof(console));
-        } else if (!strcmp(name,"androidboot.mode")) {
-            strlcpy(bootmode, value, sizeof(bootmode));
-        } else if (!strcmp(name,"androidboot.serialno")) {
-            strlcpy(serialno, value, sizeof(serialno));
-        } else if (!strcmp(name,"androidboot.baseband")) {
-            strlcpy(baseband, value, sizeof(baseband));
-        } else if (!strcmp(name,"androidboot.carrier")) {
-            strlcpy(carrier, value, sizeof(carrier));
-        } else if (!strcmp(name,"androidboot.bootloader")) {
-            strlcpy(bootloader, value, sizeof(bootloader));
-        } else if (!strcmp(name,"androidboot.hardware")) {
-            strlcpy(hardware, value, sizeof(hardware));
-        } else if (!strcmp(name,"androidboot.modelno")) {
-            strlcpy(modelno, value, sizeof(modelno));
-        }
-    } else {
-        /* in the emulator, export any kernel option with the
-         * ro.kernel. prefix */
-        char  buff[32];
-        int   len = snprintf( buff, sizeof(buff), "ro.kernel.%s", name );
-        if (len < (int)sizeof(buff)) {
-            property_set( buff, value );
-        }
-    }
-}
-
 static struct command *get_first_command(struct action *act)
 {
     struct listnode *node;
@@ -521,17 +475,6 @@
     return ret;
 }
 
-static int property_init_action(int nargs, char **args)
-{
-    bool load_defaults = true;
-
-    INFO("property init\n");
-    if (!strcmp(bootmode, "charger"))
-        load_defaults = false;
-    property_init(load_defaults);
-    return 0;
-}
-
 static int keychord_init_action(int nargs, char **args)
 {
     keychord_init();
@@ -579,33 +522,104 @@
     return 0;
 }
 
-static int set_init_properties_action(int nargs, char **args)
+static void import_kernel_nv(char *name, int for_emulator)
+{
+    char *value = strchr(name, '=');
+    int name_len = strlen(name);
+
+    if (value == 0) return;
+    *value++ = 0;
+    if (name_len == 0) return;
+
+    if (for_emulator) {
+        /* in the emulator, export any kernel option with the
+         * ro.kernel. prefix */
+        char buff[PROP_NAME_MAX];
+        int len = snprintf( buff, sizeof(buff), "ro.kernel.%s", name );
+
+        if (len < (int)sizeof(buff))
+            property_set( buff, value );
+        return;
+    }
+
+    if (!strcmp(name,"qemu")) {
+        strlcpy(qemu, value, sizeof(qemu));
+    } else if (!strncmp(name, "androidboot.", 12) && name_len > 12) {
+        const char *boot_prop_name = name + 12;
+        char prop[PROP_NAME_MAX];
+        int cnt;
+
+        cnt = snprintf(prop, sizeof(prop), "ro.boot.%s", boot_prop_name);
+        if (cnt < PROP_NAME_MAX)
+            property_set(prop, value);
+    }
+}
+
+static void export_kernel_boot_props(void)
 {
     char tmp[PROP_VALUE_MAX];
+    const char *pval;
+    unsigned i;
+    struct {
+        const char *src_prop;
+        const char *dest_prop;
+        const char *def_val;
+    } prop_map[] = {
+        { "ro.boot.serialno", "ro.serialno", "", },
+        { "ro.boot.mode", "ro.bootmode", "unknown", },
+        { "ro.boot.baseband", "ro.baseband", "unknown", },
+        { "ro.boot.carrier", "ro.carrier", "unknown", },
+        { "ro.boot.bootloader", "ro.bootloader", "unknown", },
+    };
 
-    if (qemu[0])
-        import_kernel_cmdline(1, import_kernel_nv);
+    for (i = 0; i < ARRAY_SIZE(prop_map); i++) {
+        pval = property_get(prop_map[i].src_prop);
+        property_set(prop_map[i].dest_prop, pval ?: prop_map[i].def_val);
+    }
 
+    pval = property_get("ro.boot.console");
+    if (pval)
+        strlcpy(console, pval, sizeof(console));
+
+    /* save a copy for init's usage during boot */
+    strlcpy(bootmode, property_get("ro.bootmode"), sizeof(bootmode));
+
+    /* if this was given on kernel command line, override what we read
+     * before (e.g. from /proc/cpuinfo), if anything */
+    pval = property_get("ro.boot.hardware");
+    if (pval)
+        strlcpy(hardware, pval, sizeof(hardware));
+    property_set("ro.hardware", hardware);
+
+    snprintf(tmp, PROP_VALUE_MAX, "%d", revision);
+    property_set("ro.revision", tmp);
+
+    /* TODO: these are obsolete. We should delete them */
     if (!strcmp(bootmode,"factory"))
         property_set("ro.factorytest", "1");
     else if (!strcmp(bootmode,"factory2"))
         property_set("ro.factorytest", "2");
     else
         property_set("ro.factorytest", "0");
+}
 
-    property_set("ro.serialno", serialno[0] ? serialno : "");
-    property_set("ro.bootmode", bootmode[0] ? bootmode : "unknown");
-    property_set("ro.baseband", baseband[0] ? baseband : "unknown");
-    property_set("ro.carrier", carrier[0] ? carrier : "unknown");
-    property_set("ro.bootloader", bootloader[0] ? bootloader : "unknown");
+static void process_kernel_cmdline(void)
+{
+    /* don't expose the raw commandline to nonpriv processes */
+    chmod("/proc/cmdline", 0440);
 
-    if (modelno[0])
-        property_set("ro.boot.modelno", modelno);
+    /* first pass does the common stuff, and finds if we are in qemu.
+     * second pass is only necessary for qemu to export all kernel params
+     * as props.
+     */
+    import_kernel_cmdline(0, import_kernel_nv);
+    if (qemu[0])
+        import_kernel_cmdline(1, import_kernel_nv);
 
-    property_set("ro.hardware", hardware);
-    snprintf(tmp, PROP_VALUE_MAX, "%d", revision);
-    property_set("ro.revision", tmp);
-    return 0;
+    /* now propogate the info given on command line to internal variables
+     * used by init as well as the current required properties
+     */
+    export_kernel_boot_props();
 }
 
 static int property_service_init_action(int nargs, char **args)
@@ -674,6 +688,7 @@
     int property_set_fd_init = 0;
     int signal_fd_init = 0;
     int keychord_fd_init = 0;
+    bool is_charger = false;
 
     if (!strcmp(basename(argv[0]), "ueventd"))
         return ueventd_main(argc, argv);
@@ -707,31 +722,32 @@
          */
     open_devnull_stdio();
     klog_init();
+    property_init();
+
+    get_hardware_name(hardware, &revision);
+
+    process_kernel_cmdline();
+
+    is_charger = !strcmp(bootmode, "charger");
+
+    INFO("property init\n");
+    if (!is_charger)
+        property_load_boot_defaults();
 
     INFO("reading config file\n");
     init_parse_config_file("/init.rc");
 
-    /* pull the kernel commandline and ramdisk properties file in */
-    import_kernel_cmdline(0, import_kernel_nv);
-    /* don't expose the raw commandline to nonpriv processes */
-    chmod("/proc/cmdline", 0440);
-    get_hardware_name(hardware, &revision);
-    snprintf(tmp, sizeof(tmp), "/init.%s.rc", hardware);
-    init_parse_config_file(tmp);
-
     action_for_each_trigger("early-init", action_add_queue_tail);
 
     queue_builtin_action(wait_for_coldboot_done_action, "wait_for_coldboot_done");
-    queue_builtin_action(property_init_action, "property_init");
     queue_builtin_action(keychord_init_action, "keychord_init");
     queue_builtin_action(console_init_action, "console_init");
-    queue_builtin_action(set_init_properties_action, "set_init_properties");
 
     /* execute all the boot actions to get us started */
     action_for_each_trigger("init", action_add_queue_tail);
 
     /* skip mounting filesystems in charger mode */
-    if (strcmp(bootmode, "charger") != 0) {
+    if (!is_charger) {
         action_for_each_trigger("early-fs", action_add_queue_tail);
         action_for_each_trigger("fs", action_add_queue_tail);
         action_for_each_trigger("post-fs", action_add_queue_tail);
@@ -742,7 +758,7 @@
     queue_builtin_action(signal_init_action, "signal_init");
     queue_builtin_action(check_startup_action, "check_startup");
 
-    if (!strcmp(bootmode, "charger")) {
+    if (is_charger) {
         action_for_each_trigger("charger", action_add_queue_tail);
     } else {
         action_for_each_trigger("early-boot", action_add_queue_tail);
diff --git a/init/init_parser.c b/init/init_parser.c
index 13c94eb..d255db9 100644
--- a/init/init_parser.c
+++ b/init/init_parser.c
@@ -40,6 +40,11 @@
 static list_declare(action_list);
 static list_declare(action_queue);
 
+struct import {
+    struct listnode list;
+    const char *filename;
+};
+
 static void *parse_service(struct parse_state *state, int nargs, char **args);
 static void parse_line_service(struct parse_state *state, int nargs, char **args);
 
@@ -159,6 +164,149 @@
 {
 }
 
+static int push_chars(char **dst, int *len, const char *chars, int cnt)
+{
+    if (cnt > *len)
+        return -1;
+
+    memcpy(*dst, chars, cnt);
+    *dst += cnt;
+    *len -= cnt;
+
+    return 0;
+}
+
+int expand_props(char *dst, const char *src, int dst_size)
+{
+    int cnt = 0;
+    char *dst_ptr = dst;
+    const char *src_ptr = src;
+    int src_len;
+    int idx = 0;
+    int ret = 0;
+    int left = dst_size - 1;
+
+    if (!src || !dst || dst_size == 0)
+        return -1;
+
+    src_len = strlen(src);
+
+    /* - variables can either be $x.y or ${x.y}, in case they are only part
+     *   of the string.
+     * - will accept $$ as a literal $.
+     * - no nested property expansion, i.e. ${foo.${bar}} is not supported,
+     *   bad things will happen
+     */
+    while (*src_ptr && left > 0) {
+        char *c;
+        char prop[PROP_NAME_MAX + 1];
+        const char *prop_val;
+        int prop_len = 0;
+
+        c = strchr(src_ptr, '$');
+        if (!c) {
+            while (left-- > 0 && *src_ptr)
+                *(dst_ptr++) = *(src_ptr++);
+            break;
+        }
+
+        memset(prop, 0, sizeof(prop));
+
+        ret = push_chars(&dst_ptr, &left, src_ptr, c - src_ptr);
+        if (ret < 0)
+            goto err_nospace;
+        c++;
+
+        if (*c == '$') {
+            *(dst_ptr++) = *(c++);
+            src_ptr = c;
+            left--;
+            continue;
+        } else if (*c == '\0') {
+            break;
+        }
+
+        if (*c == '{') {
+            c++;
+            while (*c && *c != '}' && prop_len < PROP_NAME_MAX)
+                prop[prop_len++] = *(c++);
+            if (*c != '}') {
+                /* failed to find closing brace, abort. */
+                if (prop_len == PROP_NAME_MAX)
+                    ERROR("prop name too long during expansion of '%s'\n",
+                          src);
+                else if (*c == '\0')
+                    ERROR("unexpected end of string in '%s', looking for }\n",
+                          src);
+                goto err;
+            }
+            prop[prop_len] = '\0';
+            c++;
+        } else if (*c) {
+            while (*c && prop_len < PROP_NAME_MAX)
+                prop[prop_len++] = *(c++);
+            if (prop_len == PROP_NAME_MAX && *c != '\0') {
+                ERROR("prop name too long in '%s'\n", src);
+                goto err;
+            }
+            prop[prop_len] = '\0';
+            ERROR("using deprecated syntax for specifying property '%s', use ${name} instead\n",
+                  prop);
+        }
+
+        if (prop_len == 0) {
+            ERROR("invalid zero-length prop name in '%s'\n", src);
+            goto err;
+        }
+
+        prop_val = property_get(prop);
+        if (!prop_val) {
+            ERROR("property '%s' doesn't exist while expanding '%s'\n",
+                  prop, src);
+            goto err;
+        }
+
+        ret = push_chars(&dst_ptr, &left, prop_val, strlen(prop_val));
+        if (ret < 0)
+            goto err_nospace;
+        src_ptr = c;
+        continue;
+    }
+
+    *dst_ptr = '\0';
+    return 0;
+
+err_nospace:
+    ERROR("destination buffer overflow while expanding '%s'\n", src);
+err:
+    return -1;
+}
+
+void parse_import(struct parse_state *state, int nargs, char **args)
+{
+    struct listnode *import_list = state->priv;
+    struct import *import;
+    char conf_file[PATH_MAX];
+    int ret;
+
+    if (nargs != 2) {
+        ERROR("single argument needed for import\n");
+        return;
+    }
+
+    ret = expand_props(conf_file, args[1], sizeof(conf_file));
+    if (ret) {
+        ERROR("error while handling import on line '%d' in '%s'\n",
+              state->line, state->filename);
+        return;
+    }
+
+    import = calloc(1, sizeof(struct import));
+    import->filename = strdup(conf_file);
+    list_add_tail(import_list, &import->list);
+    INFO("found import '%s', adding to import list", import->filename);
+}
+
 void parse_new_section(struct parse_state *state, int kw,
                        int nargs, char **args)
 {
@@ -180,13 +328,8 @@
         }
         break;
     case K_import:
-        if (nargs != 2) {
-            ERROR("single argument needed for import\n");
-        } else {
-            int ret = init_parse_config_file(args[1]);
-            if (ret)
-                ERROR("could not import file %s\n", args[1]);
-        }
+        parse_import(state, nargs, args);
+        break;
     }
     state->parse_line = parse_line_no_op;
 }
@@ -194,6 +337,8 @@
 static void parse_config(const char *fn, char *s)
 {
     struct parse_state state;
+    struct listnode import_list;
+    struct listnode *node;
     char *args[INIT_PARSER_MAXARGS];
     int nargs;
 
@@ -203,11 +348,15 @@
     state.ptr = s;
     state.nexttoken = 0;
     state.parse_line = parse_line_no_op;
+
+    list_init(&import_list);
+    state.priv = &import_list;
+
     for (;;) {
         switch (next_token(&state)) {
         case T_EOF:
             state.parse_line(&state, 0, 0);
-            return;
+            goto parser_done;
         case T_NEWLINE:
             state.line++;
             if (nargs) {
@@ -228,6 +377,18 @@
             break;
         }
     }
+
+parser_done:
+    list_for_each(node, &import_list) {
+         struct import *import = node_to_item(node, struct import, list);
+         int ret;
+
+         INFO("importing '%s'", import->filename);
+         ret = init_parse_config_file(import->filename);
+         if (ret)
+             ERROR("could not import file '%s' from '%s'\n",
+                   import->filename, fn);
+    }
 }
 
 int init_parse_config_file(const char *fn)
diff --git a/init/init_parser.h b/init/init_parser.h
index ff13b04..b078cad 100644
--- a/init/init_parser.h
+++ b/init/init_parser.h
@@ -31,5 +31,6 @@
 void queue_builtin_action(int (*func)(int nargs, char **args), char *name);
 
 int init_parse_config_file(const char *fn);
+int expand_props(char *dst, const char *src, int len);
 
 #endif
diff --git a/init/parser.h b/init/parser.h
index be93758..0a5802a 100644
--- a/init/parser.h
+++ b/init/parser.h
@@ -30,6 +30,7 @@
     void *context;
     void (*parse_line)(struct parse_state *state, int nargs, char **args);
     const char *filename;
+    void *priv;
 };
 
 int lookup_keyword(const char *s);
diff --git a/init/property_service.c b/init/property_service.c
index 6733437..059db97 100644
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -505,11 +505,14 @@
     persistent_properties_loaded = 1;
 }
 
-void property_init(bool load_defaults)
+void property_init(void)
 {
     init_property_area();
-    if (load_defaults)
-        load_properties_from_file(PROP_PATH_RAMDISK_DEFAULT);
+}
+
+void property_load_boot_defaults(void)
+{
+    load_properties_from_file(PROP_PATH_RAMDISK_DEFAULT);
 }
 
 int properties_inited(void)
diff --git a/init/property_service.h b/init/property_service.h
index 37c2788..b9d1bf6 100644
--- a/init/property_service.h
+++ b/init/property_service.h
@@ -20,7 +20,8 @@
 #include <stdbool.h>
 
 extern void handle_property_set_fd(void);
-extern void property_init(bool load_defaults);
+extern void property_init(void);
+extern void property_load_boot_defaults(void);
 extern void load_persist_props(void);
 extern void start_property_service(void);
 void get_property_workspace(int *fd, int *sz);
diff --git a/libcutils/buffer.c b/libcutils/buffer.c
index f34b8f8..af99bd7 100644
--- a/libcutils/buffer.c
+++ b/libcutils/buffer.c
@@ -104,9 +104,9 @@
     if (bytesWritten >= 0) {
         buffer->remaining -= bytesWritten;
 
-        LOGD("Buffer bytes written: %d", (int) bytesWritten);
-        LOGD("Buffer size: %d", (int) buffer->size);
-        LOGD("Buffer remaining: %d", (int) buffer->remaining);        
+        ALOGD("Buffer bytes written: %d", (int) bytesWritten);
+        ALOGD("Buffer size: %d", (int) buffer->size);
+        ALOGD("Buffer remaining: %d", (int) buffer->remaining);
 
         return buffer->remaining;
     }
diff --git a/libcutils/loghack.h b/libcutils/loghack.h
index 2bfffe4..750cab0 100644
--- a/libcutils/loghack.h
+++ b/libcutils/loghack.h
@@ -25,14 +25,14 @@
 #include <cutils/log.h>
 #else
 #include <stdio.h>
-#define LOG(level, ...) \
+#define ALOG(level, ...) \
         ((void)printf("cutils:" level "/" LOG_TAG ": " __VA_ARGS__))
-#define LOGV(...)   LOG("V", __VA_ARGS__)
-#define LOGD(...)   LOG("D", __VA_ARGS__)
-#define LOGI(...)   LOG("I", __VA_ARGS__)
-#define LOGW(...)   LOG("W", __VA_ARGS__)
-#define LOGE(...)   LOG("E", __VA_ARGS__)
-#define LOG_ALWAYS_FATAL(...)   do { LOGE(__VA_ARGS__); exit(1); } while (0)
+#define ALOGV(...)   ALOG("V", __VA_ARGS__)
+#define ALOGD(...)   ALOG("D", __VA_ARGS__)
+#define ALOGI(...)   ALOG("I", __VA_ARGS__)
+#define ALOGW(...)   ALOG("W", __VA_ARGS__)
+#define ALOGE(...)   ALOG("E", __VA_ARGS__)
+#define LOG_ALWAYS_FATAL(...)   do { ALOGE(__VA_ARGS__); exit(1); } while (0)
 #endif
 
 #endif // _CUTILS_LOGHACK_H
diff --git a/libcutils/mq.c b/libcutils/mq.c
index 3b65f1f..6f6740e 100644
--- a/libcutils/mq.c
+++ b/libcutils/mq.c
@@ -222,7 +222,7 @@
 static void closeWithWarning(int fd) {
     int result = close(fd);
     if (result == -1) {
-        LOGW("close() error: %s", strerror(errno));
+        ALOGW("close() error: %s", strerror(errno));
     }
 }
 
@@ -263,7 +263,7 @@
 
 /** Frees a simple, i.e. header-only, outgoing packet. */
 static void outgoingPacketFree(OutgoingPacket* packet) {
-    LOGD("Freeing outgoing packet.");
+    ALOGD("Freeing outgoing packet.");
 	free(packet);
 }
 
@@ -374,10 +374,10 @@
  */
 static void peerProxyKill(PeerProxy* peerProxy, bool errnoIsSet) {
     if (errnoIsSet) {
-        LOGI("Peer %d died. errno: %s", peerProxy->credentials.pid, 
+        ALOGI("Peer %d died. errno: %s", peerProxy->credentials.pid, 
                 strerror(errno));
     } else {
-        LOGI("Peer %d died.", peerProxy->credentials.pid);
+        ALOGI("Peer %d died.", peerProxy->credentials.pid);
     }
     
     // If we lost the master, we're up a creek. We can't let this happen.
@@ -433,12 +433,12 @@
 static void peerProxyHandleError(PeerProxy* peerProxy, char* functionName) {
     if (errno == EINTR) {
         // Log interruptions but otherwise ignore them.
-        LOGW("%s() interrupted.", functionName);
+        ALOGW("%s() interrupted.", functionName);
     } else if (errno == EAGAIN) {
-    	LOGD("EWOULDBLOCK");
+        ALOGD("EWOULDBLOCK");
         // Ignore.
     } else {
-        LOGW("Error returned by %s().", functionName);
+        ALOGW("Error returned by %s().", functionName);
         peerProxyKill(peerProxy, true);
     }
 }
@@ -461,7 +461,7 @@
 static void peerProxyWriteBytes(PeerProxy* peerProxy) {	
 	Buffer* buffer = peerProxy->currentPacket->bytes;
 	if (peerProxyWriteFromBuffer(peerProxy, buffer)) {
-        LOGD("Bytes written.");
+        ALOGD("Bytes written.");
         peerProxyNextPacket(peerProxy);
     }    
 }
@@ -527,10 +527,10 @@
     Buffer* outgoingHeader = &peerProxy->outgoingHeader;
     bool headerWritten = bufferWriteComplete(outgoingHeader);
     if (!headerWritten) {
-        LOGD("Writing header...");
+        ALOGD("Writing header...");
         headerWritten = peerProxyWriteFromBuffer(peerProxy, outgoingHeader);
         if (headerWritten) {
-            LOGD("Header written.");
+            ALOGD("Header written.");
         }
     }    
 
@@ -559,7 +559,7 @@
  * Sets up a peer proxy's fd before we try to select() it.
  */
 static void peerProxyBeforeSelect(SelectableFd* fd) {
-    LOGD("Before select...");
+    ALOGD("Before select...");
 
     PeerProxy* peerProxy = (PeerProxy*) fd->data;
   
@@ -568,7 +568,7 @@
     peerUnlock(peerProxy->peer);
     
     if (hasPackets) {
-        LOGD("Packets found. Setting onWritable().");
+        ALOGD("Packets found. Setting onWritable().");
             
         fd->onWritable = &peerProxyWrite;
     } else {
@@ -579,11 +579,11 @@
 
 /** Prepare to read bytes from the peer. */
 static void peerProxyExpectBytes(PeerProxy* peerProxy, Header* header) {
-	LOGD("Expecting %d bytes.", header->size);
-	
-	peerProxy->inputState = READING_BYTES;
+    ALOGD("Expecting %d bytes.", header->size);
+
+    peerProxy->inputState = READING_BYTES;
     if (bufferPrepareForRead(peerProxy->inputBuffer, header->size) == -1) {
-        LOGW("Couldn't allocate memory for incoming data. Size: %u",
+        ALOGW("Couldn't allocate memory for incoming data. Size: %u",
                 (unsigned int) header->size);    
         
         // TODO: Ignore the packet and log a warning?
@@ -670,7 +670,7 @@
     // TODO: Restructure things so we don't need this check.
     // Verify that this really is the master.
     if (!masterProxy->master) {
-        LOGW("Non-master process %d tried to send us a connection.", 
+        ALOGW("Non-master process %d tried to send us a connection.", 
             masterProxy->credentials.pid);
         // Kill off the evil peer.
         peerProxyKill(masterProxy, false);
@@ -686,7 +686,7 @@
     peerLock(localPeer);
     PeerProxy* peerProxy = peerProxyGetOrCreate(localPeer, pid, false);
     if (peerProxy == NULL) {
-        LOGW("Peer proxy creation failed: %s", strerror(errno));
+        ALOGW("Peer proxy creation failed: %s", strerror(errno));
     } else {
         // Fill in full credentials.
         peerProxy->credentials = header->credentials;
@@ -746,7 +746,7 @@
     if (size < 0) {
         if (errno == EINTR) {
             // Log interruptions but otherwise ignore them.
-            LOGW("recvmsg() interrupted.");
+            ALOGW("recvmsg() interrupted.");
             return;
         } else if (errno == EAGAIN) {
             // Keep waiting for the connection.
@@ -777,14 +777,14 @@
     // The peer proxy this connection is for.
     PeerProxy* peerProxy = masterProxy->connecting;
     if (peerProxy == NULL) {
-        LOGW("Received connection for unknown peer.");
+        ALOGW("Received connection for unknown peer.");
         closeWithWarning(incomingFd);
     } else {
         Peer* peer = masterProxy->peer;
         
         SelectableFd* selectableFd = selectorAdd(peer->selector, incomingFd);
         if (selectableFd == NULL) {
-            LOGW("Error adding fd to selector for %d.",
+            ALOGW("Error adding fd to selector for %d.",
                     peerProxy->credentials.pid);
             closeWithWarning(incomingFd);
             peerProxyKill(peerProxy, false);
@@ -811,7 +811,7 @@
     int sockets[2];
     int result = socketpair(AF_LOCAL, SOCK_STREAM, 0, sockets);
     if (result == -1) {
-        LOGW("socketpair() error: %s", strerror(errno));
+        ALOGW("socketpair() error: %s", strerror(errno));
         // TODO: Send CONNECTION_FAILED packets to peers.
         return;
     }
@@ -821,7 +821,7 @@
     if (packetA == NULL || packetB == NULL) {
         free(packetA);
         free(packetB);
-        LOGW("malloc() error. Failed to tell process %d that process %d is"
+        ALOGW("malloc() error. Failed to tell process %d that process %d is"
                 " dead.", peerA->credentials.pid, peerB->credentials.pid);
         return;
     }
@@ -852,7 +852,7 @@
         Credentials credentials) {
     OutgoingPacket* packet = calloc(1, sizeof(OutgoingPacket));
     if (packet == NULL) {
-        LOGW("malloc() error. Failed to tell process %d that process %d is"
+        ALOGW("malloc() error. Failed to tell process %d that process %d is"
                 " dead.", peerProxy->credentials.pid, credentials.pid);
         return;
     }
@@ -902,10 +902,10 @@
     peerUnlock(peer);
 
     if (peerProxy != NULL) {
-        LOGI("Couldn't connect to %d.", pid);
+        ALOGI("Couldn't connect to %d.", pid);
         peerProxyKill(peerProxy, false);
     } else {
-        LOGW("Peer proxy for %d not found. This shouldn't happen.", pid);
+        ALOGW("Peer proxy for %d not found. This shouldn't happen.", pid);
     }
     
     peerProxyExpectHeader(masterProxy);
@@ -929,7 +929,7 @@
             peerProxyExpectBytes(peerProxy, header);
             break;
         default:
-            LOGW("Invalid packet type from %d: %d", peerProxy->credentials.pid, 
+            ALOGW("Invalid packet type from %d: %d", peerProxy->credentials.pid, 
                     header->type);
             peerProxyKill(peerProxy, false);
     }
@@ -947,7 +947,7 @@
         return false;
     } else if (size == 0) {
         // EOF.
-    	LOGI("EOF");
+    	ALOGI("EOF");
         peerProxyKill(peerProxy, false);
         return false;
     } else if (bufferReadComplete(in)) {
@@ -963,23 +963,23 @@
  * Reads input from a peer process.
  */
 static void peerProxyRead(SelectableFd* fd) {
-    LOGD("Reading...");
+    ALOGD("Reading...");
     PeerProxy* peerProxy = (PeerProxy*) fd->data;
     int state = peerProxy->inputState;
     Buffer* in = peerProxy->inputBuffer;
     switch (state) {
         case READING_HEADER:
             if (peerProxyBufferInput(peerProxy)) {
-                LOGD("Header read.");
+                ALOGD("Header read.");
                 // We've read the complete header.
                 Header* header = (Header*) in->data;
                 peerProxyHandleHeader(peerProxy, header);
             }
             break;
         case READING_BYTES:
-            LOGD("Reading bytes...");
+            ALOGD("Reading bytes...");
             if (peerProxyBufferInput(peerProxy)) {
-                LOGD("Bytes read.");
+                ALOGD("Bytes read.");
                 // We have the complete packet. Notify bytes listener.
                 peerProxy->peer->onBytes(peerProxy->credentials,
                     in->data, in->size);
@@ -1026,11 +1026,11 @@
     // Accept connection.
     int socket = accept(listenerFd->fd, NULL, NULL);
     if (socket == -1) {
-        LOGW("accept() error: %s", strerror(errno));
+        ALOGW("accept() error: %s", strerror(errno));
         return;
     }
     
-    LOGD("Accepted connection as fd %d.", socket);
+    ALOGD("Accepted connection as fd %d.", socket);
     
     // Get credentials.
     Credentials credentials;
@@ -1040,7 +1040,7 @@
                 &ucredentials, &credentialsSize);
     // We might want to verify credentialsSize.
     if (result == -1) {
-        LOGW("getsockopt() error: %s", strerror(errno));
+        ALOGW("getsockopt() error: %s", strerror(errno));
         closeWithWarning(socket);
         return;
     }
@@ -1050,7 +1050,7 @@
     credentials.uid = ucredentials.uid;
     credentials.gid = ucredentials.gid;
     
-    LOGI("Accepted connection from process %d.", credentials.pid);
+    ALOGI("Accepted connection from process %d.", credentials.pid);
    
     Peer* masterPeer = (Peer*) listenerFd->data;
     
@@ -1061,7 +1061,7 @@
         = hashmapGet(masterPeer->peerProxies, &credentials.pid);
     if (peerProxy != NULL) {
         peerUnlock(masterPeer);
-        LOGW("Alread connected to process %d.", credentials.pid);
+        ALOGW("Alread connected to process %d.", credentials.pid);
         closeWithWarning(socket);
         return;
     }
@@ -1070,7 +1070,7 @@
     SelectableFd* socketFd = selectorAdd(masterPeer->selector, socket);
     if (socketFd == NULL) {
         peerUnlock(masterPeer);
-        LOGW("malloc() failed.");
+        ALOGW("malloc() failed.");
         closeWithWarning(socket);
         return;
     }
@@ -1079,7 +1079,7 @@
     peerProxy = peerProxyCreate(masterPeer, credentials);
     peerUnlock(masterPeer);
     if (peerProxy == NULL) {
-        LOGW("malloc() failed.");
+        ALOGW("malloc() failed.");
         socketFd->remove = true;
         closeWithWarning(socket);
     }
@@ -1118,7 +1118,7 @@
 
 /** Frees a packet of bytes. */
 static void outgoingPacketFreeBytes(OutgoingPacket* packet) {
-    LOGD("Freeing outgoing packet.");
+    ALOGD("Freeing outgoing packet.");
     bufferFree(packet->bytes);
     free(packet);
 }
@@ -1270,7 +1270,7 @@
         LOG_ALWAYS_FATAL("bind() error: %s", strerror(errno));
     }
 
-    LOGD("Listener socket: %d",  listenerSocket);   
+    ALOGD("Listener socket: %d",  listenerSocket);
     
     // Queue up to 16 connections.
     result = listen(listenerSocket, 16);
diff --git a/libcutils/properties.c b/libcutils/properties.c
index 98f356b..f732ec0 100644
--- a/libcutils/properties.c
+++ b/libcutils/properties.c
@@ -99,7 +99,7 @@
     
     sock = socket(AF_UNIX, SOCK_STREAM, 0);
     if (sock < 0) {
-        LOGW("UNIX domain socket create failed (errno=%d)\n", errno);
+        ALOGW("UNIX domain socket create failed (errno=%d)\n", errno);
         return -1;
     }
 
@@ -110,7 +110,7 @@
     if (cc < 0) {
         // ENOENT means socket file doesn't exist
         // ECONNREFUSED means socket exists but nobody is listening
-        //LOGW("AF_UNIX connect failed for '%s': %s\n",
+        //ALOGW("AF_UNIX connect failed for '%s': %s\n",
         //    fileName, strerror(errno));
         close(sock);
         return -1;
@@ -128,9 +128,9 @@
 
     gPropFd = connectToServer(SYSTEM_PROPERTY_PIPE_NAME);
     if (gPropFd < 0) {
-        //LOGW("not connected to system property server\n");
+        //ALOGW("not connected to system property server\n");
     } else {
-        //LOGV("Connected to system property server\n");
+        //ALOGV("Connected to system property server\n");
     }
 }
 
@@ -140,7 +140,7 @@
     char recvBuf[1+PROPERTY_VALUE_MAX];
     int len = -1;
 
-    //LOGV("PROPERTY GET [%s]\n", key);
+    //ALOGV("PROPERTY GET [%s]\n", key);
 
     pthread_once(&gInitOnce, init);
     if (gPropFd < 0) {
@@ -189,12 +189,12 @@
         strcpy(value, recvBuf+1);
         len = strlen(value);
     } else {
-        LOGE("Got strange response to property_get request (%d)\n",
+        ALOGE("Got strange response to property_get request (%d)\n",
             recvBuf[0]);
         assert(0);
         return -1;
     }
-    //LOGV("PROP [found=%d def='%s'] (%d) [%s]: [%s]\n",
+    //ALOGV("PROP [found=%d def='%s'] (%d) [%s]: [%s]\n",
     //    recvBuf[0], default_value, len, key, value);
 
     return len;
@@ -207,7 +207,7 @@
     char recvBuf[1];
     int result = -1;
 
-    //LOGV("PROPERTY SET [%s]: [%s]\n", key, value);
+    //ALOGV("PROPERTY SET [%s]: [%s]\n", key, value);
 
     pthread_once(&gInitOnce, init);
     if (gPropFd < 0)
@@ -241,7 +241,7 @@
 int property_list(void (*propfn)(const char *key, const char *value, void *cookie), 
                   void *cookie)
 {
-    //LOGV("PROPERTY LIST\n");
+    //ALOGV("PROPERTY LIST\n");
     pthread_once(&gInitOnce, init);
     if (gPropFd < 0)
         return -1;
diff --git a/libcutils/qtaguid.c b/libcutils/qtaguid.c
index 994ad32..1c57774 100644
--- a/libcutils/qtaguid.c
+++ b/libcutils/qtaguid.c
@@ -60,7 +60,7 @@
 static int write_ctrl(const char *cmd) {
     int fd, res, savedErrno;
 
-    LOGV("write_ctrl(%s)", cmd);
+    ALOGV("write_ctrl(%s)", cmd);
 
     fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY));
     if (fd < 0) {
@@ -74,7 +74,7 @@
         savedErrno = 0;
     }
     if (res < 0) {
-        LOGI("Failed write_ctrl(%s) res=%d errno=%d", cmd, res, savedErrno);
+        ALOGI("Failed write_ctrl(%s) res=%d errno=%d", cmd, res, savedErrno);
     }
     close(fd);
     return -savedErrno;
@@ -107,11 +107,11 @@
 
     snprintf(lineBuf, sizeof(lineBuf), "t %d %llu %d", sockfd, kTag, uid);
 
-    LOGV("Tagging socket %d with tag %llx{%u,0} for uid %d", sockfd, kTag, tag, uid);
+    ALOGV("Tagging socket %d with tag %llx{%u,0} for uid %d", sockfd, kTag, tag, uid);
 
     res = write_ctrl(lineBuf);
     if (res < 0) {
-        LOGI("Tagging socket %d with tag %llx(%d) for uid %d failed errno=%d",
+        ALOGI("Tagging socket %d with tag %llx(%d) for uid %d failed errno=%d",
              sockfd, kTag, tag, uid, res);
     }
 
@@ -122,12 +122,12 @@
     char lineBuf[CTRL_MAX_INPUT_LEN];
     int res;
 
-    LOGV("Untagging socket %d", sockfd);
+    ALOGV("Untagging socket %d", sockfd);
 
     snprintf(lineBuf, sizeof(lineBuf), "u %d", sockfd);
     res = write_ctrl(lineBuf);
     if (res < 0) {
-        LOGI("Untagging socket %d failed errno=%d", sockfd, res);
+        ALOGI("Untagging socket %d failed errno=%d", sockfd, res);
     }
 
     return res;
@@ -137,7 +137,7 @@
     char lineBuf[CTRL_MAX_INPUT_LEN];
     int res;
 
-    LOGV("Setting counters to set %d for uid %d", counterSetNum, uid);
+    ALOGV("Setting counters to set %d for uid %d", counterSetNum, uid);
 
     snprintf(lineBuf, sizeof(lineBuf), "s %d %d", counterSetNum, uid);
     res = write_ctrl(lineBuf);
@@ -149,14 +149,14 @@
     int fd, cnt = 0, res = 0;
     uint64_t kTag = (uint64_t)tag << 32;
 
-    LOGV("Deleting tag data with tag %llx{%d,0} for uid %d", kTag, tag, uid);
+    ALOGV("Deleting tag data with tag %llx{%d,0} for uid %d", kTag, tag, uid);
 
     pthread_once(&resTrackInitDone, qtaguid_resTrack);
 
     snprintf(lineBuf, sizeof(lineBuf), "d %llu %d", kTag, uid);
     res = write_ctrl(lineBuf);
     if (res < 0) {
-        LOGI("Deleteing tag data with tag %llx/%d for uid %d failed with cnt=%d errno=%d",
+        ALOGI("Deleteing tag data with tag %llx/%d for uid %d failed with cnt=%d errno=%d",
              kTag, tag, uid, cnt, errno);
     }
 
diff --git a/libcutils/record_stream.c b/libcutils/record_stream.c
index 274423b..6994904 100644
--- a/libcutils/record_stream.c
+++ b/libcutils/record_stream.c
@@ -144,7 +144,7 @@
         && p_rs->read_end == p_rs->buffer_end
     ) {
         // this should never happen
-        //LOGE("max record length exceeded\n");
+        //ALOGE("max record length exceeded\n");
         assert (0);
         errno = EFBIG;
         return -1;
diff --git a/libcutils/selector.c b/libcutils/selector.c
index 9436393..3776bbb 100644
--- a/libcutils/selector.c
+++ b/libcutils/selector.c
@@ -48,7 +48,7 @@
     static char garbage[64];
     if (read(wakeupFd->fd, garbage, sizeof(garbage)) < 0) {
         if (errno == EINTR) {
-            LOGI("read() interrupted.");    
+            ALOGI("read() interrupted.");    
         } else {
             LOG_ALWAYS_FATAL("This should never happen: %s", strerror(errno));
         }
@@ -77,7 +77,7 @@
     static char garbage[1];
     if (write(selector->wakeupPipe[1], garbage, sizeof(garbage)) < 0) {
         if (errno == EINTR) {
-            LOGI("read() interrupted.");    
+            ALOGI("read() interrupted.");    
         } else {
             LOG_ALWAYS_FATAL("This should never happen: %s", strerror(errno));
         }
@@ -96,7 +96,7 @@
         LOG_ALWAYS_FATAL("pipe() error: %s", strerror(errno));
     }
     
-    LOGD("Wakeup fd: %d", selector->wakeupPipe[0]);
+    ALOGD("Wakeup fd: %d", selector->wakeupPipe[0]);
     
     SelectableFd* wakeupFd = selectorAdd(selector, selector->wakeupPipe[0]);
     if (wakeupFd == NULL) {
@@ -169,11 +169,11 @@
             
             bool inSet = false;
             if (maybeAdd(selectableFd, selectableFd->onExcept, exceptFds)) {
-            	LOGD("Selecting fd %d for writing...", selectableFd->fd);
+                ALOGD("Selecting fd %d for writing...", selectableFd->fd);
                 inSet = true;
             }
             if (maybeAdd(selectableFd, selectableFd->onReadable, readFds)) {
-            	LOGD("Selecting fd %d for reading...", selectableFd->fd);
+                ALOGD("Selecting fd %d for reading...", selectableFd->fd);
                 inSet = true;
             }
             if (maybeAdd(selectableFd, selectableFd->onWritable, writeFds)) {
@@ -200,9 +200,9 @@
  */
 static inline void maybeInvoke(SelectableFd* selectableFd,
         void (*callback)(SelectableFd*), fd_set* fdSet) {
-	if (callback != NULL && !selectableFd->remove && 
+    if (callback != NULL && !selectableFd->remove && 
             FD_ISSET(selectableFd->fd, fdSet)) {
-		LOGD("Selected fd %d.", selectableFd->fd);
+        ALOGD("Selected fd %d.", selectableFd->fd);
         callback(selectableFd);
     }
 }
@@ -238,20 +238,20 @@
         
         prepareForSelect(selector);
 
-        LOGD("Entering select().");
+        ALOGD("Entering select().");
         
         // Select file descriptors.
         int result = select(selector->maxFd + 1, &selector->readFds, 
                 &selector->writeFds, &selector->exceptFds, NULL);
         
-        LOGD("Exiting select().");
+        ALOGD("Exiting select().");
         
         setInSelect(selector, false);
         
         if (result == -1) {
             // Abort on everything except EINTR.
             if (errno == EINTR) {
-                LOGI("select() interrupted.");    
+                ALOGI("select() interrupted.");    
             } else {
                 LOG_ALWAYS_FATAL("select() error: %s", 
                         strerror(errno));
diff --git a/libcutils/sockets.c b/libcutils/sockets.c
index 101a382..b5a1b3d 100644
--- a/libcutils/sockets.c
+++ b/libcutils/sockets.c
@@ -30,12 +30,12 @@
     int n = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
 
     if (n != 0) {
-        LOGE("could not get socket credentials: %s\n", strerror(errno));
+        ALOGE("could not get socket credentials: %s\n", strerror(errno));
         return false;
     }
 
     if ((cr.uid != AID_ROOT) && (cr.uid != AID_SHELL)) {
-        LOGE("untrusted userid on other end of socket: userid %d\n", cr.uid);
+        ALOGE("untrusted userid on other end of socket: userid %d\n", cr.uid);
         return false;
     }
 #endif
diff --git a/libcutils/str_parms.c b/libcutils/str_parms.c
index dfa1f73..14fecec 100644
--- a/libcutils/str_parms.c
+++ b/libcutils/str_parms.c
@@ -103,7 +103,7 @@
     if (!str)
         goto err_strdup;
 
-    LOGV("%s: source string == '%s'\n", __func__, _string);
+    ALOGV("%s: source string == '%s'\n", __func__, _string);
 
     kvpair = strtok_r(str, ";", &tmpstr);
     while (kvpair && *kvpair) {
@@ -137,7 +137,7 @@
     }
 
     if (!items)
-        LOGV("%s: no items found in string\n", __func__);
+        ALOGV("%s: no items found in string\n", __func__);
 
     free(str);
 
@@ -281,7 +281,7 @@
 
 static bool dump_entry(void *key, void *value, void *context)
 {
-    LOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value);
+    ALOGI("key: '%s' value: '%s'\n", (char *)key, (char *)value);
     return true;
 }
 
@@ -301,7 +301,7 @@
     str_parms_dump(str_parms);
     out_str = str_parms_to_str(str_parms);
     str_parms_destroy(str_parms);
-    LOGI("%s: '%s' stringified is '%s'", __func__, str, out_str);
+    ALOGI("%s: '%s' stringified is '%s'", __func__, str, out_str);
     free(out_str);
 }
 
diff --git a/libcutils/zygote.c b/libcutils/zygote.c
index aa060c0..75ce3ba 100644
--- a/libcutils/zygote.c
+++ b/libcutils/zygote.c
@@ -46,7 +46,7 @@
 {
 #ifndef HAVE_ANDROID_OS
     // not supported on simulator targets
-    //LOGE("zygote_* not supported on simulator targets");
+    //ALOGE("zygote_* not supported on simulator targets");
     return -1;
 #else /* HAVE_ANDROID_OS */
     uint32_t pid;
diff --git a/libdiskconfig/config_mbr.c b/libdiskconfig/config_mbr.c
index 825ba60..703484c 100644
--- a/libdiskconfig/config_mbr.c
+++ b/libdiskconfig/config_mbr.c
@@ -47,7 +47,7 @@
     pentry->start_lba = start;
     pentry->len_lba = len;
 
-    LOGI("Configuring pentry. status=0x%x type=0x%x start_lba=%u len_lba=%u",
+    ALOGI("Configuring pentry. status=0x%x type=0x%x start_lba=%u len_lba=%u",
          pentry->status, pentry->type, pentry->start_lba, pentry->len_lba);
 }
 
@@ -62,7 +62,7 @@
     lba = (lba + (uint64_t)sect_size - 1) & ~((uint64_t)sect_size - 1);
     lba /= (uint64_t)sect_size;
     if (lba >= 0xffffffffULL)
-        LOGE("Error converting kb -> lba. 32bit overflow, expect weirdness");
+        ALOGE("Error converting kb -> lba. 32bit overflow, expect weirdness");
     return (uint32_t)(lba & 0xffffffffULL);
 }
 
@@ -75,12 +75,12 @@
     struct pc_partition *pentry;
 
     if (pnum >= PC_NUM_BOOT_RECORD_PARTS) {
-        LOGE("Maximum number of primary partition exceeded.");
+        ALOGE("Maximum number of primary partition exceeded.");
         return NULL;
     }
 
     if (!(item = alloc_wl(sizeof(struct pc_partition)))) {
-        LOGE("Unable to allocate memory for partition entry.");
+        ALOGE("Unable to allocate memory for partition entry.");
         return NULL;
     }
 
@@ -146,7 +146,7 @@
     uint32_t len; /* in lba units */
 
     if (!(item = alloc_wl(sizeof(struct pc_boot_record)))) {
-        LOGE("Unable to allocate memory for EBR.");
+        ALOGE("Unable to allocate memory for EBR.");
         return NULL;
     }
 
@@ -163,7 +163,7 @@
         len = kb_to_lba(pinfo->len_kb, dinfo->sect_size);
     else {
         if (pnext) {
-            LOGE("Only the last partition can be specified to fill the disk "
+            ALOGE("Only the last partition can be specified to fill the disk "
                  "(name = '%s')", pinfo->name);
             goto fail;
         }
@@ -233,7 +233,7 @@
                 if ((temp_wr = mk_pri_pentry(dinfo, NULL, cnt, &cur_lba)))
                     wlist_add(&wr_list, temp_wr);
                 else {
-                    LOGE("Cannot create primary extended partition.");
+                    ALOGE("Cannot create primary extended partition.");
                     goto fail;
                 }
             }
@@ -259,7 +259,7 @@
         if (temp_wr)
             wlist_add(&wr_list, temp_wr);
         else {
-            LOGE("Cannot create partition %d (%s).", cnt, pinfo->name);
+            ALOGE("Cannot create partition %d (%s).", cnt, pinfo->name);
             goto fail;
         }
     }
@@ -270,7 +270,7 @@
         cur_lba = 0;
         memset(&blank, 0, sizeof(struct part_info));
         if (!(temp_wr = mk_pri_pentry(dinfo, &blank, cnt, &cur_lba))) {
-            LOGE("Cannot create blank partition %d.", cnt);
+            ALOGE("Cannot create blank partition %d.", cnt);
             goto fail;
         }
         wlist_add(&wr_list, temp_wr);
@@ -279,7 +279,7 @@
     return wr_list;
 
 nospace:
-    LOGE("Not enough space to add parttion '%s'.", pinfo->name);
+    ALOGE("Not enough space to add parttion '%s'.", pinfo->name);
 
 fail:
     wlist_free(wr_list);
@@ -310,13 +310,13 @@
         num++;
 
     if (!(dev_name = malloc(MAX_NAME_LEN))) {
-        LOGE("Cannot allocate memory.");
+        ALOGE("Cannot allocate memory.");
         return NULL;
     }
 
     num = snprintf(dev_name, MAX_NAME_LEN, "%s%d", dinfo->device, num);
     if (num >= MAX_NAME_LEN) {
-        LOGE("Device name is too long?!");
+        ALOGE("Device name is too long?!");
         free(dev_name);
         return NULL;
     }
diff --git a/libdiskconfig/diskconfig.c b/libdiskconfig/diskconfig.c
index 4dd8c52..d5425de 100644
--- a/libdiskconfig/diskconfig.c
+++ b/libdiskconfig/diskconfig.c
@@ -45,7 +45,7 @@
     tmp[sizeof(tmp)-1] = '\0';
     len_str = strlen(tmp);
     if (!len_str) {
-        LOGE("Invalid disk length specified.");
+        ALOGE("Invalid disk length specified.");
         return 1;
     }
 
@@ -64,13 +64,13 @@
 
     *plen = strtoull(tmp, NULL, 0);
     if (!*plen) {
-        LOGE("Invalid length specified: %s", str);
+        ALOGE("Invalid length specified: %s", str);
         return 1;
     }
 
     if (*plen == (uint64_t)-1) {
         if (multiple > 1) {
-            LOGE("Size modifier illegal when len is -1");
+            ALOGE("Size modifier illegal when len is -1");
             return 1;
         }
     } else {
@@ -80,7 +80,7 @@
         *plen *= multiple;
 
         if (*plen > 0xffffffffULL) {
-            LOGE("Length specified is too large!: %llu KB", *plen);
+            ALOGE("Length specified is too large!: %llu KB", *plen);
             return 1;
         }
     }
@@ -108,7 +108,7 @@
             pinfo->flags |= PART_ACTIVE_FLAG;
 
         if (!(tmp = config_str(partnode, "type", NULL))) {
-            LOGE("Partition type required: %s", pinfo->name);
+            ALOGE("Partition type required: %s", pinfo->name);
             return 1;
         }
 
@@ -118,7 +118,7 @@
         } else if (!strcmp(tmp, "fat32")) {
             pinfo->type = PC_PART_TYPE_FAT32;
         } else {
-            LOGE("Unsupported partition type found: %s", tmp);
+            ALOGE("Unsupported partition type found: %s", tmp);
             return 1;
         }
 
@@ -146,13 +146,13 @@
     const char *tmp;
 
     if (!(dinfo = malloc(sizeof(struct disk_info)))) {
-        LOGE("Could not malloc disk_info");
+        ALOGE("Could not malloc disk_info");
         return NULL;
     }
     memset(dinfo, 0, sizeof(struct disk_info));
 
     if (!(dinfo->part_lst = malloc(MAX_NUM_PARTS * sizeof(struct part_info)))) {
-        LOGE("Could not malloc part_lst");
+        ALOGE("Could not malloc part_lst");
         goto fail;
     }
     memset(dinfo->part_lst, 0,
@@ -160,33 +160,33 @@
 
     config_load_file(root, fn);
     if (root->first_child == NULL) {
-        LOGE("Could not read config file %s", fn);
+        ALOGE("Could not read config file %s", fn);
         goto fail;
     }
 
     if (!(devroot = config_find(root, "device"))) {
-        LOGE("Could not find device section in config file '%s'", fn);
+        ALOGE("Could not find device section in config file '%s'", fn);
         goto fail;
     }
 
 
     if (!(tmp = config_str(devroot, "path", path_override))) {
-        LOGE("device path is requried");
+        ALOGE("device path is requried");
         goto fail;
     }
     dinfo->device = strdup(tmp);
 
     /* find the partition scheme */
     if (!(tmp = config_str(devroot, "scheme", NULL))) {
-        LOGE("partition scheme is required");
+        ALOGE("partition scheme is required");
         goto fail;
     } else if (!strcmp(tmp, "mbr")) {
         dinfo->scheme = PART_SCHEME_MBR;
     } else if (!strcmp(tmp, "gpt")) {
-        LOGE("'gpt' partition scheme not supported yet.");
+        ALOGE("'gpt' partition scheme not supported yet.");
         goto fail;
     } else {
-        LOGE("Unknown partition scheme specified: %s", tmp);
+        ALOGE("Unknown partition scheme specified: %s", tmp);
         goto fail;
     }
 
@@ -194,30 +194,30 @@
     tmp = config_str(devroot, "sector_size", "512");
     dinfo->sect_size = strtol(tmp, NULL, 0);
     if (!dinfo->sect_size) {
-        LOGE("Invalid sector size: %s", tmp);
+        ALOGE("Invalid sector size: %s", tmp);
         goto fail;
     }
 
     /* first lba where the partitions will start on disk */
     if (!(tmp = config_str(devroot, "start_lba", NULL))) {
-        LOGE("start_lba must be provided");
+        ALOGE("start_lba must be provided");
         goto fail;
     }
 
     if (!(dinfo->skip_lba = strtol(tmp, NULL, 0))) {
-        LOGE("Invalid starting LBA (or zero): %s", tmp);
+        ALOGE("Invalid starting LBA (or zero): %s", tmp);
         goto fail;
     }
 
     /* Number of LBAs on disk */
     if (!(tmp = config_str(devroot, "num_lba", NULL))) {
-        LOGE("num_lba is required");
+        ALOGE("num_lba is required");
         goto fail;
     }
     dinfo->num_lba = strtoul(tmp, NULL, 0);
 
     if (!(partnode = config_find(devroot, "partitions"))) {
-        LOGE("Device must specify partition list");
+        ALOGE("Device must specify partition list");
         goto fail;
     }
 
@@ -244,12 +244,12 @@
     sync();
 
     if (fstat(fd, &stat)) {
-       LOGE("Cannot stat, errno=%d.", errno);
+       ALOGE("Cannot stat, errno=%d.", errno);
        return -1;
     }
 
     if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) {
-        LOGE("Could not re-read partition table. REBOOT!. (errno=%d)", errno);
+        ALOGE("Could not re-read partition table. REBOOT!. (errno=%d)", errno);
         return -1;
     }
 
@@ -281,12 +281,12 @@
         return -1;
 
     if ((fd = open(dinfo->device, O_RDWR)) < 0) {
-        LOGE("Cannot open device '%s' (errno=%d)", dinfo->device, errno);
+        ALOGE("Cannot open device '%s' (errno=%d)", dinfo->device, errno);
         return -1;
     }
 
     if (fstat(fd, &stat)) {
-        LOGE("Cannot stat file '%s', errno=%d.", dinfo->device, errno);
+        ALOGE("Cannot stat file '%s', errno=%d.", dinfo->device, errno);
         goto fail;
     }
 
@@ -299,19 +299,19 @@
     if (S_ISBLK(stat.st_mode)) {
         /* get the sector size and make sure we agree */
         if (ioctl(fd, BLKSSZGET, &sect_sz) < 0) {
-            LOGE("Cannot get sector size (errno=%d)", errno);
+            ALOGE("Cannot get sector size (errno=%d)", errno);
             goto fail;
         }
 
         if (!sect_sz || sect_sz != dinfo->sect_size) {
-            LOGE("Device sector size is zero or sector sizes do not match!");
+            ALOGE("Device sector size is zero or sector sizes do not match!");
             goto fail;
         }
 
         /* allow the user override the "disk size" if they provided num_lba */
         if (!dinfo->num_lba) {
             if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) {
-                LOGE("Could not get block device size (errno=%d)", errno);
+                ALOGE("Could not get block device size (errno=%d)", errno);
                 goto fail;
             }
             /* XXX: we assume that the disk has < 2^32 sectors :-) */
@@ -319,9 +319,9 @@
         } else
             disk_size = (uint64_t)dinfo->num_lba * (uint64_t)dinfo->sect_size;
     } else if (S_ISREG(stat.st_mode)) {
-        LOGI("Requesting operation on a regular file, not block device.");
+        ALOGI("Requesting operation on a regular file, not block device.");
         if (!dinfo->sect_size) {
-            LOGE("Sector size for regular file images cannot be zero");
+            ALOGE("Sector size for regular file images cannot be zero");
             goto fail;
         }
         if (dinfo->num_lba)
@@ -331,12 +331,12 @@
             disk_size = (uint64_t)stat.st_size;
         }
     } else {
-        LOGE("Device does not refer to a regular file or a block device!");
+        ALOGE("Device does not refer to a regular file or a block device!");
         goto fail;
     }
 
 #if 1
-    LOGV("Device/file %s: size=%llu bytes, num_lba=%u, sect_size=%d",
+    ALOGV("Device/file %s: size=%llu bytes, num_lba=%u, sect_size=%d",
          dinfo->device, disk_size, dinfo->num_lba, dinfo->sect_size);
 #endif
 
@@ -350,12 +350,12 @@
         if (part->len_kb != (uint32_t)-1) {
             total_size += part->len_kb * 1024;
         } else if (part->len_kb == 0) {
-            LOGE("Zero-size partition '%s' is invalid.", part->name);
+            ALOGE("Zero-size partition '%s' is invalid.", part->name);
             goto fail;
         } else {
             /* the partition requests the rest of the disk. */
             if (cnt + 1 != dinfo->num_parts) {
-                LOGE("Only the last partition in the list can request to fill "
+                ALOGE("Only the last partition in the list can request to fill "
                      "the rest of disk.");
                 goto fail;
             }
@@ -363,7 +363,7 @@
 
         if ((part->type != PC_PART_TYPE_LINUX) &&
             (part->type != PC_PART_TYPE_FAT32)) {
-            LOGE("Unknown partition type (0x%x) encountered for partition "
+            ALOGE("Unknown partition type (0x%x) encountered for partition "
                  "'%s'\n", part->type, part->name);
             goto fail;
         }
@@ -371,7 +371,7 @@
 
     /* only matters for disks, not files */
     if (S_ISBLK(stat.st_mode) && total_size > disk_size) {
-        LOGE("Total requested size of partitions (%llu) is greater than disk "
+        ALOGE("Total requested size of partitions (%llu) is greater than disk "
              "size (%llu).", total_size, disk_size);
         goto fail;
     }
@@ -399,7 +399,7 @@
         case PART_SCHEME_GPT:
             /* not supported yet */
         default:
-            LOGE("Uknown partition scheme.");
+            ALOGE("Uknown partition scheme.");
             break;
     }
 
@@ -438,7 +438,7 @@
     int rv;
 
     if (validate_and_config(dinfo, &fd, &wr_lst) != 0) {
-        LOGE("Configuration is invalid.");
+        ALOGE("Configuration is invalid.");
         goto fail;
     }
 
@@ -523,10 +523,10 @@
         case PART_SCHEME_MBR:
             return find_mbr_part(dinfo, name);
         case PART_SCHEME_GPT:
-            LOGE("GPT is presently not supported");
+            ALOGE("GPT is presently not supported");
             break;
         default:
-            LOGE("Unknown partition table scheme");
+            ALOGE("Unknown partition table scheme");
             break;
     }
 
diff --git a/libdiskconfig/diskutils.c b/libdiskconfig/diskutils.c
index 22767c0..e325735 100644
--- a/libdiskconfig/diskutils.c
+++ b/libdiskconfig/diskutils.c
@@ -40,20 +40,20 @@
     int done = 0;
     uint64_t total = 0;
 
-    LOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset);
+    ALOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset);
     if ((src_fd = open(src, O_RDONLY)) < 0) {
-        LOGE("Could not open %s for reading (errno=%d).", src, errno);
+        ALOGE("Could not open %s for reading (errno=%d).", src, errno);
         goto fail;
     }
 
     if (!test) {
         if ((dst_fd = open(dst, O_RDWR)) < 0) {
-            LOGE("Could not open '%s' for read/write (errno=%d).", dst, errno);
+            ALOGE("Could not open '%s' for read/write (errno=%d).", dst, errno);
             goto fail;
         }
 
         if (lseek64(dst_fd, offset, SEEK_SET) != offset) {
-            LOGE("Could not seek to offset %lld in %s.", offset, dst);
+            ALOGE("Could not seek to offset %lld in %s.", offset, dst);
             goto fail;
         }
     }
@@ -63,7 +63,7 @@
             /* XXX: Should we not even bother with EINTR? */
             if (errno == EINTR)
                 continue;
-            LOGE("Error (%d) while reading from '%s'", errno, src);
+            ALOGE("Error (%d) while reading from '%s'", errno, src);
             goto fail;
         }
 
@@ -84,7 +84,7 @@
                 /* XXX: Should we not even bother with EINTR? */
                 if (errno == EINTR)
                     continue;
-                LOGE("Error (%d) while writing to '%s'", errno, dst);
+                ALOGE("Error (%d) while writing to '%s'", errno, dst);
                 goto fail;
             }
             if (!tmp)
@@ -94,14 +94,14 @@
     }
 
     if (!done) {
-        LOGE("Exited read/write loop without setting flag! WTF?!");
+        ALOGE("Exited read/write loop without setting flag! WTF?!");
         goto fail;
     }
 
     if (dst_fd >= 0)
         fsync(dst_fd);
 
-    LOGI("Wrote %llu bytes to %s @ %lld", total, dst, offset);
+    ALOGI("Wrote %llu bytes to %s @ %lld", total, dst, offset);
 
     close(src_fd);
     if (dst_fd >= 0)
diff --git a/libdiskconfig/dump_diskconfig.c b/libdiskconfig/dump_diskconfig.c
index fff19f5..75256f6 100644
--- a/libdiskconfig/dump_diskconfig.c
+++ b/libdiskconfig/dump_diskconfig.c
@@ -28,7 +28,7 @@
     struct disk_info *dinfo;
 
     if (argc < 2) {
-        LOGE("usage: %s <conf file>", argv[0]);
+        ALOGE("usage: %s <conf file>", argv[0]);
         return 1;
     }
 
diff --git a/libdiskconfig/write_lst.c b/libdiskconfig/write_lst.c
index 12b7cd7..826ef7a 100644
--- a/libdiskconfig/write_lst.c
+++ b/libdiskconfig/write_lst.c
@@ -32,7 +32,7 @@
     struct write_list *item;
 
     if (!(item = malloc(sizeof(struct write_list) + data_len))) {
-        LOGE("Unable to allocate memory.");
+        ALOGE("Unable to allocate memory.");
         return NULL;
     }
 
@@ -71,18 +71,18 @@
 {
     for(; lst; lst = lst->next) {
         if (lseek64(fd, lst->offset, SEEK_SET) != (loff_t)lst->offset) {
-            LOGE("Cannot seek to the specified position (%lld).", lst->offset);
+            ALOGE("Cannot seek to the specified position (%lld).", lst->offset);
             goto fail;
         }
 
         if (!test) {
             if (write(fd, lst->data, lst->len) != (int)lst->len) {
-                LOGE("Failed writing %u bytes at position %lld.", lst->len,
+                ALOGE("Failed writing %u bytes at position %lld.", lst->len,
                      lst->offset);
                 goto fail;
             }
         } else
-            LOGI("Would write %d bytes @ offset %lld.", lst->len, lst->offset);
+            ALOGI("Would write %d bytes @ offset %lld.", lst->len, lst->offset);
     }
 
     return 0;
diff --git a/libnetutils/dhcpclient.c b/libnetutils/dhcpclient.c
index 4f2d1c1..b38e258 100644
--- a/libnetutils/dhcpclient.c
+++ b/libnetutils/dhcpclient.c
@@ -70,7 +70,7 @@
     vsnprintf(errmsg, sizeof(errmsg), fmt, ap);
     va_end(ap);
 
-    LOGD("%s", errmsg);
+    ALOGD("%s", errmsg);
 }
 
 const char *dhcp_lasterror()
@@ -151,14 +151,14 @@
 void dump_dhcp_info(dhcp_info *info)
 {
     char addr[20], gway[20], mask[20];
-    LOGD("--- dhcp %s (%d) ---",
+    ALOGD("--- dhcp %s (%d) ---",
             dhcp_type_to_name(info->type), info->type);
     strcpy(addr, ipaddr(info->ipaddr));
     strcpy(gway, ipaddr(info->gateway));
-    LOGD("ip %s gw %s prefixLength %d", addr, gway, info->prefixLength);
-    if (info->dns1) LOGD("dns1: %s", ipaddr(info->dns1));
-    if (info->dns2) LOGD("dns2: %s", ipaddr(info->dns2));
-    LOGD("server %s, lease %d seconds",
+    ALOGD("ip %s gw %s prefixLength %d", addr, gway, info->prefixLength);
+    if (info->dns1) ALOGD("dns1: %s", ipaddr(info->dns1));
+    if (info->dns2) ALOGD("dns2: %s", ipaddr(info->dns2));
+    ALOGD("server %s, lease %d seconds",
             ipaddr(info->serveraddr), info->lease);
 }
 
@@ -250,9 +250,9 @@
     const char *name;
     char buf[2048];
 
-    LOGD("===== DHCP message:");
+    ALOGD("===== DHCP message:");
     if (len < DHCP_MSG_FIXED_SIZE) {
-        LOGD("Invalid length %d, should be %d", len, DHCP_MSG_FIXED_SIZE);
+        ALOGD("Invalid length %d, should be %d", len, DHCP_MSG_FIXED_SIZE);
         return;
     }
 
@@ -264,18 +264,18 @@
         name = "BOOTREPLY";
     else
         name = "????";
-    LOGD("op = %s (%d), htype = %d, hlen = %d, hops = %d",
+    ALOGD("op = %s (%d), htype = %d, hlen = %d, hops = %d",
            name, msg->op, msg->htype, msg->hlen, msg->hops);
-    LOGD("xid = 0x%08x secs = %d, flags = 0x%04x optlen = %d",
+    ALOGD("xid = 0x%08x secs = %d, flags = 0x%04x optlen = %d",
            ntohl(msg->xid), ntohs(msg->secs), ntohs(msg->flags), len);
-    LOGD("ciaddr = %s", ipaddr(msg->ciaddr));
-    LOGD("yiaddr = %s", ipaddr(msg->yiaddr));
-    LOGD("siaddr = %s", ipaddr(msg->siaddr));
-    LOGD("giaddr = %s", ipaddr(msg->giaddr));
+    ALOGD("ciaddr = %s", ipaddr(msg->ciaddr));
+    ALOGD("yiaddr = %s", ipaddr(msg->yiaddr));
+    ALOGD("siaddr = %s", ipaddr(msg->siaddr));
+    ALOGD("giaddr = %s", ipaddr(msg->giaddr));
 
     c = msg->hlen > 16 ? 16 : msg->hlen;
     hex2str(buf, msg->chaddr, c);
-    LOGD("chaddr = {%s}", buf);
+    ALOGD("chaddr = {%s}", buf);
 
     for (n = 0; n < 64; n++) {
         if ((msg->sname[n] < ' ') || (msg->sname[n] > 127)) {
@@ -293,8 +293,8 @@
     }
     msg->file[127] = 0;
 
-    LOGD("sname = '%s'", msg->sname);
-    LOGD("file = '%s'", msg->file);
+    ALOGD("sname = '%s'", msg->sname);
+    ALOGD("file = '%s'", msg->file);
 
     if (len < 4) return;
     len -= 4;
@@ -327,7 +327,7 @@
             name = dhcp_type_to_name(x[2]);
         else
             name = NULL;
-        LOGD("op %d len %d {%s} %s", x[0], optsz, buf, name == NULL ? "" : name);
+        ALOGD("op %d len %d {%s} %s", x[0], optsz, buf, name == NULL ? "" : name);
         len -= optsz;
         x = x + optsz + 2;
     }
@@ -347,28 +347,28 @@
 static int is_valid_reply(dhcp_msg *msg, dhcp_msg *reply, int sz)
 {
     if (sz < DHCP_MSG_FIXED_SIZE) {
-        if (verbose) LOGD("netcfg: Wrong size %d != %d\n", sz, DHCP_MSG_FIXED_SIZE);
+        if (verbose) ALOGD("netcfg: Wrong size %d != %d\n", sz, DHCP_MSG_FIXED_SIZE);
         return 0;
     }
     if (reply->op != OP_BOOTREPLY) {
-        if (verbose) LOGD("netcfg: Wrong Op %d != %d\n", reply->op, OP_BOOTREPLY);
+        if (verbose) ALOGD("netcfg: Wrong Op %d != %d\n", reply->op, OP_BOOTREPLY);
         return 0;
     }
     if (reply->xid != msg->xid) {
-        if (verbose) LOGD("netcfg: Wrong Xid 0x%x != 0x%x\n", ntohl(reply->xid),
+        if (verbose) ALOGD("netcfg: Wrong Xid 0x%x != 0x%x\n", ntohl(reply->xid),
                           ntohl(msg->xid));
         return 0;
     }
     if (reply->htype != msg->htype) {
-        if (verbose) LOGD("netcfg: Wrong Htype %d != %d\n", reply->htype, msg->htype);
+        if (verbose) ALOGD("netcfg: Wrong Htype %d != %d\n", reply->htype, msg->htype);
         return 0;
     }
     if (reply->hlen != msg->hlen) {
-        if (verbose) LOGD("netcfg: Wrong Hlen %d != %d\n", reply->hlen, msg->hlen);
+        if (verbose) ALOGD("netcfg: Wrong Hlen %d != %d\n", reply->hlen, msg->hlen);
         return 0;
     }
     if (memcmp(msg->chaddr, reply->chaddr, msg->hlen)) {
-        if (verbose) LOGD("netcfg: Wrong chaddr %x != %x\n", *(reply->chaddr),*(msg->chaddr));
+        if (verbose) ALOGD("netcfg: Wrong chaddr %x != %x\n", *(reply->chaddr),*(msg->chaddr));
         return 0;
     }
     return 1;
@@ -469,7 +469,7 @@
         r = receive_packet(s, &reply);
         if (r < 0) {
             if (errno != 0) {
-                LOGD("receive_packet failed (%d): %s", r, strerror(errno));
+                ALOGD("receive_packet failed (%d): %s", r, strerror(errno));
                 if (errno == ENETDOWN || errno == ENXIO) {
                     return -1;
                 }
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index 0a2f760..186b98c 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -46,8 +46,8 @@
 #else
 #include <stdio.h>
 #include <string.h>
-#define LOGD printf
-#define LOGW printf
+#define ALOGD printf
+#define ALOGW printf
 #endif
 
 static int ifc_ctl_sock = -1;
@@ -382,7 +382,7 @@
 
         ret = ifc_del_address(ifname, addrstr, prefixlen);
         if (ret) {
-            LOGE("Deleting address %s/%d on %s: %s", addrstr, prefixlen, ifname,
+            ALOGE("Deleting address %s/%d on %s: %s", addrstr, prefixlen, ifname,
                  strerror(-ret));
             lasterror = ret;
         }
@@ -686,7 +686,7 @@
         init_sockaddr_in(&rt.rt_genmask, mask);
         addr.s_addr = dest;
         if (ioctl(ifc_ctl_sock, SIOCDELRT, &rt) < 0) {
-            LOGD("failed to remove route for %s to %s: %s",
+            ALOGD("failed to remove route for %s to %s: %s",
                  ifname, inet_ntoa(addr), strerror(errno));
         }
     }
@@ -752,7 +752,7 @@
     ifc_init();
     addr.s_addr = gateway;
     if ((result = ifc_create_default_route(ifname, gateway)) < 0) {
-        LOGD("failed to add %s as default route for %s: %s",
+        ALOGD("failed to add %s as default route for %s: %s",
              inet_ntoa(addr), ifname, strerror(errno));
     }
     ifc_close();
@@ -773,7 +773,7 @@
     rt.rt_flags = RTF_UP|RTF_GATEWAY;
     init_sockaddr_in(&rt.rt_dst, 0);
     if ((result = ioctl(ifc_ctl_sock, SIOCDELRT, &rt)) < 0) {
-        LOGD("failed to remove default route for %s: %s", ifname, strerror(errno));
+        ALOGD("failed to remove default route for %s: %s", ifname, strerror(errno));
     }
     ifc_close();
     return result;
diff --git a/libnetutils/packet.c b/libnetutils/packet.c
index 9388345..3ec83fe 100644
--- a/libnetutils/packet.c
+++ b/libnetutils/packet.c
@@ -31,8 +31,8 @@
 #else
 #include <stdio.h>
 #include <string.h>
-#define LOGD printf
-#define LOGW printf
+#define ALOGD printf
+#define ALOGW printf
 #endif
 
 #include "dhcpmsg.h"
@@ -179,23 +179,23 @@
     is_valid = 0;
     if (nread < (int)(sizeof(struct iphdr) + sizeof(struct udphdr))) {
 #if VERBOSE
-        LOGD("Packet is too small (%d) to be a UDP datagram", nread);
+        ALOGD("Packet is too small (%d) to be a UDP datagram", nread);
 #endif
     } else if (packet.ip.version != IPVERSION || packet.ip.ihl != (sizeof(packet.ip) >> 2)) {
 #if VERBOSE
-        LOGD("Not a valid IP packet");
+        ALOGD("Not a valid IP packet");
 #endif
     } else if (nread < ntohs(packet.ip.tot_len)) {
 #if VERBOSE
-        LOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len));
+        ALOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len));
 #endif
     } else if (packet.ip.protocol != IPPROTO_UDP) {
 #if VERBOSE
-        LOGD("IP protocol (%d) is not UDP", packet.ip.protocol);
+        ALOGD("IP protocol (%d) is not UDP", packet.ip.protocol);
 #endif
     } else if (packet.udp.dest != htons(PORT_BOOTP_CLIENT)) {
 #if VERBOSE
-        LOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest));
+        ALOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest));
 #endif
     } else {
         is_valid = 1;
@@ -209,7 +209,7 @@
     /* validate IP header checksum */
     sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0));
     if (sum != 0) {
-        LOGW("IP header checksum failure (0x%x)", packet.ip.check);
+        ALOGW("IP header checksum failure (0x%x)", packet.ip.check);
         return -1;
     }
     /*
@@ -231,7 +231,7 @@
     sum = finish_sum(checksum(&packet, nread, 0));
     packet.udp.check = temp;
     if (temp != sum) {
-        LOGW("UDP header checksum failure (0x%x should be 0x%x)", sum, temp);
+        ALOGW("UDP header checksum failure (0x%x should be 0x%x)", sum, temp);
         return -1;
     }
     memcpy(msg, &packet.dhcp, dhcp_size);
diff --git a/libpixelflinger/codeflinger/ARMAssembler.cpp b/libpixelflinger/codeflinger/ARMAssembler.cpp
index 4726a08..0dc5037 100644
--- a/libpixelflinger/codeflinger/ARMAssembler.cpp
+++ b/libpixelflinger/codeflinger/ARMAssembler.cpp
@@ -177,7 +177,7 @@
     // the instruction cache is flushed by CodeCache
     const int64_t duration = ggl_system_time() - mDuration;
     const char * const format = "generated %s (%d ins) at [%p:%p] in %lld ns\n";
-    LOGI(format, name, int(pc()-base()), base(), pc(), duration);
+    ALOGI(format, name, int(pc()-base()), base(), pc(), duration);
 
 #if defined(WITH_LIB_HARDWARE)
     if (__builtin_expect(mQemuTracing, 0)) {
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp
index 125c3ce..a713feb 100644
--- a/libpixelflinger/codeflinger/CodeCache.cpp
+++ b/libpixelflinger/codeflinger/CodeCache.cpp
@@ -159,7 +159,7 @@
         const long base = long(assembly->base());
         const long curr = base + long(assembly->size());
         err = cacheflush(base, curr, 0);
-        LOGE_IF(err, "__ARM_NR_cacheflush error %s\n",
+        ALOGE_IF(err, "__ARM_NR_cacheflush error %s\n",
                 strerror(errno));
 #endif
     }
diff --git a/libpixelflinger/codeflinger/GGLAssembler.cpp b/libpixelflinger/codeflinger/GGLAssembler.cpp
index 1cd189c..f1d81b2 100644
--- a/libpixelflinger/codeflinger/GGLAssembler.cpp
+++ b/libpixelflinger/codeflinger/GGLAssembler.cpp
@@ -82,7 +82,7 @@
             needs.p, needs.n, needs.t[0], needs.t[1], per_fragment_ops);
 
     if (err) {
-        LOGE("Error while generating ""%s""\n", name);
+        ALOGE("Error while generating ""%s""\n", name);
         disassemble(name);
         return -1;
     }
@@ -1095,7 +1095,7 @@
     }
     // this is not an error anymore because, we'll try again with
     // a lower optimization level.
-    //LOGE_IF(i >= nbreg, "pixelflinger ran out of registers\n");
+    //ALOGE_IF(i >= nbreg, "pixelflinger ran out of registers\n");
     if (i >= nbreg) {
         mStatus |= OUT_OF_REGISTERS;
         // we return SP so we can more easily debug things
diff --git a/libpixelflinger/codeflinger/blending.cpp b/libpixelflinger/codeflinger/blending.cpp
index 083042c..c90eaa0 100644
--- a/libpixelflinger/codeflinger/blending.cpp
+++ b/libpixelflinger/codeflinger/blending.cpp
@@ -536,7 +536,7 @@
         }
     }
 
-    LOGE_IF(ms>=32, "mul_factor overflow vs=%d, fs=%d", vs, fs);
+    ALOGE_IF(ms>=32, "mul_factor overflow vs=%d, fs=%d", vs, fs);
 
     int vreg = v.reg;
     int freg = f.reg;
@@ -574,7 +574,7 @@
     int as = a.h;
     int ms = vs+fs;
 
-    LOGE_IF(ms>=32, "mul_factor_add overflow vs=%d, fs=%d, as=%d", vs, fs, as);
+    ALOGE_IF(ms>=32, "mul_factor_add overflow vs=%d, fs=%d, as=%d", vs, fs, as);
 
     integer_t add(a.reg, a.h, a.flags);
 
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp
index ed20a00..62aa05c 100644
--- a/libpixelflinger/codeflinger/load_store.cpp
+++ b/libpixelflinger/codeflinger/load_store.cpp
@@ -257,7 +257,7 @@
     int dbits = dh - dl;
     int dithering = 0;
     
-    LOGE_IF(sbits<dbits, "sbits (%d) < dbits (%d) in downshift", sbits, dbits);
+    ALOGE_IF(sbits<dbits, "sbits (%d) < dbits (%d) in downshift", sbits, dbits);
 
     if (sbits>dbits) {
         // see if we need to dither
diff --git a/libpixelflinger/codeflinger/texturing.cpp b/libpixelflinger/codeflinger/texturing.cpp
index 7f6f8da..8464fbd 100644
--- a/libpixelflinger/codeflinger/texturing.cpp
+++ b/libpixelflinger/codeflinger/texturing.cpp
@@ -778,7 +778,7 @@
             break;
         default:
             // unsupported format, do something sensical...
-            LOGE("Unsupported 16-bits texture format (%d)", tmu.format_idx);
+            ALOGE("Unsupported 16-bits texture format (%d)", tmu.format_idx);
             LDRH(AL, texel.reg, txPtr.reg);
             return;
     }
diff --git a/libpixelflinger/scanline.cpp b/libpixelflinger/scanline.cpp
index a37b47e..93440f5 100644
--- a/libpixelflinger/scanline.cpp
+++ b/libpixelflinger/scanline.cpp
@@ -351,7 +351,7 @@
     }
 
 #if DEBUG_NEEDS
-    LOGI("Needs: n=0x%08x p=0x%08x t0=0x%08x t1=0x%08x",
+    ALOGI("Needs: n=0x%08x p=0x%08x t0=0x%08x t1=0x%08x",
          c->state.needs.n, c->state.needs.p,
          c->state.needs.t[0], c->state.needs.t[1]);
 #endif
@@ -381,7 +381,7 @@
             err = gCodeCache.cache(a->key(), a);
         }
         if (ggl_unlikely(err)) {
-            LOGE("error generating or caching assembly. Reverting to NOP.");
+            ALOGE("error generating or caching assembly. Reverting to NOP.");
             c->scanline = scanline_noop;
             c->init_y = init_y_noop;
             c->step_y = step_y__nop;
@@ -395,12 +395,12 @@
         c->scanline_as->decStrong(c);
     }
 
-    //LOGI("using generated pixel-pipeline");
+    //ALOGI("using generated pixel-pipeline");
     c->scanline_as = assembly.get();
     c->scanline_as->incStrong(c); //  hold on to assembly
     c->scanline = (void(*)(context_t* c))assembly->base();
 #else
-//    LOGW("using generic (slow) pixel-pipeline");
+//    ALOGW("using generic (slow) pixel-pipeline");
     c->scanline = scanline;
 #endif
 }
@@ -1761,7 +1761,7 @@
     // woooops, shoud never happen,
     // fail gracefully (don't display anything)
     init_y_noop(c, y0);
-    LOGE("color-buffer has an invalid format!");
+    ALOGE("color-buffer has an invalid format!");
 }
 
 // ----------------------------------------------------------------------------
diff --git a/libpixelflinger/tinyutils/VectorImpl.cpp b/libpixelflinger/tinyutils/VectorImpl.cpp
index a049706..05c4945 100644
--- a/libpixelflinger/tinyutils/VectorImpl.cpp
+++ b/libpixelflinger/tinyutils/VectorImpl.cpp
@@ -57,7 +57,7 @@
 
 VectorImpl::~VectorImpl()
 {
-    LOG_ASSERT(!mCount,
+    ALOG_ASSERT(!mCount,
         "[%p] "
         "subclasses of VectorImpl must call finish_vector()"
         " in their destructor. Leaking %d bytes.",
@@ -67,7 +67,7 @@
 
 VectorImpl& VectorImpl::operator = (const VectorImpl& rhs)
 {
-    LOG_ASSERT(mItemSize == rhs.mItemSize,
+    ALOG_ASSERT(mItemSize == rhs.mItemSize,
         "Vector<> have different types (this=%p, rhs=%p)", this, &rhs);
     if (this != &rhs) {
         release_storage();
@@ -176,7 +176,7 @@
 
 ssize_t VectorImpl::replaceAt(const void* prototype, size_t index)
 {
-    LOG_ASSERT(index<size(),
+    ALOG_ASSERT(index<size(),
         "[%p] replace: index=%d, size=%d", this, (int)index, (int)size());
 
     void* item = editItemLocation(index);
@@ -193,7 +193,7 @@
 
 ssize_t VectorImpl::removeItemsAt(size_t index, size_t count)
 {
-    LOG_ASSERT((index+count)<=size(),
+    ALOG_ASSERT((index+count)<=size(),
         "[%p] remove: index=%d, count=%d, size=%d",
                this, (int)index, (int)count, (int)size());
 
@@ -217,7 +217,7 @@
 
 void* VectorImpl::editItemLocation(size_t index)
 {
-    LOG_ASSERT(index<capacity(),
+    ALOG_ASSERT(index<capacity(),
         "[%p] itemLocation: index=%d, capacity=%d, count=%d",
         this, (int)index, (int)capacity(), (int)mCount);
             
@@ -229,7 +229,7 @@
 
 const void* VectorImpl::itemLocation(size_t index) const
 {
-    LOG_ASSERT(index<capacity(),
+    ALOG_ASSERT(index<capacity(),
         "[%p] editItemLocation: index=%d, capacity=%d, count=%d",
         this, (int)index, (int)capacity(), (int)mCount);
 
@@ -272,7 +272,7 @@
 
 void* VectorImpl::_grow(size_t where, size_t amount)
 {
-//    LOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
+//    ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
 //        this, (int)where, (int)amount, (int)mCount, (int)capacity());
 
     if (where > mCount)
@@ -281,7 +281,7 @@
     const size_t new_size = mCount + amount;
     if (capacity() < new_size) {
         const size_t new_capacity = max(kMinVectorCapacity, ((new_size*3)+1)/2);
-//        LOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity);
+//        ALOGV("grow vector %p, new_capacity=%d", this, (int)new_capacity);
         if ((mStorage) &&
             (mCount==where) &&
             (mFlags & HAS_TRIVIAL_COPY) &&
@@ -325,7 +325,7 @@
     if (!mStorage)
         return;
 
-//    LOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
+//    ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d",
 //        this, (int)where, (int)amount, (int)mCount, (int)capacity());
 
     if (where >= mCount)
@@ -334,7 +334,7 @@
     const size_t new_size = mCount - amount;
     if (new_size*3 < capacity()) {
         const size_t new_capacity = max(kMinVectorCapacity, new_size*2);
-//        LOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity);
+//        ALOGV("shrink vector %p, new_capacity=%d", this, (int)new_capacity);
         if ((where == mCount-amount) &&
             (mFlags & HAS_TRIVIAL_COPY) &&
             (mFlags & HAS_TRIVIAL_DTOR))
diff --git a/libpixelflinger/trap.cpp b/libpixelflinger/trap.cpp
index 30b633f..80efeff 100644
--- a/libpixelflinger/trap.cpp
+++ b/libpixelflinger/trap.cpp
@@ -94,15 +94,15 @@
 static void
 triangle_dump_points( const GGLcoord*  v0,
                       const GGLcoord*  v1,
-				 	  const GGLcoord*  v2 )
+                      const GGLcoord*  v2 )
 {
     float tri = 1.0f / TRI_ONE;
-  LOGD(     "  P0=(%.3f, %.3f)  [%08x, %08x]\n"
-            "  P1=(%.3f, %.3f)  [%08x, %08x]\n"
-            "  P2=(%.3f, %.3f)  [%08x, %08x]\n",
-		v0[0]*tri, v0[1]*tri, v0[0], v0[1],
-		v1[0]*tri, v1[1]*tri, v1[0], v1[1],
-		v2[0]*tri, v2[1]*tri, v2[0], v2[1] );
+    ALOGD("  P0=(%.3f, %.3f)  [%08x, %08x]\n"
+          "  P1=(%.3f, %.3f)  [%08x, %08x]\n"
+          "  P2=(%.3f, %.3f)  [%08x, %08x]\n",
+          v0[0]*tri, v0[1]*tri, v0[0], v0[1],
+          v1[0]*tri, v1[1]*tri, v1[0], v1[1],
+          v2[0]*tri, v2[1]*tri, v2[0], v2[1] );
 }
 
 // ----------------------------------------------------------------------------
@@ -639,7 +639,7 @@
 static void
 edge_dump( Edge*  edge )
 {
-  LOGI( "  top=%d (%.3f)  bot=%d (%.3f)  x=%d (%.3f)  ix=%d (%.3f)",
+  ALOGI( "  top=%d (%.3f)  bot=%d (%.3f)  x=%d (%.3f)  ix=%d (%.3f)",
         edge->y_top, edge->y_top/float(TRI_ONE),
 		edge->y_bot, edge->y_bot/float(TRI_ONE),
 		edge->x, edge->x/float(FIXED_ONE),
@@ -650,7 +650,7 @@
 triangle_dump_edges( Edge*  edges,
                      int            count )
 { 
-    LOGI( "%d edge%s:\n", count, count == 1 ? "" : "s" );
+    ALOGI( "%d edge%s:\n", count, count == 1 ? "" : "s" );
 	for ( ; count > 0; count--, edges++ )
 	  edge_dump( edges );
 }
@@ -835,7 +835,7 @@
     float tri  = 1.0f / TRI_ONE;
     float iter = 1.0f / (1<<TRI_ITERATORS_BITS);
     float fix  = 1.0f / FIXED_ONE;
-    LOGD(   "x=%08x (%.3f), "
+    ALOGD(   "x=%08x (%.3f), "
             "x_incr=%08x (%.3f), y_incr=%08x (%.3f), "
             "y_top=%08x (%.3f), y_bot=%08x (%.3f) ",
         x, x*fix,
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c
index b1c967d..5d261cd 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -20,7 +20,7 @@
 #ifdef USE_LIBLOG
 #define LOG_TAG "usbhost"
 #include "utils/Log.h"
-#define D LOGD
+#define D ALOGD
 #else
 #define D printf
 #endif
diff --git a/logwrapper/logwrapper.c b/logwrapper/logwrapper.c
index bdf53e8..6a80560 100644
--- a/logwrapper/logwrapper.c
+++ b/logwrapper/logwrapper.c
@@ -28,7 +28,7 @@
 
 void fatal(const char *msg) {
     fprintf(stderr, "%s", msg);
-    LOG(LOG_ERROR, "logwrapper", "%s", msg);
+    ALOG(LOG_ERROR, "logwrapper", "%s", msg);
     exit(-1);
 }
 
@@ -60,7 +60,7 @@
                 buffer[b] = '\0';
             } else if (buffer[b] == '\n') {
                 buffer[b] = '\0';
-                LOG(LOG_INFO, tag, "%s", &buffer[a]);
+                ALOG(LOG_INFO, tag, "%s", &buffer[a]);
                 a = b + 1;
             }
         }
@@ -68,7 +68,7 @@
         if (a == 0 && b == sizeof(buffer) - 1) {
             // buffer is full, flush
             buffer[b] = '\0';
-            LOG(LOG_INFO, tag, "%s", &buffer[a]);
+            ALOG(LOG_INFO, tag, "%s", &buffer[a]);
             b = 0;
         } else if (a != b) {
             // Keep left-overs
@@ -84,21 +84,21 @@
     // Flush remaining data
     if (a != b) {
         buffer[b] = '\0';
-	LOG(LOG_INFO, tag, "%s", &buffer[a]);
+        ALOG(LOG_INFO, tag, "%s", &buffer[a]);
     }
     status = 0xAAAA;
     if (wait(&status) != -1) {  // Wait for child
         if (WIFEXITED(status))
-            LOG(LOG_INFO, "logwrapper", "%s terminated by exit(%d)", tag,
+            ALOG(LOG_INFO, "logwrapper", "%s terminated by exit(%d)", tag,
                     WEXITSTATUS(status));
         else if (WIFSIGNALED(status))
-            LOG(LOG_INFO, "logwrapper", "%s terminated by signal %d", tag,
+            ALOG(LOG_INFO, "logwrapper", "%s terminated by signal %d", tag,
                     WTERMSIG(status));
         else if (WIFSTOPPED(status))
-            LOG(LOG_INFO, "logwrapper", "%s stopped by signal %d", tag,
+            ALOG(LOG_INFO, "logwrapper", "%s stopped by signal %d", tag,
                     WSTOPSIG(status));
     } else
-        LOG(LOG_INFO, "logwrapper", "%s wait() failed: %s (%d)", tag,
+        ALOG(LOG_INFO, "logwrapper", "%s wait() failed: %s (%d)", tag,
                 strerror(errno), errno);
     if (seg_fault_on_exit)
         *(int *)status = 0;  // causes SIGSEGV with fault_address = status
@@ -111,7 +111,7 @@
     argv_child[argc] = NULL;
 
     if (execvp(argv_child[0], argv_child)) {
-        LOG(LOG_ERROR, "logwrapper",
+        ALOG(LOG_ERROR, "logwrapper",
             "executing %s failed: %s\n", argv_child[0], strerror(errno));
         exit(-1);
     }
diff --git a/nexus/CommandListener.cpp b/nexus/CommandListener.cpp
index 5973ff5..7c934a7 100644
--- a/nexus/CommandListener.cpp
+++ b/nexus/CommandListener.cpp
@@ -213,12 +213,12 @@
         if (!NetworkManager::Instance()->getPropMngr()->get((*it),
                                                             p_v,
                                                             sizeof(p_v))) {
-            LOGW("Failed to get %s (%s)", (*it), strerror(errno));
+            ALOGW("Failed to get %s (%s)", (*it), strerror(errno));
         }
 
         char *buf;
         if (asprintf(&buf, "%s %s", (*it), p_v) < 0) {
-            LOGE("Failed to allocate memory");
+            ALOGE("Failed to allocate memory");
             free((*it));
             continue;
         }
diff --git a/nexus/Controller.cpp b/nexus/Controller.cpp
index f6a2436..dae8783 100644
--- a/nexus/Controller.cpp
+++ b/nexus/Controller.cpp
@@ -86,7 +86,7 @@
     }
 
     if (rc != 0) {
-        LOGW("Unable to unload kernel driver '%s' (%s)", modtag,
+        ALOGW("Unable to unload kernel driver '%s' (%s)", modtag,
              strerror(errno));
     }
     return rc;
@@ -96,7 +96,7 @@
     FILE *fp = fopen("/proc/modules", "r");
 
     if (!fp) {
-        LOGE("Unable to open /proc/modules (%s)", strerror(errno));
+        ALOGE("Unable to open /proc/modules (%s)", strerror(errno));
         return false;
     }
 
@@ -105,7 +105,7 @@
         char *endTag = strchr(line, ' ');
 
         if (!endTag) {
-            LOGW("Unable to find tag for line '%s'", line);
+            ALOGW("Unable to find tag for line '%s'", line);
             continue;
         }
         if (!strncmp(line, modtag, (endTag - line))) {
diff --git a/nexus/DhcpClient.cpp b/nexus/DhcpClient.cpp
index 713059d..81fdf47 100644
--- a/nexus/DhcpClient.cpp
+++ b/nexus/DhcpClient.cpp
@@ -53,7 +53,7 @@
 }
 
 int DhcpClient::start(Controller *c) {
-    LOGD("Starting DHCP service (arp probe = %d)", mDoArpProbe);
+    ALOGD("Starting DHCP service (arp probe = %d)", mDoArpProbe);
     char svc[PROPERTY_VALUE_MAX];
     snprintf(svc,
              sizeof(svc),
@@ -72,7 +72,7 @@
 
     sockaddr_in addr;
     if ((mListenerSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
-        LOGE("Failed to create DHCP listener socket");
+        ALOGE("Failed to create DHCP listener socket");
         pthread_mutex_unlock(&mLock);
         return -1;
     }
@@ -82,7 +82,7 @@
     addr.sin_port = htons(DhcpClient::STATUS_MONITOR_PORT);
 
     if (bind(mListenerSocket, (struct sockaddr *) &addr, sizeof(addr))) {
-        LOGE("Failed to bind DHCP listener socket");
+        ALOGE("Failed to bind DHCP listener socket");
         close(mListenerSocket);
         mListenerSocket = -1;
         pthread_mutex_unlock(&mLock);
@@ -90,14 +90,14 @@
     }
 
     if (mServiceManager->start(svc)) {
-        LOGE("Failed to start dhcp service");
+        ALOGE("Failed to start dhcp service");
         pthread_mutex_unlock(&mLock);
         return -1;
     }
 
     mListener = new DhcpListener(mController, mListenerSocket, mHandlers);
     if (mListener->startListener()) {
-        LOGE("Failed to start listener");
+        ALOGE("Failed to start listener");
 #if 0
         mServiceManager->stop("dhcpcd");
         return -1;
@@ -126,7 +126,7 @@
     close(mListenerSocket);
 
     if (mServiceManager->stop("dhcpcd")) {
-        LOGW("Failed to stop DHCP service (%s)", strerror(errno));
+        ALOGW("Failed to stop DHCP service (%s)", strerror(errno));
         // XXX: Kill it the hard way.. but its gotta go!
     }
 
diff --git a/nexus/DhcpEvent.cpp b/nexus/DhcpEvent.cpp
index 58893f4..2f1ce6f 100644
--- a/nexus/DhcpEvent.cpp
+++ b/nexus/DhcpEvent.cpp
@@ -50,7 +50,7 @@
     else if (!strcasecmp(buffer, "TIMEOUT"))
         return DhcpEvent::TIMEOUT;
     else {
-        LOGW("Bad event '%s'", buffer);
+        ALOGW("Bad event '%s'", buffer);
         return -1;
     }
 }
diff --git a/nexus/DhcpListener.cpp b/nexus/DhcpListener.cpp
index afa68eb..16c369b 100644
--- a/nexus/DhcpListener.cpp
+++ b/nexus/DhcpListener.cpp
@@ -42,7 +42,7 @@
     int rc;
 
     if ((rc = read(cli->getSocket(), buffer, sizeof(buffer))) < 0) {
-        LOGW("Error reading dhcp status msg (%s)", strerror(errno));
+        ALOGW("Error reading dhcp status msg (%s)", strerror(errno));
         return true;
     }
 
@@ -53,7 +53,7 @@
 
         for (i = 0; i < 2; i++) {
             if (!(tmp = strsep(&next, ":"))) {
-                LOGW("Error parsing state '%s'", buffer);
+                ALOGW("Error parsing state '%s'", buffer);
                 return true;
             }
         }
@@ -65,22 +65,22 @@
 	struct in_addr ipaddr, netmask, gateway, broadcast, dns1, dns2;
 
         if (!inet_aton(strsep(&next, ":"), &ipaddr)) {
-            LOGW("Malformatted IP specified");
+            ALOGW("Malformatted IP specified");
         }
         if (!inet_aton(strsep(&next, ":"), &netmask)) {
-            LOGW("Malformatted netmask specified");
+            ALOGW("Malformatted netmask specified");
         }
         if (!inet_aton(strsep(&next, ":"), &broadcast)) {
-            LOGW("Malformatted broadcast specified");
+            ALOGW("Malformatted broadcast specified");
         }
         if (!inet_aton(strsep(&next, ":"), &gateway)) {
-            LOGW("Malformatted gateway specified");
+            ALOGW("Malformatted gateway specified");
         }
         if (!inet_aton(strsep(&next, ":"), &dns1)) {
-            LOGW("Malformatted dns1 specified");
+            ALOGW("Malformatted dns1 specified");
         }
         if (!inet_aton(strsep(&next, ":"), &dns2)) {
-            LOGW("Malformatted dns2 specified");
+            ALOGW("Malformatted dns2 specified");
         }
         mHandlers->onDhcpLeaseUpdated(mController, &ipaddr, &netmask,
                                       &broadcast, &gateway, &dns1, &dns2);
@@ -92,7 +92,7 @@
 
         for (i = 0; i < 2; i++) {
             if (!(tmp = strsep(&next, ":"))) {
-                LOGW("Error parsing event '%s'", buffer);
+                ALOGW("Error parsing event '%s'", buffer);
                 return true;
             }
         }
@@ -101,7 +101,7 @@
         mHandlers->onDhcpEvent(mController, ev);
   
     } else {
-        LOGW("Unknown DHCP monitor msg '%s'", buffer);
+        ALOGW("Unknown DHCP monitor msg '%s'", buffer);
     }
 
     return true;
diff --git a/nexus/DhcpState.cpp b/nexus/DhcpState.cpp
index c9d5135..b86c186 100644
--- a/nexus/DhcpState.cpp
+++ b/nexus/DhcpState.cpp
@@ -74,7 +74,7 @@
     else if (!strcasecmp(buffer, "ANNOUNCING"))
         return DhcpState::ANNOUNCING;
     else {
-        LOGW("Bad state '%s'", buffer);
+        ALOGW("Bad state '%s'", buffer);
         return -1;
     }
 }
diff --git a/nexus/NetworkManager.cpp b/nexus/NetworkManager.cpp
index e0df409..d4285bf 100644
--- a/nexus/NetworkManager.cpp
+++ b/nexus/NetworkManager.cpp
@@ -49,7 +49,7 @@
 
 int NetworkManager::run() {
     if (startControllers()) {
-        LOGW("Unable to start all controllers (%s)", strerror(errno));
+        ALOGW("Unable to start all controllers (%s)", strerror(errno));
     }
     return 0;
 }
@@ -107,29 +107,29 @@
 }
 
 void NetworkManager::onInterfaceConnected(Controller *c) {
-    LOGD("Controller %s interface %s connected", c->getName(), c->getBoundInterface());
+    ALOGD("Controller %s interface %s connected", c->getName(), c->getBoundInterface());
 
     if (mDhcp->start(c)) {
-        LOGE("Failed to start DHCP (%s)", strerror(errno));
+        ALOGE("Failed to start DHCP (%s)", strerror(errno));
         return;
     }
 }
 
 void NetworkManager::onInterfaceDisconnected(Controller *c) {
-    LOGD("Controller %s interface %s disconnected", c->getName(),
+    ALOGD("Controller %s interface %s disconnected", c->getName(),
          c->getBoundInterface());
 
     mDhcp->stop();
 }
 
 void NetworkManager::onControllerSuspending(Controller *c) {
-    LOGD("Controller %s interface %s suspending", c->getName(),
+    ALOGD("Controller %s interface %s suspending", c->getName(),
          c->getBoundInterface());
     mDhcp->stop();
 }
 
 void NetworkManager::onControllerResumed(Controller *c) {
-    LOGD("Controller %s interface %s resumed", c->getName(),
+    ALOGD("Controller %s interface %s resumed", c->getName(),
          c->getBoundInterface());
 }
 
@@ -137,7 +137,7 @@
     char tmp[255];
     char tmp2[255];
 
-    LOGD("onDhcpStateChanged(%s -> %s)",
+    ALOGD("onDhcpStateChanged(%s -> %s)",
          DhcpState::toString(mLastDhcpState, tmp, sizeof(tmp)),
          DhcpState::toString(state, tmp2, sizeof(tmp2)));
 
@@ -169,7 +169,7 @@
 
 void NetworkManager::onDhcpEvent(Controller *c, int evt) {
     char tmp[64];
-    LOGD("onDhcpEvent(%s)", DhcpEvent::toString(evt, tmp, sizeof(tmp)));
+    ALOGD("onDhcpEvent(%s)", DhcpEvent::toString(evt, tmp, sizeof(tmp)));
 }
 
 void NetworkManager::onDhcpLeaseUpdated(Controller *c, struct in_addr *addr,
diff --git a/nexus/OpenVpnController.cpp b/nexus/OpenVpnController.cpp
index f1ea510..6b6d892 100644
--- a/nexus/OpenVpnController.cpp
+++ b/nexus/OpenVpnController.cpp
@@ -53,7 +53,7 @@
     char tmp[64];
 
     if (!mPropMngr->get("vpn.gateway", tmp, sizeof(tmp))) {
-        LOGE("Error reading property 'vpn.gateway' (%s)", strerror(errno));
+        ALOGE("Error reading property 'vpn.gateway' (%s)", strerror(errno));
         return -1;
     }
     snprintf(svc, sizeof(svc), "openvpn:--remote %s 1194", tmp);
diff --git a/nexus/Property.cpp b/nexus/Property.cpp
index d02769d..6cfa955 100644
--- a/nexus/Property.cpp
+++ b/nexus/Property.cpp
@@ -30,7 +30,7 @@
           mName(name), mReadOnly(readOnly), mType(type),
           mNumElements(numElements) {
     if (index(name, '.')) {
-        LOGW("Property name %s violates namespace rules", name);
+        ALOGW("Property name %s violates namespace rules", name);
     }
 }
 
@@ -38,22 +38,22 @@
                 Property(name, ro, Property::Type_STRING, elements) {
 }
 int StringProperty::set(int idx, int value) {
-    LOGE("Integer 'set' called on string property!");
+    ALOGE("Integer 'set' called on string property!");
     errno = EINVAL;
     return -1;
 }
 int StringProperty::set(int idx, struct in_addr *value) {
-    LOGE("IpAddr 'set' called on string property!");
+    ALOGE("IpAddr 'set' called on string property!");
     errno = EINVAL;
     return -1;
 }
 int StringProperty::get(int idx, int *buffer) {
-    LOGE("Integer 'get' called on string property!");
+    ALOGE("Integer 'get' called on string property!");
     errno = EINVAL;
     return -1;
 }
 int StringProperty::get(int idx, struct in_addr *buffer) {
-    LOGE("IpAddr 'get' called on string property!");
+    ALOGE("IpAddr 'get' called on string property!");
     errno = EINVAL;
     return -1;
 }
@@ -67,7 +67,7 @@
 
 int StringPropertyHelper::set(int idx, const char *value) {
     if (idx != 0) {
-        LOGW("Attempt to use array index on StringPropertyHelper::set");
+        ALOGW("Attempt to use array index on StringPropertyHelper::set");
         errno = EINVAL;
         return -1;
     }
@@ -77,7 +77,7 @@
 
 int StringPropertyHelper::get(int idx, char *buffer, size_t max) {
     if (idx != 0) {
-        LOGW("Attempt to use array index on StringPropertyHelper::get");
+        ALOGW("Attempt to use array index on StringPropertyHelper::get");
         errno = EINVAL;
         return -1;
     }
@@ -90,22 +90,22 @@
 }
 
 int IntegerProperty::set(int idx, const char *value) {
-    LOGE("String 'set' called on integer property!");
+    ALOGE("String 'set' called on integer property!");
     errno = EINVAL;
     return -1;
 }
 int IntegerProperty::set(int idx, struct in_addr *value) {
-    LOGE("IpAddr 'set' called on integer property!");
+    ALOGE("IpAddr 'set' called on integer property!");
     errno = EINVAL;
     return -1;
 }
 int IntegerProperty::get(int idx, char *buffer, size_t max) {
-    LOGE("String 'get' called on integer property!");
+    ALOGE("String 'get' called on integer property!");
     errno = EINVAL;
     return -1;
 }
 int IntegerProperty::get(int idx, struct in_addr *buffer) {
-    LOGE("IpAddr 'get' called on integer property!");
+    ALOGE("IpAddr 'get' called on integer property!");
     errno = EINVAL;
     return -1;
 }
@@ -118,7 +118,7 @@
 
 int IntegerPropertyHelper::set(int idx, int value) {
     if (idx != 0) {
-        LOGW("Attempt to use array index on IntegerPropertyHelper::set");
+        ALOGW("Attempt to use array index on IntegerPropertyHelper::set");
         errno = EINVAL;
         return -1;
     }
@@ -128,7 +128,7 @@
 
 int IntegerPropertyHelper::get(int idx, int *buffer) {
     if (idx != 0) {
-        LOGW("Attempt to use array index on IntegerPropertyHelper::get");
+        ALOGW("Attempt to use array index on IntegerPropertyHelper::get");
         errno = EINVAL;
         return -1;
     }
@@ -141,22 +141,22 @@
 }
 
 int IPV4AddressProperty::set(int idx, const char *value) {
-    LOGE("String 'set' called on ipv4 property!");
+    ALOGE("String 'set' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
 int IPV4AddressProperty::set(int idx, int value) {
-    LOGE("Integer 'set' called on ipv4 property!");
+    ALOGE("Integer 'set' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
 int IPV4AddressProperty::get(int idx, char *buffer, size_t max) {
-    LOGE("String 'get' called on ipv4 property!");
+    ALOGE("String 'get' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
 int IPV4AddressProperty::get(int idx, int *buffer) {
-    LOGE("Integer 'get' called on ipv4 property!");
+    ALOGE("Integer 'get' called on ipv4 property!");
     errno = EINVAL;
     return -1;
 }
@@ -169,7 +169,7 @@
 
 int IPV4AddressPropertyHelper::set(int idx, struct in_addr *value) {
     if (idx != 0) {
-        LOGW("Attempt to use array index on IPV4AddressPropertyHelper::set");
+        ALOGW("Attempt to use array index on IPV4AddressPropertyHelper::set");
         errno = EINVAL;
         return -1;
     }
@@ -179,7 +179,7 @@
 
 int IPV4AddressPropertyHelper::get(int idx, struct in_addr *buffer) {
     if (idx != 0) {
-        LOGW("Attempt to use array index on IPV4AddressPropertyHelper::get");
+        ALOGW("Attempt to use array index on IPV4AddressPropertyHelper::get");
         errno = EINVAL;
         return -1;
     }
diff --git a/nexus/PropertyManager.cpp b/nexus/PropertyManager.cpp
index 704b223..41cdb41 100644
--- a/nexus/PropertyManager.cpp
+++ b/nexus/PropertyManager.cpp
@@ -66,10 +66,10 @@
 int PropertyManager::attachProperty(const char *ns_name, Property *p) {
     PropertyNamespace *ns;
 
-    LOGD("Attaching property %s to namespace %s", p->getName(), ns_name);
+    ALOGD("Attaching property %s to namespace %s", p->getName(), ns_name);
     pthread_mutex_lock(&mLock);
     if (!(ns = lookupNamespace_UNLOCKED(ns_name))) {
-        LOGD("Creating namespace %s", ns_name);
+        ALOGD("Creating namespace %s", ns_name);
         ns = new PropertyNamespace(ns_name);
         mNamespaces->push_back(ns);
     }
@@ -77,7 +77,7 @@
     if (lookupProperty_UNLOCKED(ns, p->getName())) {
         errno = EADDRINUSE;
         pthread_mutex_unlock(&mLock);
-        LOGE("Failed to register property %s.%s (%s)",
+        ALOGE("Failed to register property %s.%s (%s)",
             ns_name, p->getName(), strerror(errno));
         return -1;
     }
@@ -90,11 +90,11 @@
 int PropertyManager::detachProperty(const char *ns_name, Property *p) {
     PropertyNamespace *ns;
 
-    LOGD("Detaching property %s from namespace %s", p->getName(), ns_name);
+    ALOGD("Detaching property %s from namespace %s", p->getName(), ns_name);
     pthread_mutex_lock(&mLock);
     if (!(ns = lookupNamespace_UNLOCKED(ns_name))) {
         pthread_mutex_unlock(&mLock);
-        LOGE("Namespace '%s' not found", ns_name);
+        ALOGE("Namespace '%s' not found", ns_name);
         return -1;
     }
 
@@ -110,7 +110,7 @@
         }
     }
 
-    LOGE("Property %s.%s not found", ns_name, p->getName());
+    ALOGE("Property %s.%s not found", ns_name, p->getName());
     pthread_mutex_unlock(&mLock);
     errno = ENOENT;
     return -1;
@@ -130,7 +130,7 @@
         errno = 0;
         tmp = strtol(value, (char **) NULL, 10);
         if (errno) {
-            LOGE("Failed to convert '%s' to int", value);
+            ALOGE("Failed to convert '%s' to int", value);
             errno = EINVAL;
             return -1;
         }
@@ -138,13 +138,13 @@
     } else if (p->getType() == Property::Type_IPV4) {
         struct in_addr tmp;
         if (!inet_aton(value, &tmp)) {
-            LOGE("Failed to convert '%s' to ipv4", value);
+            ALOGE("Failed to convert '%s' to ipv4", value);
             errno = EINVAL;
             return -1;
         }
         return p->set(idx, &tmp);
     } else {
-        LOGE("Property '%s' has an unknown type (%d)", p->getName(),
+        ALOGE("Property '%s' has an unknown type (%d)", p->getName(),
              p->getType());
         errno = EINVAL;
         return -1;
@@ -157,7 +157,7 @@
 
     if (p->getType() == Property::Type_STRING) {
         if (p->get(idx, buffer, max)) {
-            LOGW("String property %s get failed (%s)", p->getName(),
+            ALOGW("String property %s get failed (%s)", p->getName(),
                  strerror(errno));
             return -1;
         }
@@ -165,7 +165,7 @@
     else if (p->getType() == Property::Type_INTEGER) {
         int tmp;
         if (p->get(idx, &tmp)) {
-            LOGW("Integer property %s get failed (%s)", p->getName(),
+            ALOGW("Integer property %s get failed (%s)", p->getName(),
                  strerror(errno));
             return -1;
         }
@@ -173,13 +173,13 @@
     } else if (p->getType() == Property::Type_IPV4) {
         struct in_addr tmp;
         if (p->get(idx, &tmp)) {
-            LOGW("IPV4 property %s get failed (%s)", p->getName(),
+            ALOGW("IPV4 property %s get failed (%s)", p->getName(),
                  strerror(errno));
             return -1;
         }
         strncpy(buffer, inet_ntoa(tmp), max);
     } else {
-        LOGE("Property '%s' has an unknown type (%d)", p->getName(),
+        ALOGE("Property '%s' has an unknown type (%d)", p->getName(),
              p->getType());
         errno = EINVAL;
         return -1;
@@ -193,7 +193,7 @@
 
 int PropertyManager::set(const char *name, const char *value) {
 
-    LOGD("set %s = '%s'", name, value);
+    ALOGD("set %s = '%s'", name, value);
     pthread_mutex_lock(&mLock);
     PropertyNamespaceCollection::iterator ns_it;
     for (ns_it = mNamespaces->begin(); ns_it != mNamespaces->end(); ++ns_it) {
@@ -215,7 +215,7 @@
         }
     }
 
-    LOGE("Property %s not found", name);
+    ALOGE("Property %s not found", name);
     pthread_mutex_unlock(&mLock);
     errno = ENOENT;
     return -1;
@@ -246,7 +246,7 @@
         }
     }
 
-    LOGE("Property %s not found", name);
+    ALOGE("Property %s not found", name);
     pthread_mutex_unlock(&mLock);
     errno = ENOENT;
     return NULL;
diff --git a/nexus/ScanResult.cpp b/nexus/ScanResult.cpp
index e9a286c..72cb164 100644
--- a/nexus/ScanResult.cpp
+++ b/nexus/ScanResult.cpp
@@ -74,7 +74,7 @@
 
     return;
  out_bad:
-    LOGW("Malformatted scan result (%s)", rawResult);
+    ALOGW("Malformatted scan result (%s)", rawResult);
 }
 
 ScanResult::~ScanResult() {
diff --git a/nexus/Supplicant.cpp b/nexus/Supplicant.cpp
index 6aa36e8..b604698 100644
--- a/nexus/Supplicant.cpp
+++ b/nexus/Supplicant.cpp
@@ -64,22 +64,22 @@
 int Supplicant::start() {
 
     if (setupConfig()) {
-        LOGW("Unable to setup supplicant.conf");
+        ALOGW("Unable to setup supplicant.conf");
     }
 
     if (mServiceManager->start(SUPPLICANT_SERVICE_NAME)) {
-        LOGE("Error starting supplicant (%s)", strerror(errno));
+        ALOGE("Error starting supplicant (%s)", strerror(errno));
         return -1;
     }
 
     wpa_ctrl_cleanup();
     if (connectToSupplicant()) {
-        LOGE("Error connecting to supplicant (%s)\n", strerror(errno));
+        ALOGE("Error connecting to supplicant (%s)\n", strerror(errno));
         return -1;
     }
     
     if (retrieveInterfaceName()) {
-        LOGE("Error retrieving interface name (%s)\n", strerror(errno));
+        ALOGE("Error retrieving interface name (%s)\n", strerror(errno));
         return -1;
     }
 
@@ -89,12 +89,12 @@
 int Supplicant::stop() {
 
     if (mListener->stopListener()) {
-        LOGW("Unable to stop supplicant listener (%s)", strerror(errno));
+        ALOGW("Unable to stop supplicant listener (%s)", strerror(errno));
         return -1;
     }
 
     if (mServiceManager->stop(SUPPLICANT_SERVICE_NAME)) {
-        LOGW("Error stopping supplicant (%s)", strerror(errno));
+        ALOGW("Error stopping supplicant (%s)", strerror(errno));
     }
 
     if (mCtrl) {
@@ -120,7 +120,7 @@
         return -1;
     }
 
-//    LOGD("sendCommand(): -> '%s'", cmd);
+//    ALOGD("sendCommand(): -> '%s'", cmd);
 
     int rc;
     memset(reply, 0, *reply_len);
@@ -133,7 +133,7 @@
         return -1;
     }
 
- //   LOGD("sendCommand(): <- '%s'", reply);
+ //   ALOGD("sendCommand(): <- '%s'", reply);
     return 0;
 }
 SupplicantStatus *Supplicant::getStatus() {
@@ -178,7 +178,7 @@
     char *linep_next = NULL;
 
     if (!strtok_r(reply, "\n", &linep_next)) {
-        LOGW("Malformatted network list\n");
+        ALOGW("Malformatted network list\n");
         free(reply);
         errno = EIO;
         return -1;
@@ -199,7 +199,7 @@
         if ((merge_wn = this->lookupNetwork_UNLOCKED(new_wn->getNetworkId()))) {
             num_refreshed++;
             if (merge_wn->refresh()) {
-                LOGW("Error refreshing network %d (%s)",
+                ALOGW("Error refreshing network %d (%s)",
                      merge_wn->getNetworkId(), strerror(errno));
                 }
             delete new_wn;
@@ -210,7 +210,7 @@
             new_wn->attachProperties(pm, new_ns);
             mNetworks->push_back(new_wn);
             if (new_wn->refresh()) {
-                LOGW("Unable to refresh network id %d (%s)",
+                ALOGW("Unable to refresh network id %d (%s)",
                     new_wn->getNetworkId(), strerror(errno));
             }
         }
@@ -233,7 +233,7 @@
     }
 
 
-    LOGD("Networks added %d, refreshed %d, removed %d\n", 
+    ALOGD("Networks added %d, refreshed %d, removed %d\n",
          num_added, num_refreshed, num_removed);
     pthread_mutex_unlock(&mNetworksLock);
 
@@ -243,11 +243,11 @@
 
 int Supplicant::connectToSupplicant() {
     if (!isStarted())
-        LOGW("Supplicant service not running");
+        ALOGW("Supplicant service not running");
 
     mCtrl = wpa_ctrl_open("tiwlan0"); // XXX:
     if (mCtrl == NULL) {
-        LOGE("Unable to open connection to supplicant on \"%s\": %s",
+        ALOGE("Unable to open connection to supplicant on \"%s\": %s",
              "tiwlan0", strerror(errno));
         return -1;
     }
@@ -267,7 +267,7 @@
     mListener = new SupplicantListener(mHandlers, mMonitor);
 
     if (mListener->startListener()) {
-        LOGE("Error - unable to start supplicant listener");
+        ALOGE("Error - unable to start supplicant listener");
         stop();
         return -1;
     }
@@ -280,7 +280,7 @@
 
     if (sendCommand((active ? "DRIVER SCAN-ACTIVE" : "DRIVER SCAN-PASSIVE"),
                      reply, &len)) {
-        LOGW("triggerScan(%d): Error setting scan mode (%s)", active,
+        ALOGW("triggerScan(%d): Error setting scan mode (%s)", active,
              strerror(errno));
         return -1;
     }
@@ -292,7 +292,7 @@
     size_t len = sizeof(reply);
 
     if (sendCommand("SCAN", reply, &len)) {
-        LOGW("triggerScan(): Error initiating scan");
+        ALOGW("triggerScan(): Error initiating scan");
         return -1;
     }
     return 0;
@@ -303,7 +303,7 @@
     size_t len = sizeof(reply);
 
     if (sendCommand("DRIVER RSSI", reply, &len)) {
-        LOGW("Failed to get RSSI (%s)", strerror(errno));
+        ALOGW("Failed to get RSSI (%s)", strerror(errno));
         return -1;
     }
 
@@ -311,7 +311,7 @@
     char *s;
     for (int i = 0; i < 3; i++) {
         if (!(s = strsep(&next, " "))) {
-            LOGE("Error parsing RSSI");
+            ALOGE("Error parsing RSSI");
             errno = EIO;
             return -1;
         }
@@ -325,7 +325,7 @@
     size_t len = sizeof(reply);
 
     if (sendCommand("DRIVER LINKSPEED", reply, &len)) {
-        LOGW("Failed to get LINKSPEED (%s)", strerror(errno));
+        ALOGW("Failed to get LINKSPEED (%s)", strerror(errno));
         return -1;
     }
 
@@ -333,13 +333,13 @@
     char *s;
 
     if (!(s = strsep(&next, " "))) {
-        LOGE("Error parsing LINKSPEED");
+        ALOGE("Error parsing LINKSPEED");
         errno = EIO;
         return -1;
     }
 
     if (!(s = strsep(&next, " "))) {
-        LOGE("Error parsing LINKSPEED");
+        ALOGE("Error parsing LINKSPEED");
         errno = EIO;
         return -1;
     }
@@ -350,10 +350,10 @@
     char reply[64];
     size_t len = sizeof(reply);
 
-    LOGD("stopDriver()");
+    ALOGD("stopDriver()");
 
     if (sendCommand("DRIVER STOP", reply, &len)) {
-        LOGW("Failed to stop driver (%s)", strerror(errno));
+        ALOGW("Failed to stop driver (%s)", strerror(errno));
         return -1;
     }
     return 0;
@@ -363,9 +363,9 @@
     char reply[64];
     size_t len = sizeof(reply);
 
-    LOGD("startDriver()");
+    ALOGD("startDriver()");
     if (sendCommand("DRIVER START", reply, &len)) {
-        LOGW("Failed to start driver (%s)", strerror(errno));
+        ALOGW("Failed to start driver (%s)", strerror(errno));
         return -1;
     }
     return 0;
@@ -452,26 +452,26 @@
     if (access(SUPP_CONFIG_FILE, R_OK|W_OK) == 0) {
         return 0;
     } else if (errno != ENOENT) {
-        LOGE("Cannot access \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
+        ALOGE("Cannot access \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
         return -1;
     }
 
     srcfd = open(SUPP_CONFIG_TEMPLATE, O_RDONLY);
     if (srcfd < 0) {
-        LOGE("Cannot open \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
+        ALOGE("Cannot open \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
         return -1;
     }
 
     destfd = open(SUPP_CONFIG_FILE, O_CREAT|O_WRONLY, 0660);
     if (destfd < 0) {
         close(srcfd);
-        LOGE("Cannot create \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
+        ALOGE("Cannot create \"%s\": %s", SUPP_CONFIG_FILE, strerror(errno));
         return -1;
     }
 
     while ((nread = read(srcfd, buf, sizeof(buf))) != 0) {
         if (nread < 0) {
-            LOGE("Error reading \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
+            ALOGE("Error reading \"%s\": %s", SUPP_CONFIG_TEMPLATE, strerror(errno));
             close(srcfd);
             close(destfd);
             unlink(SUPP_CONFIG_FILE);
@@ -484,7 +484,7 @@
     close(srcfd);
 
     if (chown(SUPP_CONFIG_FILE, AID_SYSTEM, AID_WIFI) < 0) {
-        LOGE("Error changing group ownership of %s to %d: %s",
+        ALOGE("Error changing group ownership of %s to %d: %s",
              SUPP_CONFIG_FILE, AID_WIFI, strerror(errno));
         unlink(SUPP_CONFIG_FILE);
         return -1;
@@ -496,7 +496,7 @@
     char reply[255];
     size_t len = sizeof(reply) -1;
 
-    LOGD("netid %d, var '%s' = '%s'", networkId, var, val);
+    ALOGD("netid %d, var '%s' = '%s'", networkId, var, val);
     char *tmp;
     asprintf(&tmp, "SET_NETWORK %d %s %s", networkId, var, val);
     if (sendCommand(tmp, reply, &len)) {
@@ -507,7 +507,7 @@
 
     len = sizeof(reply) -1;
     if (sendCommand("SAVE_CONFIG", reply, &len)) {
-        LOGE("Error saving config after %s = %s", var, val);
+        ALOGE("Error saving config after %s = %s", var, val);
         return -1;
     }
     return 0;
@@ -621,7 +621,7 @@
 int Supplicant::setApScanMode(int mode) {
     char req[64];
 
-//    LOGD("setApScanMode(%d)", mode);
+//    ALOGD("setApScanMode(%d)", mode);
     sprintf(req, "AP_SCAN %d", mode);
 
     char reply[16];
diff --git a/nexus/SupplicantAssociatingEvent.cpp b/nexus/SupplicantAssociatingEvent.cpp
index c6e9fe3..8fe502e 100644
--- a/nexus/SupplicantAssociatingEvent.cpp
+++ b/nexus/SupplicantAssociatingEvent.cpp
@@ -46,7 +46,7 @@
         //                           p
         char *q = index(p, '\'');
         if (!q) {
-            LOGE("Unable to decode SSID (p = {%s})\n", p);
+            ALOGE("Unable to decode SSID (p = {%s})\n", p);
             return;
         }
         mSsid = (char *) malloc((q - p) +1);
@@ -59,7 +59,7 @@
         //                                         ^
         //                                         p
         if (!(q = index(p, ' '))) {
-            LOGE("Unable to decode frequency\n");
+            ALOGE("Unable to decode frequency\n");
             return;
         }
         *q = '\0';
@@ -73,7 +73,7 @@
 
         char *q = index(p, '\'');
         if (!q) {
-            LOGE("Unable to decode SSID (p = {%s})\n", p);
+            ALOGE("Unable to decode SSID (p = {%s})\n", p);
             return;
         }
         mSsid = (char *) malloc((q - p) +1);
diff --git a/nexus/SupplicantConnectedEvent.cpp b/nexus/SupplicantConnectedEvent.cpp
index e58bab2..107c766 100644
--- a/nexus/SupplicantConnectedEvent.cpp
+++ b/nexus/SupplicantConnectedEvent.cpp
@@ -42,9 +42,9 @@
             else
                 mReassociated = true;
         } else
-            LOGE("Unable to decode re-assocation");
+            ALOGE("Unable to decode re-assocation");
     } else
-        LOGE("Unable to decode event");
+        ALOGE("Unable to decode event");
 }
 
 SupplicantConnectedEvent::SupplicantConnectedEvent(const char *bssid, 
diff --git a/nexus/SupplicantEventFactory.cpp b/nexus/SupplicantEventFactory.cpp
index 8695aca..f91db15 100644
--- a/nexus/SupplicantEventFactory.cpp
+++ b/nexus/SupplicantEventFactory.cpp
@@ -57,9 +57,9 @@
             level = atoi(tmp);
             event += (match - event) + 1;
         } else
-            LOGW("Unclosed level brace in event");
+            ALOGW("Unclosed level brace in event");
     } else
-        LOGW("No level specified in event");
+        ALOGW("No level specified in event");
 
     /*
      * <N>CTRL-EVENT-XXX
diff --git a/nexus/SupplicantListener.cpp b/nexus/SupplicantListener.cpp
index b91fc02..421d84d 100644
--- a/nexus/SupplicantListener.cpp
+++ b/nexus/SupplicantListener.cpp
@@ -48,13 +48,13 @@
     size_t nread = buflen - 1;
 
     if ((rc = wpa_ctrl_recv(mMonitor, buf, &nread))) {
-        LOGE("wpa_ctrl_recv failed (%s)", strerror(errno));
+        ALOGE("wpa_ctrl_recv failed (%s)", strerror(errno));
         return false;
     }
 
     buf[nread] = '\0';
     if (!rc && !nread) {
-        LOGD("Received EOF on supplicant socket\n");
+        ALOGD("Received EOF on supplicant socket\n");
         strncpy(buf, WPA_EVENT_TERMINATING " - signal 0 received", buflen-1);
         buf[buflen-1] = '\0';
         return false;
@@ -63,7 +63,7 @@
     SupplicantEvent *evt = mFactory->createEvent(buf, nread);
 
     if (!evt) {
-        LOGW("Dropping unknown supplicant event '%s'", buf);
+        ALOGW("Dropping unknown supplicant event '%s'", buf);
         return true;
     }
 
@@ -83,7 +83,7 @@
     else if (evt->getType() == SupplicantEvent::EVENT_DISCONNECTED)
         mHandlers->onDisconnectedEvent((SupplicantDisconnectedEvent *) evt);
     else
-        LOGW("Whoops - no handler available for event '%s'\n", buf);
+        ALOGW("Whoops - no handler available for event '%s'\n", buf);
 #if 0
     else if (evt->getType() == SupplicantEvent::EVENT_TERMINATING)
         mHandlers->onTerminatingEvent(evt);
diff --git a/nexus/SupplicantStateChangeEvent.cpp b/nexus/SupplicantStateChangeEvent.cpp
index cf0b9da..fd9233a 100644
--- a/nexus/SupplicantStateChangeEvent.cpp
+++ b/nexus/SupplicantStateChangeEvent.cpp
@@ -28,7 +28,7 @@
     // XXX: move this stuff into a static creation method
     char *p = index(event, ' ');
     if (!p) {
-        LOGW("Bad event '%s'\n", event);
+        ALOGW("Bad event '%s'\n", event);
         return;
     }
 
diff --git a/nexus/SupplicantStatus.cpp b/nexus/SupplicantStatus.cpp
index b3c560a..8f28abe 100644
--- a/nexus/SupplicantStatus.cpp
+++ b/nexus/SupplicantStatus.cpp
@@ -81,9 +81,9 @@
             else if (!strcmp(value, "IDLE"))
                 state = SupplicantState::IDLE;
             else 
-                LOGE("Unknown supplicant state '%s'", value);
+                ALOGE("Unknown supplicant state '%s'", value);
         } else
-            LOGD("Ignoring unsupported status token '%s'", token);
+            ALOGD("Ignoring unsupported status token '%s'", token);
     }
 
     return new SupplicantStatus(state, id, bssid, ssid);
diff --git a/nexus/TiwlanEventListener.cpp b/nexus/TiwlanEventListener.cpp
index 15e6930..fde3a44 100644
--- a/nexus/TiwlanEventListener.cpp
+++ b/nexus/TiwlanEventListener.cpp
@@ -33,25 +33,25 @@
     struct ipc_ev_data *data;
 
     if (!(data = (struct ipc_ev_data *) malloc(sizeof(struct ipc_ev_data)))) {
-        LOGE("Failed to allocate packet (out of memory)");
+        ALOGE("Failed to allocate packet (out of memory)");
         return true;
     }
 
     if (recv(cli->getSocket(), data, sizeof(struct ipc_ev_data), 0) < 0) {
-       LOGE("recv failed (%s)", strerror(errno));
+       ALOGE("recv failed (%s)", strerror(errno));
        goto out;
     }
 
     if (data->event_type == IPC_EVENT_LINK_SPEED) {
         uint32_t *spd = (uint32_t *) data->buffer;
         *spd /= 2;
-//        LOGD("Link speed = %u MB/s", *spd);
+//        ALOGD("Link speed = %u MB/s", *spd);
     } else if (data->event_type == IPC_EVENT_LOW_SNR) {
-        LOGW("Low signal/noise ratio");
+        ALOGW("Low signal/noise ratio");
     } else if (data->event_type == IPC_EVENT_LOW_RSSI) {
-        LOGW("Low RSSI");
+        ALOGW("Low RSSI");
     } else {
-//        LOGD("Dropping unhandled driver event %d", data->event_type);
+//        ALOGD("Dropping unhandled driver event %d", data->event_type);
     }
 
     // TODO: Tell WifiController about the event
diff --git a/nexus/TiwlanWifiController.cpp b/nexus/TiwlanWifiController.cpp
index 016c790..76b6a2e 100644
--- a/nexus/TiwlanWifiController.cpp
+++ b/nexus/TiwlanWifiController.cpp
@@ -75,23 +75,23 @@
     while (count-- > 0) {
         if (property_get(DRIVER_PROP_NAME, driver_status, NULL)) {
             if (!strcmp(driver_status, "ok")) {
-                LOGD("Firmware loaded OK");
+                ALOGD("Firmware loaded OK");
 
                 if (startDriverEventListener()) {
-                    LOGW("Failed to start driver event listener (%s)",
+                    ALOGW("Failed to start driver event listener (%s)",
                          strerror(errno));
                 }
 
                 return 0;
             } else if (!strcmp(DRIVER_PROP_NAME, "failed")) {
-                LOGE("Firmware load failed");
+                ALOGE("Firmware load failed");
                 return -1;
             }
         }
         usleep(200000);
     }
     property_set(DRIVER_PROP_NAME, "timeout");
-    LOGE("Firmware load timed out");
+    ALOGE("Firmware load timed out");
     return -1;
 }
 
@@ -99,13 +99,13 @@
     struct sockaddr_in addr;
 
     if (mListenerSock != -1) {
-        LOGE("Listener already started!");
+        ALOGE("Listener already started!");
         errno = EBUSY;
         return -1;
     }
 
     if ((mListenerSock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
-        LOGE("socket failed (%s)", strerror(errno));
+        ALOGE("socket failed (%s)", strerror(errno));
         return -1;
     }
 
@@ -117,14 +117,14 @@
     if (bind(mListenerSock,
              (struct sockaddr *) &addr,
              sizeof(addr)) < 0) {
-        LOGE("bind failed (%s)", strerror(errno));
+        ALOGE("bind failed (%s)", strerror(errno));
         goto out_err;
     }
 
     mEventListener = new TiwlanEventListener(mListenerSock);
 
     if (mEventListener->startListener()) {
-        LOGE("Error starting driver listener (%s)", strerror(errno));
+        ALOGE("Error starting driver listener (%s)", strerror(errno));
         goto out_err;
     }
     return 0;
diff --git a/nexus/WifiController.cpp b/nexus/WifiController.cpp
index c218c30..cedd013 100644
--- a/nexus/WifiController.cpp
+++ b/nexus/WifiController.cpp
@@ -108,50 +108,50 @@
 int WifiController::enable() {
 
     if (!isPoweredUp()) {
-        LOGI("Powering up");
+        ALOGI("Powering up");
         sendStatusBroadcast("Powering up WiFi hardware");
         if (powerUp()) {
-            LOGE("Powerup failed (%s)", strerror(errno));
+            ALOGE("Powerup failed (%s)", strerror(errno));
             return -1;
         }
     }
 
     if (mModuleName[0] != '\0' && !isKernelModuleLoaded(mModuleName)) {
-        LOGI("Loading driver");
+        ALOGI("Loading driver");
         sendStatusBroadcast("Loading WiFi driver");
         if (loadKernelModule(mModulePath, mModuleArgs)) {
-            LOGE("Kernel module load failed (%s)", strerror(errno));
+            ALOGE("Kernel module load failed (%s)", strerror(errno));
             goto out_powerdown;
         }
     }
 
     if (!isFirmwareLoaded()) {
-        LOGI("Loading firmware");
+        ALOGI("Loading firmware");
         sendStatusBroadcast("Loading WiFI firmware");
         if (loadFirmware()) {
-            LOGE("Firmware load failed (%s)", strerror(errno));
+            ALOGE("Firmware load failed (%s)", strerror(errno));
             goto out_powerdown;
         }
     }
 
     if (!mSupplicant->isStarted()) {
-        LOGI("Starting WPA Supplicant");
+        ALOGI("Starting WPA Supplicant");
         sendStatusBroadcast("Starting WPA Supplicant");
         if (mSupplicant->start()) {
-            LOGE("Supplicant start failed (%s)", strerror(errno));
+            ALOGE("Supplicant start failed (%s)", strerror(errno));
             goto out_unloadmodule;
         }
     }
 
     if (Controller::bindInterface(mSupplicant->getInterfaceName())) {
-        LOGE("Error binding interface (%s)", strerror(errno));
+        ALOGE("Error binding interface (%s)", strerror(errno));
         goto out_unloadmodule;
     }
 
     if (mSupplicant->refreshNetworkList())
-        LOGW("Error getting list of networks (%s)", strerror(errno));
+        ALOGW("Error getting list of networks (%s)", strerror(errno));
 
-    LOGW("TODO: Set # of allowed regulatory channels!");
+    ALOGW("TODO: Set # of allowed regulatory channels!");
 
     mPropMngr->attachProperty("wifi", mDynamicProperties.propSupplicantState);
     mPropMngr->attachProperty("wifi", mDynamicProperties.propActiveScan);
@@ -167,19 +167,19 @@
     mPropMngr->attachProperty("wifi", mDynamicProperties.propNetCount);
     mPropMngr->attachProperty("wifi", mDynamicProperties.propTriggerScan);
 
-    LOGI("Enabled successfully");
+    ALOGI("Enabled successfully");
     return 0;
 
 out_unloadmodule:
     if (mModuleName[0] != '\0' && !isKernelModuleLoaded(mModuleName)) {
         if (unloadKernelModule(mModuleName)) {
-            LOGE("Unable to unload module after failure!");
+            ALOGE("Unable to unload module after failure!");
         }
     }
 
 out_powerdown:
     if (powerDown()) {
-        LOGE("Unable to powerdown after failure!");
+        ALOGE("Unable to powerdown after failure!");
     }
     return -1;
 }
@@ -195,7 +195,7 @@
 
     pthread_mutex_lock(&mLock);
     if (suspend == mSuspended) {
-        LOGW("Suspended state already = %d", suspend);
+        ALOGW("Suspended state already = %d", suspend);
         pthread_mutex_unlock(&mLock);
         return 0;
     }
@@ -204,29 +204,29 @@
         mHandlers->onControllerSuspending(this);
 
         char tmp[80];
-        LOGD("Suspending from supplicant state %s",
+        ALOGD("Suspending from supplicant state %s",
              SupplicantState::toString(mSupplicantState,
                                        tmp,
                                        sizeof(tmp)));
 
         if (mSupplicantState != SupplicantState::IDLE) {
-            LOGD("Forcing Supplicant disconnect");
+            ALOGD("Forcing Supplicant disconnect");
             if (mSupplicant->disconnect()) {
-                LOGW("Error disconnecting (%s)", strerror(errno));
+                ALOGW("Error disconnecting (%s)", strerror(errno));
             }
         }
 
-        LOGD("Stopping Supplicant driver");
+        ALOGD("Stopping Supplicant driver");
         if (mSupplicant->stopDriver()) {
-            LOGE("Error stopping driver (%s)", strerror(errno));
+            ALOGE("Error stopping driver (%s)", strerror(errno));
             pthread_mutex_unlock(&mLock);
             return -1;
         }
     } else {
-        LOGD("Resuming");
+        ALOGD("Resuming");
 
         if (mSupplicant->startDriver()) {
-            LOGE("Error resuming driver (%s)", strerror(errno));
+            ALOGE("Error resuming driver (%s)", strerror(errno));
             pthread_mutex_unlock(&mLock);
             return -1;
         }
@@ -241,7 +241,7 @@
 
     mSuspended = suspend;
     pthread_mutex_unlock(&mLock);
-    LOGD("Suspend / Resume completed");
+    ALOGD("Suspend / Resume completed");
     return 0;
 }
 
@@ -269,16 +269,16 @@
     if (mSupplicant->isStarted()) {
         sendStatusBroadcast("Stopping WPA Supplicant");
         if (mSupplicant->stop()) {
-            LOGE("Supplicant stop failed (%s)", strerror(errno));
+            ALOGE("Supplicant stop failed (%s)", strerror(errno));
             return -1;
         }
     } else
-        LOGW("disable(): Supplicant not running?");
+        ALOGW("disable(): Supplicant not running?");
 
     if (mModuleName[0] != '\0' && isKernelModuleLoaded(mModuleName)) {
         sendStatusBroadcast("Unloading WiFi driver");
         if (unloadKernelModule(mModuleName)) {
-            LOGE("Unable to unload module (%s)", strerror(errno));
+            ALOGE("Unable to unload module (%s)", strerror(errno));
             return -1;
         }
     }
@@ -286,7 +286,7 @@
     if (isPoweredUp()) {
         sendStatusBroadcast("Powering down WiFi hardware");
         if (powerDown()) {
-            LOGE("Powerdown failed (%s)", strerror(errno));
+            ALOGE("Powerdown failed (%s)", strerror(errno));
             return -1;
         }
     }
@@ -426,38 +426,38 @@
 }
 
 void WifiController::onAssociatingEvent(SupplicantAssociatingEvent *evt) {
-    LOGD("onAssociatingEvent(%s, %s, %d)",
+    ALOGD("onAssociatingEvent(%s, %s, %d)",
          (evt->getBssid() ? evt->getBssid() : "n/a"),
          (evt->getSsid() ? evt->getSsid() : "n/a"),
          evt->getFreq());
 }
 
 void WifiController::onAssociatedEvent(SupplicantAssociatedEvent *evt) {
-    LOGD("onAssociatedEvent(%s)", evt->getBssid());
+    ALOGD("onAssociatedEvent(%s)", evt->getBssid());
 }
 
 void WifiController::onConnectedEvent(SupplicantConnectedEvent *evt) {
-    LOGD("onConnectedEvent(%s, %d)", evt->getBssid(), evt->getReassociated());
+    ALOGD("onConnectedEvent(%s, %d)", evt->getBssid(), evt->getReassociated());
     SupplicantStatus *ss = mSupplicant->getStatus();
     WifiNetwork *wn;
 
     if (ss->getWpaState() != SupplicantState::COMPLETED) {
         char tmp[32];
 
-        LOGW("onConnected() with SupplicantState = %s!",
+        ALOGW("onConnected() with SupplicantState = %s!",
              SupplicantState::toString(ss->getWpaState(), tmp,
              sizeof(tmp)));
         return;
     }
 
     if (ss->getId() == -1) {
-        LOGW("onConnected() with id = -1!");
+        ALOGW("onConnected() with id = -1!");
         return;
     }
     
     mCurrentlyConnectedNetworkId = ss->getId();
     if (!(wn = mSupplicant->lookupNetwork(ss->getId()))) {
-        LOGW("Error looking up connected network id %d (%s)",
+        ALOGW("Error looking up connected network id %d (%s)",
              ss->getId(), strerror(errno));
         return;
     }
@@ -470,7 +470,7 @@
     char *reply;
 
     if (!(reply = (char *) malloc(4096))) {
-        LOGE("Out of memory");
+        ALOGE("Out of memory");
         return;
     }
 
@@ -481,7 +481,7 @@
     size_t len = 4096;
 
     if (mSupplicant->sendCommand("SCAN_RESULTS", reply, &len)) {
-        LOGW("onScanResultsEvent: Error getting scan results (%s)",
+        ALOGW("onScanResultsEvent: Error getting scan results (%s)",
              strerror(errno));
         free(reply);
         return;
@@ -530,7 +530,7 @@
     if (evt->getState() == mSupplicantState)
         return;
 
-    LOGD("onStateChangeEvent(%s -> %s)", 
+    ALOGD("onStateChangeEvent(%s -> %s)",
          SupplicantState::toString(mSupplicantState, tmp, sizeof(tmp)),
          SupplicantState::toString(evt->getState(), tmp2, sizeof(tmp2)));
 
@@ -559,7 +559,7 @@
 }
 
 void WifiController::onConnectionTimeoutEvent(SupplicantConnectionTimeoutEvent *evt) {
-    LOGD("onConnectionTimeoutEvent(%s)", evt->getBssid());
+    ALOGD("onConnectionTimeoutEvent(%s)", evt->getBssid());
 }
 
 void WifiController::onDisconnectedEvent(SupplicantDisconnectedEvent *evt) {
@@ -569,39 +569,39 @@
 
 #if 0
 void WifiController::onTerminatingEvent(SupplicantEvent *evt) {
-    LOGD("onTerminatingEvent(%s)", evt->getEvent());
+    ALOGD("onTerminatingEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onPasswordChangedEvent(SupplicantEvent *evt) {
-    LOGD("onPasswordChangedEvent(%s)", evt->getEvent());
+    ALOGD("onPasswordChangedEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapNotificationEvent(SupplicantEvent *evt) {
-    LOGD("onEapNotificationEvent(%s)", evt->getEvent());
+    ALOGD("onEapNotificationEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapStartedEvent(SupplicantEvent *evt) {
-    LOGD("onEapStartedEvent(%s)", evt->getEvent());
+    ALOGD("onEapStartedEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapMethodEvent(SupplicantEvent *evt) {
-    LOGD("onEapMethodEvent(%s)", evt->getEvent());
+    ALOGD("onEapMethodEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapSuccessEvent(SupplicantEvent *evt) {
-    LOGD("onEapSuccessEvent(%s)", evt->getEvent());
+    ALOGD("onEapSuccessEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onEapFailureEvent(SupplicantEvent *evt) {
-    LOGD("onEapFailureEvent(%s)", evt->getEvent());
+    ALOGD("onEapFailureEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onLinkSpeedEvent(SupplicantEvent *evt) {
-    LOGD("onLinkSpeedEvent(%s)", evt->getEvent());
+    ALOGD("onLinkSpeedEvent(%s)", evt->getEvent());
 }
 
 void WifiController::onDriverStateEvent(SupplicantEvent *evt) {
-    LOGD("onDriverStateEvent(%s)", evt->getEvent());
+    ALOGD("onDriverStateEvent(%s)", evt->getEvent());
 }
 #endif
 
@@ -609,7 +609,7 @@
     pthread_mutex_lock(&mLock);
     int rssi;
     if (mSupplicant->getRssi(&rssi)) {
-        LOGE("Failed to get rssi (%s)", strerror(errno));
+        ALOGE("Failed to get rssi (%s)", strerror(errno));
         pthread_mutex_unlock(&mLock);
         return;
     }
diff --git a/nexus/WifiNetwork.cpp b/nexus/WifiNetwork.cpp
index 6a0f684..0197b64 100644
--- a/nexus/WifiNetwork.cpp
+++ b/nexus/WifiNetwork.cpp
@@ -43,15 +43,15 @@
     char *flags;
 
     if (!(id = strsep(&next, "\t")))
-        LOGE("Failed to extract network id");
+        ALOGE("Failed to extract network id");
     if (!(ssid = strsep(&next, "\t")))
-        LOGE("Failed to extract ssid");
+        ALOGE("Failed to extract ssid");
     if (!(bssid = strsep(&next, "\t")))
-        LOGE("Failed to extract bssid");
+        ALOGE("Failed to extract bssid");
     if (!(flags = strsep(&next, "\t")))
-        LOGE("Failed to extract flags");
+        ALOGE("Failed to extract flags");
 
-   // LOGD("id '%s', ssid '%s', bssid '%s', flags '%s'", id, ssid, bssid,
+   // ALOGD("id '%s', ssid '%s', bssid '%s', flags '%s'", id, ssid, bssid,
    //      flags ? flags :"null");
 
     if (id)
@@ -77,7 +77,7 @@
         if (!strcmp(flags, "[DISABLED]"))
             mEnabled = false;
         else
-            LOGW("Unsupported flags '%s'", flags);
+            ALOGW("Unsupported flags '%s'", flags);
     }
 
     free(tmp);
@@ -215,7 +215,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "key_mgmt", buffer, len)) {
         if (WifiNetwork::parseKeyManagementMask(buffer, &mask)) {
-            LOGE("Error parsing key_mgmt (%s)", strerror(errno));
+            ALOGE("Error parsing key_mgmt (%s)", strerror(errno));
         } else {
            mKeyManagement = mask;
         }
@@ -224,7 +224,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "proto", buffer, len)) {
         if (WifiNetwork::parseProtocolsMask(buffer, &mask)) {
-            LOGE("Error parsing proto (%s)", strerror(errno));
+            ALOGE("Error parsing proto (%s)", strerror(errno));
         } else {
            mProtocols = mask;
         }
@@ -233,7 +233,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "auth_alg", buffer, len)) {
         if (WifiNetwork::parseAuthAlgorithmsMask(buffer, &mask)) {
-            LOGE("Error parsing auth_alg (%s)", strerror(errno));
+            ALOGE("Error parsing auth_alg (%s)", strerror(errno));
         } else {
            mAuthAlgorithms = mask;
         }
@@ -242,7 +242,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "pairwise", buffer, len)) {
         if (WifiNetwork::parsePairwiseCiphersMask(buffer, &mask)) {
-            LOGE("Error parsing pairwise (%s)", strerror(errno));
+            ALOGE("Error parsing pairwise (%s)", strerror(errno));
         } else {
            mPairwiseCiphers = mask;
         }
@@ -251,7 +251,7 @@
     len = sizeof(buffer);
     if (mSuppl->getNetworkVar(mNetid, "group", buffer, len)) {
         if (WifiNetwork::parseGroupCiphersMask(buffer, &mask)) {
-            LOGE("Error parsing group (%s)", strerror(errno));
+            ALOGE("Error parsing group (%s)", strerror(errno));
         } else {
            mGroupCiphers = mask;
         }
@@ -259,7 +259,7 @@
 
     return 0;
 out_err:
-    LOGE("Refresh failed (%s)",strerror(errno));
+    ALOGE("Refresh failed (%s)",strerror(errno));
     return -1;
 }
 
@@ -453,12 +453,12 @@
 
     if (enabled) {
         if (getPriority() == -1) {
-            LOGE("Cannot enable network when priority is not set");
+            ALOGE("Cannot enable network when priority is not set");
             errno = EAGAIN;
             return -1;
         }
         if (getKeyManagement() == KeyManagementMask::UNKNOWN) {
-            LOGE("Cannot enable network when KeyManagement is not set");
+            ALOGE("Cannot enable network when KeyManagement is not set");
             errno = EAGAIN;
             return -1;
         }
@@ -511,7 +511,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseKeyManagementMask(%s)", buffer);
+//    ALOGD("parseKeyManagementMask(%s)", buffer);
     *mask = 0;
 
     while((v_token = strsep(&v_next, " "))) {
@@ -526,13 +526,13 @@
             else if (!strcasecmp(v_token, "IEEE8021X"))
                 *mask |= KeyManagementMask::IEEE8021X;
             else {
-                LOGW("Invalid KeyManagementMask value '%s'", v_token);
+                ALOGW("Invalid KeyManagementMask value '%s'", v_token);
                 errno = EINVAL;
                 free(v_tmp);
                 return -1;
             }
         } else {
-            LOGW("KeyManagementMask value '%s' when NONE", v_token);
+            ALOGW("KeyManagementMask value '%s' when NONE", v_token);
             errno = EINVAL;
             free(v_tmp);
             return -1;
@@ -548,7 +548,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseProtocolsMask(%s)", buffer);
+//    ALOGD("parseProtocolsMask(%s)", buffer);
     *mask = 0;
     while((v_token = strsep(&v_next, " "))) {
         if (!strcasecmp(v_token, "WPA"))
@@ -556,7 +556,7 @@
         else if (!strcasecmp(v_token, "RSN"))
             *mask |= SecurityProtocolMask::RSN;
         else {
-            LOGW("Invalid ProtocolsMask value '%s'", v_token);
+            ALOGW("Invalid ProtocolsMask value '%s'", v_token);
             errno = EINVAL;
             free(v_tmp);
             return -1;
@@ -573,7 +573,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseAuthAlgorithmsMask(%s)", buffer);
+//    ALOGD("parseAuthAlgorithmsMask(%s)", buffer);
 
     *mask = 0;
     if (buffer[0] == '\0')
@@ -587,7 +587,7 @@
         else if (!strcasecmp(v_token, "LEAP"))
             *mask |= AuthenticationAlgorithmMask::LEAP;
         else {
-            LOGW("Invalid AuthAlgorithmsMask value '%s'", v_token);
+            ALOGW("Invalid AuthAlgorithmsMask value '%s'", v_token);
             errno = EINVAL;
             free(v_tmp);
             return -1;
@@ -603,7 +603,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parsePairwiseCiphersMask(%s)", buffer);
+//    ALOGD("parsePairwiseCiphersMask(%s)", buffer);
 
     *mask = 0;
     while((v_token = strsep(&v_next, " "))) {
@@ -616,13 +616,13 @@
             else if (!strcasecmp(v_token, "CCMP"))
                 *mask |= PairwiseCiphersMask::CCMP;
         else {
-                LOGW("PairwiseCiphersMask value '%s' when NONE", v_token);
+                ALOGW("PairwiseCiphersMask value '%s' when NONE", v_token);
                 errno = EINVAL;
                 free(v_tmp);
                 return -1;
             }
         } else {
-            LOGW("Invalid PairwiseCiphersMask value '%s'", v_token);
+            ALOGW("Invalid PairwiseCiphersMask value '%s'", v_token);
             errno = EINVAL;
             free(v_tmp);
             return -1;
@@ -638,7 +638,7 @@
     char *v_next = v_tmp;
     char *v_token;
 
-//    LOGD("parseGroupCiphersMask(%s)", buffer);
+//    ALOGD("parseGroupCiphersMask(%s)", buffer);
 
     *mask = 0;
     while((v_token = strsep(&v_next, " "))) {
@@ -651,7 +651,7 @@
         else if (!strcasecmp(v_token, "CCMP"))
             *mask |= GroupCiphersMask::CCMP;
         else {
-            LOGW("Invalid GroupCiphersMask value '%s'", v_token);
+            ALOGW("Invalid GroupCiphersMask value '%s'", v_token);
             errno = EINVAL;
             free(v_tmp);
             return -1;
diff --git a/nexus/WifiScanner.cpp b/nexus/WifiScanner.cpp
index bdfa497..4c956ac 100644
--- a/nexus/WifiScanner.cpp
+++ b/nexus/WifiScanner.cpp
@@ -58,13 +58,13 @@
     char c = 0;
 
     if (write(mCtrlPipe[1], &c, 1) != 1) {
-        LOGE("Error writing to control pipe (%s)", strerror(errno));
+        ALOGE("Error writing to control pipe (%s)", strerror(errno));
         return -1;
     }
 
     void *ret;
     if (pthread_join(mThread, &ret)) {
-        LOGE("Error joining to scanner thread (%s)", strerror(errno));
+        ALOGE("Error joining to scanner thread (%s)", strerror(errno));
         return -1;
     }
 
@@ -74,7 +74,7 @@
 }
 
 void WifiScanner::run() {
-    LOGD("Starting wifi scanner (active = %d)", mActive);
+    ALOGD("Starting wifi scanner (active = %d)", mActive);
 
     while(1) {
         fd_set read_fds;
@@ -88,16 +88,16 @@
         FD_SET(mCtrlPipe[0], &read_fds);
 
         if (mSuppl->triggerScan(mActive)) {
-            LOGW("Error triggering scan (%s)", strerror(errno));
+            ALOGW("Error triggering scan (%s)", strerror(errno));
         }
 
         if ((rc = select(mCtrlPipe[0] + 1, &read_fds, NULL, NULL, &to)) < 0) {
-            LOGE("select failed (%s) - sleeping for one scanner period", strerror(errno));
+            ALOGE("select failed (%s) - sleeping for one scanner period", strerror(errno));
             sleep(mPeriod);
             continue;
         } else if (!rc) {
         } else if (FD_ISSET(mCtrlPipe[0], &read_fds))
             break;
     } // while
-    LOGD("Stopping wifi scanner");
+    ALOGD("Stopping wifi scanner");
 }
diff --git a/nexus/WifiStatusPoller.cpp b/nexus/WifiStatusPoller.cpp
index cf71733..015af5d 100644
--- a/nexus/WifiStatusPoller.cpp
+++ b/nexus/WifiStatusPoller.cpp
@@ -50,13 +50,13 @@
     char c = 0;
 
     if (write(mCtrlPipe[1], &c, 1) != 1) {
-        LOGE("Error writing to control pipe (%s)", strerror(errno));
+        ALOGE("Error writing to control pipe (%s)", strerror(errno));
         return -1;
     }
 
     void *ret;
     if (pthread_join(mThread, &ret)) {
-        LOGE("Error joining to listener thread (%s)", strerror(errno));
+        ALOGE("Error joining to listener thread (%s)", strerror(errno));
         return -1;
     }
     close(mCtrlPipe[0]);
@@ -68,10 +68,10 @@
     WifiStatusPoller *me = reinterpret_cast<WifiStatusPoller *>(obj);
 
     me->mStarted = true;
-    LOGD("Starting");
+    ALOGD("Starting");
     me->run();
     me->mStarted = false;
-    LOGD("Stopping");
+    ALOGD("Stopping");
     pthread_exit(NULL);
     return NULL;
 }
@@ -92,7 +92,7 @@
         max = mCtrlPipe[0];
 
         if ((rc = select(max + 1, &read_fds, NULL, NULL, &to)) < 0) {
-            LOGE("select failed (%s)", strerror(errno));
+            ALOGE("select failed (%s)", strerror(errno));
             sleep(1);
             continue;
         } else if (!rc) {
diff --git a/nexus/main.cpp b/nexus/main.cpp
index 936d33f..7d2af02 100644
--- a/nexus/main.cpp
+++ b/nexus/main.cpp
@@ -28,13 +28,13 @@
 #include "TiwlanWifiController.h"
 
 int main() {
-    LOGI("Nexus version 0.1 firing up");
+    ALOGI("Nexus version 0.1 firing up");
 
     CommandListener *cl = new CommandListener();
 
     NetworkManager *nm;
     if (!(nm = NetworkManager::Instance())) {
-        LOGE("Unable to create NetworkManager");
+        ALOGE("Unable to create NetworkManager");
         exit (-1);
     };
 
@@ -47,12 +47,12 @@
 
 
     if (NetworkManager::Instance()->run()) {
-        LOGE("Unable to Run NetworkManager (%s)", strerror(errno));
+        ALOGE("Unable to Run NetworkManager (%s)", strerror(errno));
         exit (1);
     }
 
     if (cl->startListener()) {
-        LOGE("Unable to start CommandListener (%s)", strerror(errno));
+        ALOGE("Unable to start CommandListener (%s)", strerror(errno));
         exit (1);
     }
 
@@ -62,6 +62,6 @@
         sleep(1000);
     }
 
-    LOGI("Nexus exiting");
+    ALOGI("Nexus exiting");
     exit(0);
 }
diff --git a/rootdir/init.rc b/rootdir/init.rc
index cad4cd8..290e375 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1,3 +1,5 @@
+import /init.${ro.hardware}.rc
+
 on early-init
     # Set init and its forked children's oom_adj.
     write /proc/1/oom_adj -16
@@ -299,7 +301,7 @@
     stop adbd
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/bDeviceClass 0
-    setprop sys.usb.state $sys.usb.config
+    setprop sys.usb.state ${sys.usb.config}
 
 # adb only USB configuration
 # This should only be used during device bringup
@@ -308,34 +310,34 @@
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 18d1
     write /sys/class/android_usb/android0/idProduct D002
-    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}
 
 # USB accessory configuration
 on property:sys.usb.config=accessory
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 18d1
     write /sys/class/android_usb/android0/idProduct 2d00
-    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}
 
 # USB accessory configuration, with adb
 on property:sys.usb.config=accessory,adb
     write /sys/class/android_usb/android0/enable 0
     write /sys/class/android_usb/android0/idVendor 18d1
     write /sys/class/android_usb/android0/idProduct 2d01
-    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}
 
 # Used to set USB configuration at boot and to switch the configuration
 # when changing the default configuration
 on property:persist.sys.usb.config=*
-    setprop sys.usb.config $persist.sys.usb.config
+    setprop sys.usb.config ${persist.sys.usb.config}
 
 ## Daemon processes to be run by init.
 ##
diff --git a/toolbox/rmmod.c b/toolbox/rmmod.c
index 7e10c06..25257cc 100644
--- a/toolbox/rmmod.c
+++ b/toolbox/rmmod.c
@@ -25,6 +25,8 @@
 	modname = strrchr(argv[1], '/');
 	if (!modname)
 		modname = argv[1];
+	else modname++;
+
 	dot = strchr(argv[1], '.');
 	if (dot)
 		*dot = '\0';
