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

Bug: 5449033
Change-Id: Ibcffdcf620ebae1c389446ce8e9d908f11ac039c
diff --git a/libdiskconfig/config_mbr.c b/libdiskconfig/config_mbr.c
index 07bd6a7..703484c 100644
--- a/libdiskconfig/config_mbr.c
+++ b/libdiskconfig/config_mbr.c
@@ -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 66bd0c3..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 :-) */
@@ -321,7 +321,7 @@
     } else if (S_ISREG(stat.st_mode)) {
         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,7 +331,7 @@
             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;
     }
 
@@ -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 be35763..e325735 100644
--- a/libdiskconfig/diskutils.c
+++ b/libdiskconfig/diskutils.c
@@ -42,18 +42,18 @@
 
     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,7 +94,7 @@
     }
 
     if (!done) {
-        LOGE("Exited read/write loop without setting flag! WTF?!");
+        ALOGE("Exited read/write loop without setting flag! WTF?!");
         goto fail;
     }
 
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 d99a807..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,13 +71,13 @@
 {
     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;
             }