diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index 12d16690f3ab6..6fe358c7ee54e 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -72,7 +72,7 @@ public: char* slashClassName = toSlashClassName(mClassName); mClass = env->FindClass(slashClassName); if (mClass == NULL) { - LOGE("ERROR: could not find class '%s'\n", mClassName); + ALOGE("ERROR: could not find class '%s'\n", mClassName); } free(slashClassName); diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index f2503671b6454..0d5b4caa91b47 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -69,7 +69,7 @@ BootAnimation::~BootAnimation() { void BootAnimation::onFirstRef() { status_t err = mSession->linkToComposerDeath(this); - LOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err)); + ALOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err)); if (err == NO_ERROR) { run("BootAnimation", PRIORITY_DISPLAY); } @@ -374,7 +374,7 @@ bool BootAnimation::movie() size_t numEntries = zip.getNumEntries(); ZipEntryRO desc = zip.findEntryByName("desc.txt"); FileMap* descMap = zip.createEntryFileMap(desc); - LOGE_IF(!descMap, "descMap is null"); + ALOGE_IF(!descMap, "descMap is null"); if (!descMap) { return false; } diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index a07a408033bd6..afa4f4db10a05 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -317,15 +317,15 @@ int main(int argc, char *argv[]) { /* switch to non-root user and group */ gid_t groups[] = { AID_LOG, AID_SDCARD_RW, AID_MOUNT, AID_INET }; if (setgroups(sizeof(groups)/sizeof(groups[0]), groups) != 0) { - LOGE("Unable to setgroups, aborting: %s\n", strerror(errno)); + ALOGE("Unable to setgroups, aborting: %s\n", strerror(errno)); return -1; } if (setgid(AID_SHELL) != 0) { - LOGE("Unable to setgid, aborting: %s\n", strerror(errno)); + ALOGE("Unable to setgid, aborting: %s\n", strerror(errno)); return -1; } if (setuid(AID_SHELL) != 0) { - LOGE("Unable to setuid, aborting: %s\n", strerror(errno)); + ALOGE("Unable to setuid, aborting: %s\n", strerror(errno)); return -1; } } diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp index fdc5d5d63ecfa..7dad6b625b6a9 100644 --- a/cmds/dumpsys/dumpsys.cpp +++ b/cmds/dumpsys/dumpsys.cpp @@ -31,7 +31,7 @@ int main(int argc, char* const argv[]) sp sm = defaultServiceManager(); fflush(stdout); if (sm == NULL) { - LOGE("Unable to get default service manager!"); + ALOGE("Unable to get default service manager!"); aerr << "dumpsys: Unable to get default service manager!" << endl; return 20; } diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 4d8029621e9af..dd92bbe499bc3 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -30,47 +30,47 @@ int install(const char *pkgname, uid_t uid, gid_t gid) char libdir[PKG_PATH_MAX]; if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) { - LOGE("invalid uid/gid: %d %d\n", uid, gid); + ALOGE("invalid uid/gid: %d %d\n", uid, gid); return -1; } if (create_pkg_path(pkgdir, pkgname, PKG_DIR_POSTFIX, 0)) { - LOGE("cannot create package path\n"); + ALOGE("cannot create package path\n"); return -1; } if (create_pkg_path(libdir, pkgname, PKG_LIB_POSTFIX, 0)) { - LOGE("cannot create package lib path\n"); + ALOGE("cannot create package lib path\n"); return -1; } if (mkdir(pkgdir, 0751) < 0) { - LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); return -errno; } if (chmod(pkgdir, 0751) < 0) { - LOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } if (chown(pkgdir, uid, gid) < 0) { - LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } if (mkdir(libdir, 0755) < 0) { - LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); unlink(pkgdir); return -errno; } if (chmod(libdir, 0755) < 0) { - LOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; } if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) { - LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; @@ -100,7 +100,7 @@ int renamepkg(const char *oldpkgname, const char *newpkgname) return -1; if (rename(oldpkgdir, newpkgdir) < 0) { - LOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno)); + ALOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno)); return -errno; } return 0; @@ -127,11 +127,11 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona) return -1; } if (mkdir(pkgdir, 0751) < 0) { - LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); return -errno; } if (chown(pkgdir, uid, uid) < 0) { - LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } @@ -165,7 +165,7 @@ static int64_t disk_free() if (statfs(android_data_dir.path, &sfs) == 0) { return sfs.f_bavail * sfs.f_bsize; } else { - LOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); + ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); return -1; } } @@ -193,13 +193,13 @@ int free_cache(int64_t free_size) if (avail >= free_size) return 0; if (create_persona_path(datadir, 0)) { - LOGE("couldn't get directory for persona 0"); + ALOGE("couldn't get directory for persona 0"); return -1; } d = opendir(datadir); if (d == NULL) { - LOGE("cannot open %s: %s\n", datadir, strerror(errno)); + ALOGE("cannot open %s: %s\n", datadir, strerror(errno)); return -1; } dfd = dirfd(d); @@ -245,7 +245,7 @@ int move_dex(const char *src, const char *dst) ALOGV("move %s -> %s\n", src_dex, dst_dex); if (rename(src_dex, dst_dex) < 0) { - LOGE("Couldn't move %s: %s\n", src_dex, strerror(errno)); + ALOGE("Couldn't move %s: %s\n", src_dex, strerror(errno)); return -1; } else { return 0; @@ -261,7 +261,7 @@ int rm_dex(const char *path) ALOGV("unlink %s\n", dex_path); if (unlink(dex_path) < 0) { - LOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno)); + ALOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno)); return -1; } else { return 0; @@ -281,12 +281,12 @@ int protect(char *pkgname, gid_t gid) if (stat(pkgpath, &s) < 0) return -1; if (chown(pkgpath, s.st_uid, gid) < 0) { - LOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno)); + ALOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno)); return -1; } if (chmod(pkgpath, S_IRUSR|S_IWUSR|S_IRGRP) < 0) { - LOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno)); return -1; } @@ -443,7 +443,7 @@ static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name, execl(DEX_OPT_BIN, DEX_OPT_BIN, "--zip", zip_num, odex_num, input_file_name, dexopt_flags, (char*) NULL); - LOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno)); + ALOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno)); } static int wait_dexopt(pid_t pid, const char* apk_path) @@ -515,24 +515,24 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) zip_fd = open(apk_path, O_RDONLY, 0); if (zip_fd < 0) { - LOGE("dexopt cannot open '%s' for input\n", apk_path); + ALOGE("dexopt cannot open '%s' for input\n", apk_path); return -1; } unlink(dex_path); odex_fd = open(dex_path, O_RDWR | O_CREAT | O_EXCL, 0644); if (odex_fd < 0) { - LOGE("dexopt cannot open '%s' for output\n", dex_path); + ALOGE("dexopt cannot open '%s' for output\n", dex_path); goto fail; } if (fchown(odex_fd, AID_SYSTEM, uid) < 0) { - LOGE("dexopt cannot chown '%s'\n", dex_path); + ALOGE("dexopt cannot chown '%s'\n", dex_path); goto fail; } if (fchmod(odex_fd, S_IRUSR|S_IWUSR|S_IRGRP | (is_public ? S_IROTH : 0)) < 0) { - LOGE("dexopt cannot chmod '%s'\n", dex_path); + ALOGE("dexopt cannot chmod '%s'\n", dex_path); goto fail; } @@ -543,15 +543,15 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) if (pid == 0) { /* child -- drop privileges before continuing */ if (setgid(uid) != 0) { - LOGE("setgid(%d) failed during dexopt\n", uid); + ALOGE("setgid(%d) failed during dexopt\n", uid); exit(64); } if (setuid(uid) != 0) { - LOGE("setuid(%d) during dexopt\n", uid); + ALOGE("setuid(%d) during dexopt\n", uid); exit(65); } if (flock(odex_fd, LOCK_EX | LOCK_NB) != 0) { - LOGE("flock(%s) failed: %s\n", dex_path, strerror(errno)); + ALOGE("flock(%s) failed: %s\n", dex_path, strerror(errno)); exit(66); } @@ -560,7 +560,7 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) } else { res = wait_dexopt(pid, apk_path); if (res != 0) { - LOGE("dexopt failed on '%s' res = %d\n", dex_path, res); + ALOGE("dexopt failed on '%s' res = %d\n", dex_path, res); goto fail; } } @@ -626,7 +626,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos, ALOGV("Renaming %s to %s (uid %d)\n", srcpath, dstpath, dstuid); if (rename(srcpath, dstpath) >= 0) { if (chown(dstpath, dstuid, dstgid) < 0) { - LOGE("cannot chown %s: %s\n", dstpath, strerror(errno)); + ALOGE("cannot chown %s: %s\n", dstpath, strerror(errno)); unlink(dstpath); return 1; } @@ -852,30 +852,30 @@ int linklib(const char* dataDir, const char* asecLibDir) const size_t libdirLen = strlen(dataDir) + strlen(PKG_LIB_POSTFIX); if (libdirLen >= PKG_PATH_MAX) { - LOGE("library dir len too large"); + ALOGE("library dir len too large"); return -1; } if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) { - LOGE("library dir not written successfully: %s\n", strerror(errno)); + ALOGE("library dir not written successfully: %s\n", strerror(errno)); return -1; } if (stat(dataDir, &s) < 0) return -1; if (chown(dataDir, 0, 0) < 0) { - LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); return -1; } if (chmod(dataDir, 0700) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); rc = -1; goto out; } if (lstat(libdir, &libStat) < 0) { - LOGE("couldn't stat lib dir: %s\n", strerror(errno)); + ALOGE("couldn't stat lib dir: %s\n", strerror(errno)); rc = -1; goto out; } @@ -893,13 +893,13 @@ int linklib(const char* dataDir, const char* asecLibDir) } if (symlink(asecLibDir, libdir) < 0) { - LOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno)); + ALOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno)); rc = -errno; goto out; } if (lchown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) { - LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); rc = -errno; goto out; @@ -907,12 +907,12 @@ int linklib(const char* dataDir, const char* asecLibDir) out: if (chmod(dataDir, s.st_mode) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); return -errno; } if (chown(dataDir, s.st_uid, s.st_gid) < 0) { - LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); return -errno; } @@ -931,28 +931,28 @@ int unlinklib(const char* dataDir) } if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) { - LOGE("library dir not written successfully: %s\n", strerror(errno)); + ALOGE("library dir not written successfully: %s\n", strerror(errno)); return -1; } if (stat(dataDir, &s) < 0) { - LOGE("couldn't state data dir"); + ALOGE("couldn't state data dir"); return -1; } if (chown(dataDir, 0, 0) < 0) { - LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); return -1; } if (chmod(dataDir, 0700) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); rc = -1; goto out; } if (lstat(libdir, &libStat) < 0) { - LOGE("couldn't stat lib dir: %s\n", strerror(errno)); + ALOGE("couldn't stat lib dir: %s\n", strerror(errno)); rc = -1; goto out; } @@ -970,13 +970,13 @@ int unlinklib(const char* dataDir) } if (mkdir(libdir, 0755) < 0) { - LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); rc = -errno; goto out; } if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) { - LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); rc = -errno; goto out; @@ -984,12 +984,12 @@ int unlinklib(const char* dataDir) out: if (chmod(dataDir, s.st_mode) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); return -1; } if (chown(dataDir, s.st_uid, s.st_gid) < 0) { - LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); return -1; } diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 159bccbf7934f..569b491be012a 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -157,11 +157,11 @@ static int readx(int s, void *_buf, int count) r = read(s, buf + n, count - n); if (r < 0) { if (errno == EINTR) continue; - LOGE("read error: %s\n", strerror(errno)); + ALOGE("read error: %s\n", strerror(errno)); return -1; } if (r == 0) { - LOGE("eof\n"); + ALOGE("eof\n"); return -1; /* EOF */ } n += r; @@ -178,7 +178,7 @@ static int writex(int s, const void *_buf, int count) r = write(s, buf + n, count - n); if (r < 0) { if (errno == EINTR) continue; - LOGE("write error: %s\n", strerror(errno)); + ALOGE("write error: %s\n", strerror(errno)); return -1; } n += r; @@ -213,7 +213,7 @@ static int execute(int s, char cmd[BUFFER_MAX]) n++; arg[n] = cmd; if (n == TOKEN_MAX) { - LOGE("too many arguments\n"); + ALOGE("too many arguments\n"); goto done; } } @@ -223,7 +223,7 @@ static int execute(int s, char cmd[BUFFER_MAX]) for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) { if (!strcmp(cmds[i].name,arg[0])) { if (n != cmds[i].numargs) { - LOGE("%s requires %d arguments (%d given)\n", + ALOGE("%s requires %d arguments (%d given)\n", cmds[i].name, cmds[i].numargs, n); } else { ret = cmds[i].func(arg + 1, reply); @@ -231,7 +231,7 @@ static int execute(int s, char cmd[BUFFER_MAX]) goto done; } } - LOGE("unsupported command '%s'\n", arg[0]); + ALOGE("unsupported command '%s'\n", arg[0]); done: if (reply[0]) { @@ -290,7 +290,7 @@ int initialize_globals() { android_system_dirs.dirs = calloc(android_system_dirs.count, sizeof(dir_rec_t)); if (android_system_dirs.dirs == NULL) { - LOGE("Couldn't allocate array for dirs; aborting\n"); + ALOGE("Couldn't allocate array for dirs; aborting\n"); return -1; } @@ -351,22 +351,22 @@ int main(const int argc, const char *argv[]) { int lsocket, s, count; if (initialize_globals() < 0) { - LOGE("Could not initialize globals; exiting.\n"); + ALOGE("Could not initialize globals; exiting.\n"); exit(1); } if (initialize_directories() < 0) { - LOGE("Could not create directories; exiting.\n"); + ALOGE("Could not create directories; exiting.\n"); exit(1); } lsocket = android_get_control_socket(SOCKET_PATH); if (lsocket < 0) { - LOGE("Failed to get socket from environment: %s\n", strerror(errno)); + ALOGE("Failed to get socket from environment: %s\n", strerror(errno)); exit(1); } if (listen(lsocket, 5)) { - LOGE("Listen on socket failed: %s\n", strerror(errno)); + ALOGE("Listen on socket failed: %s\n", strerror(errno)); exit(1); } fcntl(lsocket, F_SETFD, FD_CLOEXEC); @@ -375,7 +375,7 @@ int main(const int argc, const char *argv[]) { alen = sizeof(addr); s = accept(lsocket, &addr, &alen); if (s < 0) { - LOGE("Accept failed: %s\n", strerror(errno)); + ALOGE("Accept failed: %s\n", strerror(errno)); continue; } fcntl(s, F_SETFD, FD_CLOEXEC); @@ -384,15 +384,15 @@ int main(const int argc, const char *argv[]) { for (;;) { unsigned short count; if (readx(s, &count, sizeof(count))) { - LOGE("failed to read size\n"); + ALOGE("failed to read size\n"); break; } if ((count < 1) || (count >= BUFFER_MAX)) { - LOGE("invalid size %d\n", count); + ALOGE("invalid size %d\n", count); break; } if (readx(s, buf, count)) { - LOGE("failed to read command\n"); + ALOGE("failed to read command\n"); break; } buf[count] = 0; diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c index 940626e532406..52ec9e86a44a0 100644 --- a/cmds/installd/utils.c +++ b/cmds/installd/utils.c @@ -42,7 +42,7 @@ int create_pkg_path_in_dir(char path[PKG_PATH_MAX], if (append_and_increment(&dst, dir->path, &dst_size) < 0 || append_and_increment(&dst, pkgname, &dst_size) < 0 || append_and_increment(&dst, postfix, &dst_size) < 0) { - LOGE("Error building APK path"); + ALOGE("Error building APK path"); return -1; } @@ -76,7 +76,7 @@ int create_pkg_path(char path[PKG_PATH_MAX], if (append_and_increment(&dst, android_data_dir.path, &dst_size) < 0 || append_and_increment(&dst, persona_prefix, &dst_size) < 0) { - LOGE("Error building prefix for APK path"); + ALOGE("Error building prefix for APK path"); return -1; } @@ -117,18 +117,18 @@ int create_persona_path(char path[PKG_PATH_MAX], if (append_and_increment(&dst, android_data_dir.path, &dst_size) < 0 || append_and_increment(&dst, persona_prefix, &dst_size) < 0) { - LOGE("Error building prefix for user path"); + ALOGE("Error building prefix for user path"); return -1; } if (persona != 0) { if (dst_size < uid_len + 1) { - LOGE("Error building user path"); + ALOGE("Error building user path"); return -1; } int ret = snprintf(dst, dst_size, "%d/", persona); if (ret < 0 || (size_t) ret != uid_len) { - LOGE("Error appending persona id to path"); + ALOGE("Error appending persona id to path"); return -1; } } @@ -163,7 +163,7 @@ int is_valid_package_name(const char* pkgname) { } else if (*x == '.') { if ((x == pkgname) || (x[1] == '.') || (x[1] == 0)) { /* periods must not be first, last, or doubled */ - LOGE("invalid package name '%s'\n", pkgname); + ALOGE("invalid package name '%s'\n", pkgname); return -1; } } else if (*x == '-') { @@ -172,7 +172,7 @@ int is_valid_package_name(const char* pkgname) { alpha = 1; } else { /* anything not A-Z, a-z, 0-9, _, or . is invalid */ - LOGE("invalid package name '%s'\n", pkgname); + ALOGE("invalid package name '%s'\n", pkgname); return -1; } @@ -184,7 +184,7 @@ int is_valid_package_name(const char* pkgname) { x++; while (*x) { if (!isalnum(*x)) { - LOGE("invalid package name '%s' should include only numbers after -\n", pkgname); + ALOGE("invalid package name '%s' should include only numbers after -\n", pkgname); return -1; } x++; @@ -222,13 +222,13 @@ static int _delete_dir_contents(DIR *d, const char *ignore) subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (subfd < 0) { - LOGE("Couldn't openat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't openat %s: %s\n", name, strerror(errno)); result = -1; continue; } subdir = fdopendir(subfd); if (subdir == NULL) { - LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); close(subfd); result = -1; continue; @@ -238,12 +238,12 @@ static int _delete_dir_contents(DIR *d, const char *ignore) } closedir(subdir); if (unlinkat(dfd, name, AT_REMOVEDIR) < 0) { - LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); result = -1; } } else { if (unlinkat(dfd, name, 0) < 0) { - LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); result = -1; } } @@ -261,14 +261,14 @@ int delete_dir_contents(const char *pathname, d = opendir(pathname); if (d == NULL) { - LOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno)); + ALOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno)); return -errno; } res = _delete_dir_contents(d, ignore); closedir(d); if (also_delete_dir) { if (rmdir(pathname)) { - LOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno)); + ALOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno)); res = -1; } } @@ -282,12 +282,12 @@ int delete_dir_contents_fd(int dfd, const char *name) fd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (fd < 0) { - LOGE("Couldn't openat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't openat %s: %s\n", name, strerror(errno)); return -1; } d = fdopendir(fd); if (d == NULL) { - LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); close(fd); return -1; } @@ -307,7 +307,7 @@ int validate_system_app_path(const char* path) { const size_t dir_len = android_system_dirs.dirs[i].len; if (!strncmp(path, android_system_dirs.dirs[i].path, dir_len)) { if (path[dir_len] == '.' || strchr(path + dir_len, '/') != NULL) { - LOGE("invalid system apk path '%s' (trickery)\n", path); + ALOGE("invalid system apk path '%s' (trickery)\n", path); return -1; } return 0; @@ -377,7 +377,7 @@ int get_path_from_string(dir_rec_t* rec, const char* path) { if (append_and_increment(&dst, path, &dst_size) < 0 || append_and_increment(&dst, "/", &dst_size)) { - LOGE("Error canonicalizing path"); + ALOGE("Error canonicalizing path"); return -1; } @@ -395,7 +395,7 @@ int copy_and_append(dir_rec_t* dst, const dir_rec_t* src, const char* suffix) { if (dst->path == NULL || snprintf(dst->path, dstSize, "%s%s", src->path, suffix) != (ssize_t) dst->len) { - LOGE("Could not allocate memory to hold appended path; aborting\n"); + ALOGE("Could not allocate memory to hold appended path; aborting\n"); return -1; } @@ -422,7 +422,7 @@ int validate_apk_path(const char *path) dir_len = android_asec_dir.len; allowsubdir = 1; } else { - LOGE("invalid apk path '%s' (bad prefix)\n", path); + ALOGE("invalid apk path '%s' (bad prefix)\n", path); return -1; } @@ -435,7 +435,7 @@ int validate_apk_path(const char *path) ++subdir; if (!allowsubdir || (path_len > (size_t) (subdir - path) && (strchr(subdir, '/') != NULL))) { - LOGE("invalid apk path '%s' (subdir?)\n", path); + ALOGE("invalid apk path '%s' (subdir?)\n", path); return -1; } } @@ -446,7 +446,7 @@ int validate_apk_path(const char *path) */ if (path[dir_len] == '.' || (subdir != NULL && ((*subdir == '.') || (strchr(subdir, '/') != NULL)))) { - LOGE("invalid apk path '%s' (trickery)\n", path); + ALOGE("invalid apk path '%s' (trickery)\n", path); return -1; } diff --git a/cmds/ip-up-vpn/ip-up-vpn.c b/cmds/ip-up-vpn/ip-up-vpn.c index 0e6286f9279c5..9fcc950c229a4 100644 --- a/cmds/ip-up-vpn/ip-up-vpn.c +++ b/cmds/ip-up-vpn/ip-up-vpn.c @@ -67,7 +67,7 @@ int main(int argc, char **argv) { FILE *state = fopen(DIR ".tmp", "wb"); if (!state) { - LOGE("Cannot create state: %s", strerror(errno)); + ALOGE("Cannot create state: %s", strerror(errno)); return 1; } @@ -97,7 +97,7 @@ int main(int argc, char **argv) while (!ioctl(s, SIOCDELRT, &rt)); } if (errno != ESRCH) { - LOGE("Cannot remove host route: %s", strerror(errno)); + ALOGE("Cannot remove host route: %s", strerror(errno)); return 1; } @@ -105,7 +105,7 @@ int main(int argc, char **argv) rt.rt_flags |= RTF_GATEWAY; if (!set_address(&rt.rt_gateway, argv[1]) || (ioctl(s, SIOCADDRT, &rt) && errno != EEXIST)) { - LOGE("Cannot create host route: %s", strerror(errno)); + ALOGE("Cannot create host route: %s", strerror(errno)); return 1; } @@ -113,21 +113,21 @@ int main(int argc, char **argv) ifr.ifr_flags = IFF_UP; strncpy(ifr.ifr_name, interface, IFNAMSIZ); if (ioctl(s, SIOCSIFFLAGS, &ifr)) { - LOGE("Cannot bring up %s: %s", interface, strerror(errno)); + ALOGE("Cannot bring up %s: %s", interface, strerror(errno)); return 1; } /* Set the address. */ if (!set_address(&ifr.ifr_addr, address) || ioctl(s, SIOCSIFADDR, &ifr)) { - LOGE("Cannot set address: %s", strerror(errno)); + ALOGE("Cannot set address: %s", strerror(errno)); return 1; } /* Set the netmask. */ if (set_address(&ifr.ifr_netmask, env("INTERNAL_NETMASK4"))) { if (ioctl(s, SIOCSIFNETMASK, &ifr)) { - LOGE("Cannot set netmask: %s", strerror(errno)); + ALOGE("Cannot set netmask: %s", strerror(errno)); return 1; } } @@ -140,13 +140,13 @@ int main(int argc, char **argv) fprintf(state, "%s\n", env("INTERNAL_DNS4_LIST")); fprintf(state, "%s\n", env("DEFAULT_DOMAIN")); } else { - LOGE("Cannot parse parameters"); + ALOGE("Cannot parse parameters"); return 1; } fclose(state); if (chmod(DIR ".tmp", 0444) || rename(DIR ".tmp", DIR "state")) { - LOGE("Cannot write state: %s", strerror(errno)); + ALOGE("Cannot write state: %s", strerror(errno)); return 1; } return 0; diff --git a/cmds/keystore/keystore.cpp b/cmds/keystore/keystore.cpp index 6ca31a660bf3a..05f77e5326d90 100644 --- a/cmds/keystore/keystore.cpp +++ b/cmds/keystore/keystore.cpp @@ -133,7 +133,7 @@ public: const char* randomDevice = "/dev/urandom"; mRandom = ::open(randomDevice, O_RDONLY); if (mRandom == -1) { - LOGE("open: %s: %s", randomDevice, strerror(errno)); + ALOGE("open: %s: %s", randomDevice, strerror(errno)); return false; } return true; @@ -754,11 +754,11 @@ static ResponseCode process(KeyStore* keyStore, int sock, uid_t uid, int8_t code int main(int argc, char* argv[]) { int controlSocket = android_get_control_socket("keystore"); if (argc < 2) { - LOGE("A directory must be specified!"); + ALOGE("A directory must be specified!"); return 1; } if (chdir(argv[1]) == -1) { - LOGE("chdir: %s: %s", argv[1], strerror(errno)); + ALOGE("chdir: %s: %s", argv[1], strerror(errno)); return 1; } @@ -767,7 +767,7 @@ int main(int argc, char* argv[]) { return 1; } if (listen(controlSocket, 3) == -1) { - LOGE("listen: %s", strerror(errno)); + ALOGE("listen: %s", strerror(errno)); return 1; } @@ -805,6 +805,6 @@ int main(int argc, char* argv[]) { } close(sock); } - LOGE("accept: %s", strerror(errno)); + ALOGE("accept: %s", strerror(errno)); return 1; } diff --git a/cmds/screenshot/screenshot.c b/cmds/screenshot/screenshot.c index 048636c64e537..cca80c3c1abdf 100644 --- a/cmds/screenshot/screenshot.c +++ b/cmds/screenshot/screenshot.c @@ -26,20 +26,20 @@ void take_screenshot(FILE *fb_in, FILE *fb_out) { fb = fileno(fb_in); if(fb < 0) { - LOGE("failed to open framebuffer\n"); + ALOGE("failed to open framebuffer\n"); return; } fb_in = fdopen(fb, "r"); if(ioctl(fb, FBIOGET_VSCREENINFO, &vinfo) < 0) { - LOGE("failed to get framebuffer info\n"); + ALOGE("failed to get framebuffer info\n"); return; } fcntl(fb, F_SETFD, FD_CLOEXEC); png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png == NULL) { - LOGE("failed png_create_write_struct\n"); + ALOGE("failed png_create_write_struct\n"); fclose(fb_in); return; } @@ -47,13 +47,13 @@ void take_screenshot(FILE *fb_in, FILE *fb_out) { png_init_io(png, fb_out); info = png_create_info_struct(png); if (info == NULL) { - LOGE("failed png_create_info_struct\n"); + ALOGE("failed png_create_info_struct\n"); png_destroy_write_struct(&png, NULL); fclose(fb_in); return; } if (setjmp(png_jmpbuf(png))) { - LOGE("failed png setjmp\n"); + ALOGE("failed png setjmp\n"); png_destroy_write_struct(&png, NULL); fclose(fb_in); return; @@ -68,7 +68,7 @@ void take_screenshot(FILE *fb_in, FILE *fb_out) { rowlen=vinfo.xres * bytespp; if (rowlen > sizeof(imgbuf)) { - LOGE("crazy rowlen: %d\n", rowlen); + ALOGE("crazy rowlen: %d\n", rowlen); png_destroy_write_struct(&png, NULL); fclose(fb_in); return; diff --git a/cmds/servicemanager/binder.c b/cmds/servicemanager/binder.c index b03b62040b2f9..918d4d4e9633c 100644 --- a/cmds/servicemanager/binder.c +++ b/cmds/servicemanager/binder.c @@ -219,7 +219,7 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio, case BR_TRANSACTION: { struct binder_txn *txn = (void *) ptr; if ((end - ptr) * sizeof(uint32_t) < sizeof(struct binder_txn)) { - LOGE("parse: txn too small!\n"); + ALOGE("parse: txn too small!\n"); return -1; } binder_dump_txn(txn); @@ -240,7 +240,7 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio, case BR_REPLY: { struct binder_txn *txn = (void*) ptr; if ((end - ptr) * sizeof(uint32_t) < sizeof(struct binder_txn)) { - LOGE("parse: reply too small!\n"); + ALOGE("parse: reply too small!\n"); return -1; } binder_dump_txn(txn); @@ -266,7 +266,7 @@ int binder_parse(struct binder_state *bs, struct binder_io *bio, r = -1; break; default: - LOGE("parse: OOPS %d\n", cmd); + ALOGE("parse: OOPS %d\n", cmd); return -1; } } @@ -375,17 +375,17 @@ void binder_loop(struct binder_state *bs, binder_handler func) res = ioctl(bs->fd, BINDER_WRITE_READ, &bwr); if (res < 0) { - LOGE("binder_loop: ioctl failed (%s)\n", strerror(errno)); + ALOGE("binder_loop: ioctl failed (%s)\n", strerror(errno)); break; } res = binder_parse(bs, 0, readbuf, bwr.read_consumed, func); if (res == 0) { - LOGE("binder_loop: unexpected reply?!\n"); + ALOGE("binder_loop: unexpected reply?!\n"); break; } if (res < 0) { - LOGE("binder_loop: io error %d %s\n", res, strerror(errno)); + ALOGE("binder_loop: io error %d %s\n", res, strerror(errno)); break; } } diff --git a/cmds/servicemanager/service_manager.c b/cmds/servicemanager/service_manager.c index 6ad114aa476cd..42d8977339ee3 100644 --- a/cmds/servicemanager/service_manager.c +++ b/cmds/servicemanager/service_manager.c @@ -12,7 +12,7 @@ #if 0 #define ALOGI(x...) fprintf(stderr, "svcmgr: " x) -#define LOGE(x...) fprintf(stderr, "svcmgr: " x) +#define ALOGE(x...) fprintf(stderr, "svcmgr: " x) #else #define LOG_TAG "ServiceManager" #include @@ -152,7 +152,7 @@ int do_add_service(struct binder_state *bs, return -1; if (!svc_can_register(uid, s)) { - LOGE("add_service('%s',%p) uid=%d - PERMISSION DENIED\n", + ALOGE("add_service('%s',%p) uid=%d - PERMISSION DENIED\n", str8(s), ptr, uid); return -1; } @@ -160,7 +160,7 @@ int do_add_service(struct binder_state *bs, si = find_svc(s, len); if (si) { if (si->ptr) { - LOGE("add_service('%s',%p) uid=%d - ALREADY REGISTERED, OVERRIDE\n", + ALOGE("add_service('%s',%p) uid=%d - ALREADY REGISTERED, OVERRIDE\n", str8(s), ptr, uid); svcinfo_death(bs, si); } @@ -168,7 +168,7 @@ int do_add_service(struct binder_state *bs, } else { si = malloc(sizeof(*si) + (len + 1) * sizeof(uint16_t)); if (!si) { - LOGE("add_service('%s',%p) uid=%d - OUT OF MEMORY\n", + ALOGE("add_service('%s',%p) uid=%d - OUT OF MEMORY\n", str8(s), ptr, uid); return -1; } @@ -246,7 +246,7 @@ int svcmgr_handler(struct binder_state *bs, return -1; } default: - LOGE("unknown code %d\n", txn->code); + ALOGE("unknown code %d\n", txn->code); return -1; } @@ -262,7 +262,7 @@ int main(int argc, char **argv) bs = binder_open(128*1024); if (binder_become_context_manager(bs)) { - LOGE("cannot become context manager (%s)\n", strerror(errno)); + ALOGE("cannot become context manager (%s)\n", strerror(errno)); return -1; } diff --git a/cmds/stagefright/sf2.cpp b/cmds/stagefright/sf2.cpp index 7551d31f389d5..ae80f8804992c 100644 --- a/cmds/stagefright/sf2.cpp +++ b/cmds/stagefright/sf2.cpp @@ -454,7 +454,7 @@ private: if (sizeNeeded > sizeLeft) { if (outBuffer->size() == 0) { - LOGE("Unable to fit even a single input buffer of size %d.", + ALOGE("Unable to fit even a single input buffer of size %d.", sizeNeeded); } CHECK_GT(outBuffer->size(), 0u); diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index f52df1f56d771..1c0d7cf280f25 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -295,7 +295,7 @@ status_t AndroidRuntime::callMain(const char* className, methodId = env->GetStaticMethodID(clazz, "main", "([Ljava/lang/String;)V"); if (methodId == NULL) { - LOGE("ERROR: could not find method %s.main(String[])\n", className); + ALOGE("ERROR: could not find method %s.main(String[])\n", className); return UNKNOWN_ERROR; } @@ -766,7 +766,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) * JNI calls. */ if (JNI_CreateJavaVM(pJavaVM, pEnv, &initArgs) < 0) { - LOGE("JNI_CreateJavaVM failed\n"); + ALOGE("JNI_CreateJavaVM failed\n"); goto bail; } @@ -838,7 +838,7 @@ void AndroidRuntime::start(const char* className, const char* options) * Register android functions. */ if (startReg(env) < 0) { - LOGE("Unable to register all android natives\n"); + ALOGE("Unable to register all android natives\n"); return; } @@ -869,13 +869,13 @@ void AndroidRuntime::start(const char* className, const char* options) char* slashClassName = toSlashClassName(className); jclass startClass = env->FindClass(slashClassName); if (startClass == NULL) { - LOGE("JavaVM unable to locate class '%s'\n", slashClassName); + ALOGE("JavaVM unable to locate class '%s'\n", slashClassName); /* keep going */ } else { jmethodID startMeth = env->GetStaticMethodID(startClass, "main", "([Ljava/lang/String;)V"); if (startMeth == NULL) { - LOGE("JavaVM unable to find main() in '%s'\n", className); + ALOGE("JavaVM unable to find main() in '%s'\n", className); /* keep going */ } else { env->CallStaticVoidMethod(startClass, startMeth, strArray); @@ -961,7 +961,7 @@ static int javaDetachThread(void) result = vm->DetachCurrentThread(); if (result != JNI_OK) - LOGE("ERROR: thread detach failed\n"); + ALOGE("ERROR: thread detach failed\n"); return result; } diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp index 1362fc85c65a8..40ac7087f8cb8 100644 --- a/core/jni/android/graphics/Canvas.cpp +++ b/core/jni/android/graphics/Canvas.cpp @@ -770,7 +770,7 @@ public: value = TextLayoutCache::getInstance().getValue(paint, textArray, start, count, contextCount, flags); if (value == NULL) { - LOGE("Cannot get TextLayoutCache value"); + ALOGE("Cannot get TextLayoutCache value"); return ; } #else diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp index 64bd20775ac1d..47ffd948c6f09 100644 --- a/core/jni/android/graphics/Graphics.cpp +++ b/core/jni/android/graphics/Graphics.cpp @@ -40,7 +40,7 @@ void doThrowIOE(JNIEnv* env, const char* msg) { bool GraphicsJNI::hasException(JNIEnv *env) { if (env->ExceptionCheck() != 0) { - LOGE("*** Uncaught exception returned from Java call!\n"); + ALOGE("*** Uncaught exception returned from Java call!\n"); env->ExceptionDescribe(); return true; } diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp index 9e697b4ee955b..3d350ed904529 100644 --- a/core/jni/android/graphics/SurfaceTexture.cpp +++ b/core/jni/android/graphics/SurfaceTexture.cpp @@ -112,7 +112,7 @@ JNIEnv* JNISurfaceTextureContext::getJNIEnv(bool* needsDetach) { JavaVM* vm = AndroidRuntime::getJavaVM(); int result = vm->AttachCurrentThread(&env, (void*) &args); if (result != JNI_OK) { - LOGE("thread attach failed: %#x", result); + ALOGE("thread attach failed: %#x", result); return NULL; } *needsDetach = true; @@ -124,7 +124,7 @@ void JNISurfaceTextureContext::detachJNI() { JavaVM* vm = AndroidRuntime::getJavaVM(); int result = vm->DetachCurrentThread(); if (result != JNI_OK) { - LOGE("thread detach failed: %#x", result); + ALOGE("thread detach failed: %#x", result); } } @@ -164,14 +164,14 @@ static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz) fields.surfaceTexture = env->GetFieldID(clazz, ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID, "I"); if (fields.surfaceTexture == NULL) { - LOGE("can't find android/graphics/SurfaceTexture.%s", + ALOGE("can't find android/graphics/SurfaceTexture.%s", ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID); } fields.postEvent = env->GetStaticMethodID(clazz, "postEventFromNative", "(Ljava/lang/Object;)V"); if (fields.postEvent == NULL) { - LOGE("can't find android/graphics/SurfaceTexture.postEventFromNative"); + ALOGE("can't find android/graphics/SurfaceTexture.postEventFromNative"); } } diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp index 93717f3da8c7a..929df540d43ff 100644 --- a/core/jni/android/opengl/util.cpp +++ b/core/jni/android/opengl/util.cpp @@ -1062,7 +1062,7 @@ int register_android_opengl_classes(JNIEnv* env) result = AndroidRuntime::registerNativeMethods(env, cri->classPath, cri->methods, cri->methodCount); if (result < 0) { - LOGE("Failed to register %s: %d", cri->classPath, result); + ALOGE("Failed to register %s: %d", cri->classPath, result); break; } } diff --git a/core/jni/android_app_NativeActivity.cpp b/core/jni/android_app_NativeActivity.cpp index 7f5ba85f20433..ac4fe5b1c6be3 100644 --- a/core/jni/android_app_NativeActivity.cpp +++ b/core/jni/android_app_NativeActivity.cpp @@ -203,7 +203,7 @@ int32_t AInputQueue::getEvent(AInputEvent** outEvent) { int32_t res = mConsumer.receiveDispatchSignal(); if (res != android::OK) { - LOGE("channel '%s' ~ Failed to receive dispatch signal. status=%d", + ALOGE("channel '%s' ~ Failed to receive dispatch signal. status=%d", mConsumer.getChannel()->getName().string(), res); return -1; } @@ -548,7 +548,7 @@ void android_NativeActivity_hideSoftInput( static bool checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodName) { if (env->ExceptionCheck()) { - LOGE("An exception was thrown by callback '%s'.", methodName); + ALOGE("An exception was thrown by callback '%s'.", methodName); LOGE_EX(env); env->ExceptionClear(); return true; @@ -585,7 +585,7 @@ static int mainWorkCallback(int fd, int events, void* data) { checkAndClearExceptionFromCallback(code->env, "dispatchUnhandledKeyEvent"); code->env->DeleteLocalRef(inputEventObj); } else { - LOGE("Failed to obtain key event for dispatchUnhandledKeyEvent."); + ALOGE("Failed to obtain key event for dispatchUnhandledKeyEvent."); handled = false; } code->nativeInputQueue->finishEvent(keyEvent, handled, true); @@ -600,7 +600,7 @@ static int mainWorkCallback(int fd, int events, void* data) { checkAndClearExceptionFromCallback(code->env, "preDispatchKeyEvent"); code->env->DeleteLocalRef(inputEventObj); } else { - LOGE("Failed to obtain key event for preDispatchKeyEvent."); + ALOGE("Failed to obtain key event for preDispatchKeyEvent."); } } } break; diff --git a/core/jni/android_app_backup_FullBackup.cpp b/core/jni/android_app_backup_FullBackup.cpp index 6ef62a9824f18..066a23e38e03a 100644 --- a/core/jni/android_app_backup_FullBackup.cpp +++ b/core/jni/android_app_backup_FullBackup.cpp @@ -97,12 +97,12 @@ static int backupToTar(JNIEnv* env, jobject clazz, jstring packageNameObj, // Validate if (!writer) { - LOGE("No output stream provided [%s]", path.string()); + ALOGE("No output stream provided [%s]", path.string()); return -1; } if (path.length() < rootpath.length()) { - LOGE("file path [%s] shorter than root path [%s]", + ALOGE("file path [%s] shorter than root path [%s]", path.string(), rootpath.string()); return -1; } diff --git a/core/jni/android_bluetooth_BluetoothAudioGateway.cpp b/core/jni/android_bluetooth_BluetoothAudioGateway.cpp index 3a1a13a742215..3b8fb7974140d 100755 --- a/core/jni/android_bluetooth_BluetoothAudioGateway.cpp +++ b/core/jni/android_bluetooth_BluetoothAudioGateway.cpp @@ -127,7 +127,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object) { #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { - LOGE("%s: out of memory!", __FUNCTION__); + ALOGE("%s: out of memory!", __FUNCTION__); return; } @@ -166,7 +166,7 @@ static void cleanupNativeDataNative(JNIEnv* env, jobject object) { static int set_nb(int sk, bool nb) { int flags = fcntl(sk, F_GETFL); if (flags < 0) { - LOGE("Can't get socket flags with fcntl(): %s (%d)", + ALOGE("Can't get socket flags with fcntl(): %s (%d)", strerror(errno), errno); close(sk); return -1; @@ -175,7 +175,7 @@ static int set_nb(int sk, bool nb) { if (nb) flags |= O_NONBLOCK; int status = fcntl(sk, F_SETFL, flags); if (status < 0) { - LOGE("Can't set socket to nonblocking mode with fcntl(): %s (%d)", + ALOGE("Can't set socket to nonblocking mode with fcntl(): %s (%d)", strerror(errno), errno); close(sk); return -1; @@ -198,7 +198,7 @@ static int do_accept(JNIEnv* env, jobject object, int ag_fd, int alen = sizeof(raddr); int nsk = accept(ag_fd, (struct sockaddr *) &raddr, &alen); if (nsk < 0) { - LOGE("Error on accept from socket fd %d: %s (%d).", + ALOGE("Error on accept from socket fd %d: %s (%d).", ag_fd, strerror(errno), errno); @@ -244,7 +244,7 @@ static inline int on_accept_set_fields(JNIEnv* env, jobject object, ag_fd, FD_ISSET(ag_fd, &rset)); if (ag_fd >= 0 && !FD_ISSET(ag_fd, &rset)) { - LOGE("WTF???"); + ALOGE("WTF???"); return -1; } } @@ -271,7 +271,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, int len = sizeof(tv); if (getsockopt(nat->hf_ag_rfcomm_channel, SOL_SOCKET, SO_RCVTIMEO, &tv, &len) < 0) { - LOGE("getsockopt(%d, SOL_SOCKET, SO_RCVTIMEO): %s (%d)", + ALOGE("getsockopt(%d, SOL_SOCKET, SO_RCVTIMEO): %s (%d)", nat->hf_ag_rfcomm_channel, strerror(errno), errno); @@ -284,7 +284,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, tv.tv_usec = 1000 * (timeout_ms % 1000); if (setsockopt(nat->hf_ag_rfcomm_channel, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) { - LOGE("setsockopt(%d, SOL_SOCKET, SO_RCVTIMEO): %s (%d)", + ALOGE("setsockopt(%d, SOL_SOCKET, SO_RCVTIMEO): %s (%d)", nat->hf_ag_rfcomm_channel, strerror(errno), errno); @@ -322,7 +322,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, FD_SET(nat->hs_ag_rfcomm_sock, &rset); } if (cnt == 0) { - LOGE("Neither HF nor HS listening sockets are open!"); + ALOGE("Neither HF nor HS listening sockets are open!"); return JNI_FALSE; } @@ -348,7 +348,7 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, if (n <= 0) { if (n < 0) { - LOGE("listening select() on RFCOMM sockets: %s (%d)", + ALOGE("listening select() on RFCOMM sockets: %s (%d)", strerror(errno), errno); } @@ -388,13 +388,13 @@ static jboolean waitForHandsfreeConnectNative(JNIEnv* env, jobject object, cnt++; } if (cnt == 0) { - LOGE("Neither HF nor HS listening sockets are open!"); + ALOGE("Neither HF nor HS listening sockets are open!"); return JNI_FALSE; } n = poll(fds, cnt, timeout_ms); if (n <= 0) { if (n < 0) { - LOGE("listening poll() on RFCOMM sockets: %s (%d)", + ALOGE("listening poll() on RFCOMM sockets: %s (%d)", strerror(errno), errno); } @@ -475,7 +475,7 @@ static int setup_listening_socket(int dev, int channel) { sk = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); if (sk < 0) { - LOGE("Can't create RFCOMM socket"); + ALOGE("Can't create RFCOMM socket"); return -1; } @@ -486,7 +486,7 @@ static int setup_listening_socket(int dev, int channel) { } if (lm && setsockopt(sk, SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0) { - LOGE("Can't set RFCOMM link mode"); + ALOGE("Can't set RFCOMM link mode"); close(sk); return -1; } @@ -497,7 +497,7 @@ static int setup_listening_socket(int dev, int channel) { laddr.rc_channel = channel; if (bind(sk, (struct sockaddr *)&laddr, sizeof(laddr)) < 0) { - LOGE("Can't bind RFCOMM socket"); + ALOGE("Can't bind RFCOMM socket"); close(sk); return -1; } @@ -517,14 +517,14 @@ static void tearDownListeningSocketsNative(JNIEnv *env, jobject object) { if (nat->hf_ag_rfcomm_sock > 0) { if (close(nat->hf_ag_rfcomm_sock) < 0) { - LOGE("Could not close HF server socket: %s (%d)\n", + ALOGE("Could not close HF server socket: %s (%d)\n", strerror(errno), errno); } nat->hf_ag_rfcomm_sock = -1; } if (nat->hs_ag_rfcomm_sock > 0) { if (close(nat->hs_ag_rfcomm_sock) < 0) { - LOGE("Could not close HS server socket: %s (%d)\n", + ALOGE("Could not close HS server socket: %s (%d)\n", strerror(errno), errno); } nat->hs_ag_rfcomm_sock = -1; diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp index 1f59937767386..a982182d50f20 100644 --- a/core/jni/android_bluetooth_HeadsetBase.cpp +++ b/core/jni/android_bluetooth_HeadsetBase.cpp @@ -69,12 +69,12 @@ static inline int write_error_check(int fd, const char* line, int len) { errno = 0; ret = write(fd, line, len); if (ret < 0) { - LOGE("%s: write() failed: %s (%d)", __FUNCTION__, strerror(errno), + ALOGE("%s: write() failed: %s (%d)", __FUNCTION__, strerror(errno), errno); return -1; } if (ret != len) { - LOGE("%s: write() only wrote %d of %d bytes", __FUNCTION__, ret, len); + ALOGE("%s: write() only wrote %d of %d bytes", __FUNCTION__, ret, len); return -1; } return 0; @@ -117,7 +117,7 @@ again: *err = errno = 0; int ret = poll(&pfd, 1, timeout_ms); if (ret < 0) { - LOGE("poll() error\n"); + ALOGE("poll() error\n"); *err = errno; return NULL; } @@ -148,7 +148,7 @@ again: goto again; } *err = errno; - LOGE("read() error %s (%d)", strerror(errno), errno); + ALOGE("read() error %s (%d)", strerror(errno), errno); return NULL; } @@ -195,7 +195,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object, #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { - LOGE("%s: out of memory!", __FUNCTION__); + ALOGE("%s: out of memory!", __FUNCTION__); return; } @@ -235,7 +235,7 @@ static jboolean connectNative(JNIEnv *env, jobject obj) nat->rfcomm_sock = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); if (nat->rfcomm_sock < 0) { - LOGE("%s: Could not create RFCOMM socket: %s\n", __FUNCTION__, + ALOGE("%s: Could not create RFCOMM socket: %s\n", __FUNCTION__, strerror(errno)); return JNI_FALSE; } @@ -248,7 +248,7 @@ static jboolean connectNative(JNIEnv *env, jobject obj) if (lm && setsockopt(nat->rfcomm_sock, SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0) { - LOGE("%s: Can't set RFCOMM link mode", __FUNCTION__); + ALOGE("%s: Can't set RFCOMM link mode", __FUNCTION__); close(nat->rfcomm_sock); return JNI_FALSE; } @@ -262,7 +262,7 @@ static jboolean connectNative(JNIEnv *env, jobject obj) if (connect(nat->rfcomm_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { if (errno == EINTR) continue; - LOGE("%s: connect() failed: %s\n", __FUNCTION__, strerror(errno)); + ALOGE("%s: connect() failed: %s\n", __FUNCTION__, strerror(errno)); close(nat->rfcomm_sock); nat->rfcomm_sock = -1; return JNI_FALSE; @@ -293,7 +293,7 @@ static jint connectAsyncNative(JNIEnv *env, jobject obj) { nat->rfcomm_sock = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); if (nat->rfcomm_sock < 0) { - LOGE("%s: Could not create RFCOMM socket: %s\n", __FUNCTION__, + ALOGE("%s: Could not create RFCOMM socket: %s\n", __FUNCTION__, strerror(errno)); return -1; } @@ -306,7 +306,7 @@ static jint connectAsyncNative(JNIEnv *env, jobject obj) { if (lm && setsockopt(nat->rfcomm_sock, SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0) { - LOGE("%s: Can't set RFCOMM link mode", __FUNCTION__); + ALOGE("%s: Can't set RFCOMM link mode", __FUNCTION__); close(nat->rfcomm_sock); return -1; } @@ -343,7 +343,7 @@ static jint connectAsyncNative(JNIEnv *env, jobject obj) { } else { - LOGE("async connect error: %s (%d)", strerror(errno), errno); + ALOGE("async connect error: %s (%d)", strerror(errno), errno); close(nat->rfcomm_sock); nat->rfcomm_sock = -1; return -errno; @@ -410,7 +410,7 @@ static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj, if (n <= 0) { if (n < 0) { - LOGE("select() on RFCOMM socket: %s (%d)", + ALOGE("select() on RFCOMM socket: %s (%d)", strerror(errno), errno); return -errno; @@ -433,7 +433,7 @@ static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj, respond... but one can't be paranoid enough. */ if (nr >= 0 || errno != EAGAIN) { - LOGE("RFCOMM async connect() error: %s (%d), nr = %d\n", + ALOGE("RFCOMM async connect() error: %s (%d), nr = %d\n", strerror(errno), errno, nr); @@ -456,7 +456,7 @@ static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj, return 1; } } - else LOGE("RFCOMM socket file descriptor %d is bad!", + else ALOGE("RFCOMM socket file descriptor %d is bad!", nat->rfcomm_sock); #endif return -1; diff --git a/core/jni/android_bluetooth_common.cpp b/core/jni/android_bluetooth_common.cpp index c8dc9c275c8cb..5cdaa6c7bc07f 100644 --- a/core/jni/android_bluetooth_common.cpp +++ b/core/jni/android_bluetooth_common.cpp @@ -101,7 +101,7 @@ jfieldID get_field(JNIEnv *env, jclass clazz, const char *member, const char *mtype) { jfieldID field = env->GetFieldID(clazz, member, mtype); if (field == NULL) { - LOGE("Can't find member %s", member); + ALOGE("Can't find member %s", member); } return field; } @@ -158,13 +158,13 @@ static dbus_bool_t dbus_func_args_async_valist(JNIEnv *env, msg = dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC, path, ifc, func); if (msg == NULL) { - LOGE("Could not allocate D-Bus message object!"); + ALOGE("Could not allocate D-Bus message object!"); goto done; } /* append arguments */ if (!dbus_message_append_args_valist(msg, first_arg_type, args)) { - LOGE("Could not append argument to method call!"); + ALOGE("Could not append argument to method call!"); goto done; } @@ -219,7 +219,7 @@ dbus_bool_t dbus_func_args_async(JNIEnv *env, return ret; } -// If err is NULL, then any errors will be LOGE'd, and free'd and the reply +// If err is NULL, then any errors will be ALOGE'd, and free'd and the reply // will be NULL. // If err is not NULL, then it is assumed that dbus_error_init was already // called, and error's will be returned to the caller without logging. The @@ -248,13 +248,13 @@ DBusMessage * dbus_func_args_timeout_valist(JNIEnv *env, msg = dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC, path, ifc, func); if (msg == NULL) { - LOGE("Could not allocate D-Bus message object!"); + ALOGE("Could not allocate D-Bus message object!"); goto done; } /* append arguments */ if (!dbus_message_append_args_valist(msg, first_arg_type, args)) { - LOGE("Could not append argument to method call!"); + ALOGE("Could not append argument to method call!"); goto done; } @@ -587,7 +587,7 @@ int get_property(DBusMessageIter iter, Properties *properties, dbus_message_iter_recurse(&iter, &prop_val); type = properties[*prop_index].type; if (dbus_message_iter_get_arg_type(&prop_val) != type) { - LOGE("Property type mismatch in get_property: %d, expected:%d, index:%d", + ALOGE("Property type mismatch in get_property: %d, expected:%d, index:%d", dbus_message_iter_get_arg_type(&prop_val), type, *prop_index); return -1; } diff --git a/core/jni/android_bluetooth_common.h b/core/jni/android_bluetooth_common.h index 1f4da3afdacac..daf4bb225f864 100644 --- a/core/jni/android_bluetooth_common.h +++ b/core/jni/android_bluetooth_common.h @@ -56,14 +56,14 @@ jfieldID get_field(JNIEnv *env, const char *member, const char *mtype); -// LOGE and free a D-Bus error +// ALOGE and free a D-Bus error // Using #define so that __FUNCTION__ resolves usefully #define LOG_AND_FREE_DBUS_ERROR_WITH_MSG(err, msg) \ - { LOGE("%s: D-Bus error in %s: %s (%s)", __FUNCTION__, \ + { ALOGE("%s: D-Bus error in %s: %s (%s)", __FUNCTION__, \ dbus_message_get_member((msg)), (err)->name, (err)->message); \ dbus_error_free((err)); } #define LOG_AND_FREE_DBUS_ERROR(err) \ - { LOGE("%s: D-Bus error: %s (%s)", __FUNCTION__, \ + { ALOGE("%s: D-Bus error: %s (%s)", __FUNCTION__, \ (err)->name, (err)->message); \ dbus_error_free((err)); } diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp index 9a87a10d83f56..f9270641fd908 100644 --- a/core/jni/android_database_CursorWindow.cpp +++ b/core/jni/android_database_CursorWindow.cpp @@ -71,7 +71,7 @@ static jint nativeCreate(JNIEnv* env, jclass clazz, jstring nameObj, jint cursor CursorWindow* window; status_t status = CursorWindow::create(name, cursorWindowSize, &window); if (status || !window) { - LOGE("Could not allocate CursorWindow '%s' of size %d due to error %d.", + ALOGE("Could not allocate CursorWindow '%s' of size %d due to error %d.", name.string(), cursorWindowSize, status); return 0; } @@ -86,7 +86,7 @@ static jint nativeCreateFromParcel(JNIEnv* env, jclass clazz, jobject parcelObj) CursorWindow* window; status_t status = CursorWindow::createFromParcel(parcel, &window); if (status || !window) { - LOGE("Could not create CursorWindow from Parcel due to error %d.", status); + ALOGE("Could not create CursorWindow from Parcel due to error %d.", status); return 0; } diff --git a/core/jni/android_database_SQLiteCompiledSql.cpp b/core/jni/android_database_SQLiteCompiledSql.cpp index a916ef503c9eb..857267a18da5d 100644 --- a/core/jni/android_database_SQLiteCompiledSql.cpp +++ b/core/jni/android_database_SQLiteCompiledSql.cpp @@ -104,7 +104,7 @@ int register_android_database_SQLiteCompiledSql(JNIEnv * env) clazz = env->FindClass("android/database/sqlite/SQLiteCompiledSql"); if (clazz == NULL) { - LOGE("Can't find android/database/sqlite/SQLiteCompiledSql"); + ALOGE("Can't find android/database/sqlite/SQLiteCompiledSql"); return -1; } @@ -112,7 +112,7 @@ int register_android_database_SQLiteCompiledSql(JNIEnv * env) gStatementField = env->GetFieldID(clazz, "nStatement", "I"); if (gHandleField == NULL || gStatementField == NULL) { - LOGE("Error locating fields"); + ALOGE("Error locating fields"); return -1; } diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp index d5a034a67ff12..28c421de6768f 100644 --- a/core/jni/android_database_SQLiteDatabase.cpp +++ b/core/jni/android_database_SQLiteDatabase.cpp @@ -121,7 +121,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags) err = sqlite3_open_v2(path8, &handle, sqliteFlags, NULL); if (err != SQLITE_OK) { - LOGE("sqlite3_open_v2(\"%s\", &handle, %d, NULL) failed\n", path8, sqliteFlags); + ALOGE("sqlite3_open_v2(\"%s\", &handle, %d, NULL) failed\n", path8, sqliteFlags); throw_sqlite3_exception(env, handle); goto done; } @@ -134,7 +134,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags) // Set the default busy handler to retry for 1000ms and then return SQLITE_BUSY err = sqlite3_busy_timeout(handle, 1000 /* ms */); if (err != SQLITE_OK) { - LOGE("sqlite3_busy_timeout(handle, 1000) failed for \"%s\"\n", path8); + ALOGE("sqlite3_busy_timeout(handle, 1000) failed for \"%s\"\n", path8); throw_sqlite3_exception(env, handle); goto done; } @@ -143,7 +143,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags) static const char* integritySql = "pragma integrity_check(1);"; err = sqlite3_prepare_v2(handle, integritySql, -1, &statement, NULL); if (err != SQLITE_OK) { - LOGE("sqlite_prepare_v2(handle, \"%s\") failed for \"%s\"\n", integritySql, path8); + ALOGE("sqlite_prepare_v2(handle, \"%s\") failed for \"%s\"\n", integritySql, path8); throw_sqlite3_exception(env, handle); goto done; } @@ -151,13 +151,13 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags) // first is OK or error message err = sqlite3_step(statement); if (err != SQLITE_ROW) { - LOGE("integrity check failed for \"%s\"\n", integritySql, path8); + ALOGE("integrity check failed for \"%s\"\n", integritySql, path8); throw_sqlite3_exception(env, handle); goto done; } else { const char *text = (const char*)sqlite3_column_text(statement, 0); if (strcmp(text, "ok") != 0) { - LOGE("integrity check failed for \"%s\": %s\n", integritySql, path8, text); + ALOGE("integrity check failed for \"%s\": %s\n", integritySql, path8, text); jniThrowException(env, "android/database/sqlite/SQLiteDatabaseCorruptException", text); goto done; } @@ -184,7 +184,7 @@ done: static char *getDatabaseName(JNIEnv* env, sqlite3 * handle, jstring databaseName, short connNum) { char const *path = env->GetStringUTFChars(databaseName, NULL); if (path == NULL) { - LOGE("Failure in getDatabaseName(). VM ran out of memory?\n"); + ALOGE("Failure in getDatabaseName(). VM ran out of memory?\n"); return NULL; // VM would have thrown OutOfMemoryError } char *dbNameStr = createStr(path, 4); @@ -244,7 +244,7 @@ static void dbclose(JNIEnv* env, jobject object) } else { // This can happen if sub-objects aren't closed first. Make sure the caller knows. throw_sqlite3_exception(env, handle); - LOGE("sqlite3_close(%p) failed: %d\n", handle, result); + ALOGE("sqlite3_close(%p) failed: %d\n", handle, result); } } } @@ -277,7 +277,7 @@ static void native_setLocale(JNIEnv* env, jobject object, jstring localeString, static const char *createSql ="CREATE TABLE IF NOT EXISTS " ANDROID_TABLE " (locale TEXT)"; err = sqlite3_exec(handle, createSql, NULL, NULL, NULL); if (err != SQLITE_OK) { - LOGE("CREATE TABLE " ANDROID_TABLE " failed\n"); + ALOGE("CREATE TABLE " ANDROID_TABLE " failed\n"); throw_sqlite3_exception(env, handle); goto done; } @@ -287,7 +287,7 @@ static void native_setLocale(JNIEnv* env, jobject object, jstring localeString, static const char *selectSql = "SELECT locale FROM " ANDROID_TABLE " LIMIT 1"; err = sqlite3_get_table(handle, selectSql, &meta, &rowCount, &colCount, NULL); if (err != SQLITE_OK) { - LOGE("SELECT locale FROM " ANDROID_TABLE " failed\n"); + ALOGE("SELECT locale FROM " ANDROID_TABLE " failed\n"); throw_sqlite3_exception(env, handle); goto done; } @@ -312,21 +312,21 @@ static void native_setLocale(JNIEnv* env, jobject object, jstring localeString, // need to update android_metadata and indexes atomically, so use a transaction... err = sqlite3_exec(handle, "BEGIN TRANSACTION", NULL, NULL, NULL); if (err != SQLITE_OK) { - LOGE("BEGIN TRANSACTION failed setting locale\n"); + ALOGE("BEGIN TRANSACTION failed setting locale\n"); throw_sqlite3_exception(env, handle); goto done; } err = register_localized_collators(handle, locale8, UTF16_STORAGE); if (err != SQLITE_OK) { - LOGE("register_localized_collators() failed setting locale\n"); + ALOGE("register_localized_collators() failed setting locale\n"); throw_sqlite3_exception(env, handle); goto rollback; } err = sqlite3_exec(handle, "DELETE FROM " ANDROID_TABLE, NULL, NULL, NULL); if (err != SQLITE_OK) { - LOGE("DELETE failed setting locale\n"); + ALOGE("DELETE failed setting locale\n"); throw_sqlite3_exception(env, handle); goto rollback; } @@ -334,28 +334,28 @@ static void native_setLocale(JNIEnv* env, jobject object, jstring localeString, static const char *sql = "INSERT INTO " ANDROID_TABLE " (locale) VALUES(?);"; err = sqlite3_prepare_v2(handle, sql, -1, &stmt, NULL); if (err != SQLITE_OK) { - LOGE("sqlite3_prepare_v2(\"%s\") failed\n", sql); + ALOGE("sqlite3_prepare_v2(\"%s\") failed\n", sql); throw_sqlite3_exception(env, handle); goto rollback; } err = sqlite3_bind_text(stmt, 1, locale8, -1, SQLITE_TRANSIENT); if (err != SQLITE_OK) { - LOGE("sqlite3_bind_text() failed setting locale\n"); + ALOGE("sqlite3_bind_text() failed setting locale\n"); throw_sqlite3_exception(env, handle); goto rollback; } err = sqlite3_step(stmt); if (err != SQLITE_OK && err != SQLITE_DONE) { - LOGE("sqlite3_step(\"%s\") failed setting locale\n", sql); + ALOGE("sqlite3_step(\"%s\") failed setting locale\n", sql); throw_sqlite3_exception(env, handle); goto rollback; } err = sqlite3_exec(handle, "REINDEX LOCALIZED", NULL, NULL, NULL); if (err != SQLITE_OK) { - LOGE("REINDEX LOCALIZED failed\n"); + ALOGE("REINDEX LOCALIZED failed\n"); throw_sqlite3_exception(env, handle); goto rollback; } @@ -363,7 +363,7 @@ static void native_setLocale(JNIEnv* env, jobject object, jstring localeString, // all done, yay! err = sqlite3_exec(handle, "COMMIT TRANSACTION", NULL, NULL, NULL); if (err != SQLITE_OK) { - LOGE("COMMIT TRANSACTION failed setting locale\n"); + ALOGE("COMMIT TRANSACTION failed setting locale\n"); throw_sqlite3_exception(env, handle); goto done; } @@ -399,7 +399,7 @@ static void native_finalize(JNIEnv* env, jobject object, jint statementId) static void custom_function_callback(sqlite3_context * context, int argc, sqlite3_value ** argv) { JNIEnv* env = AndroidRuntime::getJNIEnv(); if (!env) { - LOGE("custom_function_callback cannot call into Java on this thread"); + ALOGE("custom_function_callback cannot call into Java on this thread"); return; } // get global ref to CustomFunction object from our user data @@ -412,7 +412,7 @@ static void custom_function_callback(sqlite3_context * context, int argc, sqlite for (int i = 0; i < argc; i++) { char* arg = (char *)sqlite3_value_text(argv[i]); if (!arg) { - LOGE("NULL argument in custom_function_callback. This should not happen."); + ALOGE("NULL argument in custom_function_callback. This should not happen."); return; } jobject obj = env->NewStringUTF(arg); @@ -427,7 +427,7 @@ static void custom_function_callback(sqlite3_context * context, int argc, sqlite done: if (env->ExceptionCheck()) { - LOGE("An exception was thrown by custom sqlite3 function."); + ALOGE("An exception was thrown by custom sqlite3 function."); LOGE_EX(env); env->ExceptionClear(); } @@ -447,7 +447,7 @@ static jint native_addCustomFunction(JNIEnv* env, jobject object, if (err == SQLITE_OK) return (int)ref; else { - LOGE("sqlite3_create_function returned %d", err); + ALOGE("sqlite3_create_function returned %d", err); env->DeleteGlobalRef(ref); throw_sqlite3_exception(env, handle); return 0; @@ -484,30 +484,30 @@ int register_android_database_SQLiteDatabase(JNIEnv *env) clazz = env->FindClass("android/database/sqlite/SQLiteDatabase"); if (clazz == NULL) { - LOGE("Can't find android/database/sqlite/SQLiteDatabase\n"); + ALOGE("Can't find android/database/sqlite/SQLiteDatabase\n"); return -1; } string_class = (jclass)env->NewGlobalRef(env->FindClass("java/lang/String")); if (string_class == NULL) { - LOGE("Can't find java/lang/String\n"); + ALOGE("Can't find java/lang/String\n"); return -1; } offset_db_handle = env->GetFieldID(clazz, "mNativeHandle", "I"); if (offset_db_handle == NULL) { - LOGE("Can't find SQLiteDatabase.mNativeHandle\n"); + ALOGE("Can't find SQLiteDatabase.mNativeHandle\n"); return -1; } clazz = env->FindClass("android/database/sqlite/SQLiteDatabase$CustomFunction"); if (clazz == NULL) { - LOGE("Can't find android/database/sqlite/SQLiteDatabase$CustomFunction\n"); + ALOGE("Can't find android/database/sqlite/SQLiteDatabase$CustomFunction\n"); return -1; } method_custom_function_callback = env->GetMethodID(clazz, "callback", "([Ljava/lang/String;)V"); if (method_custom_function_callback == NULL) { - LOGE("Can't find method SQLiteDatabase.CustomFunction.callback\n"); + ALOGE("Can't find method SQLiteDatabase.CustomFunction.callback\n"); return -1; } diff --git a/core/jni/android_database_SQLiteDebug.cpp b/core/jni/android_database_SQLiteDebug.cpp index 873b2a1ba5af9..20ff00be63d7e 100644 --- a/core/jni/android_database_SQLiteDebug.cpp +++ b/core/jni/android_database_SQLiteDebug.cpp @@ -201,25 +201,25 @@ int register_android_database_SQLiteDebug(JNIEnv *env) clazz = env->FindClass("android/database/sqlite/SQLiteDebug$PagerStats"); if (clazz == NULL) { - LOGE("Can't find android/database/sqlite/SQLiteDebug$PagerStats"); + ALOGE("Can't find android/database/sqlite/SQLiteDebug$PagerStats"); return -1; } gMemoryUsedField = env->GetFieldID(clazz, "memoryUsed", "I"); if (gMemoryUsedField == NULL) { - LOGE("Can't find memoryUsed"); + ALOGE("Can't find memoryUsed"); return -1; } gLargestMemAllocField = env->GetFieldID(clazz, "largestMemAlloc", "I"); if (gLargestMemAllocField == NULL) { - LOGE("Can't find largestMemAlloc"); + ALOGE("Can't find largestMemAlloc"); return -1; } gPageCacheOverfloField = env->GetFieldID(clazz, "pageCacheOverflo", "I"); if (gPageCacheOverfloField == NULL) { - LOGE("Can't find pageCacheOverflo"); + ALOGE("Can't find pageCacheOverflo"); return -1; } diff --git a/core/jni/android_database_SQLiteProgram.cpp b/core/jni/android_database_SQLiteProgram.cpp index c247bbd96ab46..2e34c0030df91 100644 --- a/core/jni/android_database_SQLiteProgram.cpp +++ b/core/jni/android_database_SQLiteProgram.cpp @@ -176,7 +176,7 @@ int register_android_database_SQLiteProgram(JNIEnv * env) clazz = env->FindClass("android/database/sqlite/SQLiteProgram"); if (clazz == NULL) { - LOGE("Can't find android/database/sqlite/SQLiteProgram"); + ALOGE("Can't find android/database/sqlite/SQLiteProgram"); return -1; } @@ -184,7 +184,7 @@ int register_android_database_SQLiteProgram(JNIEnv * env) gStatementField = env->GetFieldID(clazz, "nStatement", "I"); if (gHandleField == NULL || gStatementField == NULL) { - LOGE("Error locating fields"); + ALOGE("Error locating fields"); return -1; } diff --git a/core/jni/android_database_SQLiteQuery.cpp b/core/jni/android_database_SQLiteQuery.cpp index 8170f46ecb299..aa5c4c9a36b0e 100644 --- a/core/jni/android_database_SQLiteQuery.cpp +++ b/core/jni/android_database_SQLiteQuery.cpp @@ -47,7 +47,7 @@ static jint nativeFillWindow(JNIEnv* env, jclass clazz, jint databasePtr, // Bind the offset parameter, telling the program which row to start with int err = sqlite3_bind_int(statement, offsetParam, startPos); if (err != SQLITE_OK) { - LOGE("Unable to bind offset position, offsetParam = %d", offsetParam); + ALOGE("Unable to bind offset position, offsetParam = %d", offsetParam); throw_sqlite3_exception(env, database); return 0; } @@ -63,7 +63,7 @@ static jint nativeFillWindow(JNIEnv* env, jclass clazz, jint databasePtr, int numColumns = sqlite3_column_count(statement); status_t status = window->setNumColumns(numColumns); if (status) { - LOGE("Failed to change column count from %d to %d", window->getNumColumns(), numColumns); + ALOGE("Failed to change column count from %d to %d", window->getNumColumns(), numColumns); jniThrowException(env, "java/lang/IllegalStateException", "numColumns mismatch"); return 0; } @@ -165,7 +165,7 @@ static jint nativeFillWindow(JNIEnv* env, jclass clazz, jint databasePtr, LOG_WINDOW("%d,%d is NULL", startPos + addedRows, i); } else { // Unknown data - LOGE("Unknown column type when filling database window"); + ALOGE("Unknown column type when filling database window"); throw_sqlite3_exception(env, "Unknown column type when filling window"); gotException = true; break; @@ -186,7 +186,7 @@ static jint nativeFillWindow(JNIEnv* env, jclass clazz, jint databasePtr, // The table is locked, retry LOG_WINDOW("Database locked, retrying"); if (retryCount > 50) { - LOGE("Bailing on database busy retry"); + ALOGE("Bailing on database busy retry"); throw_sqlite3_exception(env, database, "retrycount exceeded"); gotException = true; } else { @@ -207,7 +207,7 @@ static jint nativeFillWindow(JNIEnv* env, jclass clazz, jint databasePtr, // Report the total number of rows on request. if (startPos > totalRows) { - LOGE("startPos %d > actual rows %d", startPos, totalRows); + ALOGE("startPos %d > actual rows %d", startPos, totalRows); } return countAllRows ? totalRows : 0; } diff --git a/core/jni/android_database_SQLiteStatement.cpp b/core/jni/android_database_SQLiteStatement.cpp index 05ffbb1d97afc..e376258f52d17 100644 --- a/core/jni/android_database_SQLiteStatement.cpp +++ b/core/jni/android_database_SQLiteStatement.cpp @@ -169,7 +169,7 @@ static jobject create_ashmem_region_with_data(JNIEnv * env, // Create ashmem area int fd = ashmem_create_region(NULL, length); if (fd < 0) { - LOGE("ashmem_create_region failed: %s", strerror(errno)); + ALOGE("ashmem_create_region failed: %s", strerror(errno)); jniThrowIOException(env, errno); return NULL; } @@ -179,7 +179,7 @@ static jobject create_ashmem_region_with_data(JNIEnv * env, void * ashmem_ptr = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (ashmem_ptr == MAP_FAILED) { - LOGE("mmap failed: %s", strerror(errno)); + ALOGE("mmap failed: %s", strerror(errno)); jniThrowIOException(env, errno); close(fd); return NULL; @@ -190,7 +190,7 @@ static jobject create_ashmem_region_with_data(JNIEnv * env, // munmap ashmem area if (munmap(ashmem_ptr, length) < 0) { - LOGE("munmap failed: %s", strerror(errno)); + ALOGE("munmap failed: %s", strerror(errno)); jniThrowIOException(env, errno); close(fd); return NULL; @@ -199,7 +199,7 @@ static jobject create_ashmem_region_with_data(JNIEnv * env, // Make ashmem area read-only if (ashmem_set_prot_region(fd, PROT_READ) < 0) { - LOGE("ashmem_set_prot_region failed: %s", strerror(errno)); + ALOGE("ashmem_set_prot_region failed: %s", strerror(errno)); jniThrowIOException(env, errno); close(fd); return NULL; @@ -267,7 +267,7 @@ int register_android_database_SQLiteStatement(JNIEnv * env) clazz = env->FindClass("android/database/sqlite/SQLiteStatement"); if (clazz == NULL) { - LOGE("Can't find android/database/sqlite/SQLiteStatement"); + ALOGE("Can't find android/database/sqlite/SQLiteStatement"); return -1; } @@ -275,7 +275,7 @@ int register_android_database_SQLiteStatement(JNIEnv * env) gStatementField = env->GetFieldID(clazz, "nStatement", "I"); if (gHandleField == NULL || gStatementField == NULL) { - LOGE("Error locating fields"); + ALOGE("Error locating fields"); return -1; } diff --git a/core/jni/android_debug_JNITest.cpp b/core/jni/android_debug_JNITest.cpp index e0f61fbd5159d..914728457ee4b 100644 --- a/core/jni/android_debug_JNITest.cpp +++ b/core/jni/android_debug_JNITest.cpp @@ -46,7 +46,7 @@ static jint android_debug_JNITest_part1(JNIEnv* env, jobject object, part2id = env->GetMethodID(clazz, "part2", "(DILjava/lang/String;)I"); if (part2id == NULL) { - LOGE("JNI test: unable to find part2\n"); + ALOGE("JNI test: unable to find part2\n"); return -1; } diff --git a/core/jni/android_emoji_EmojiFactory.cpp b/core/jni/android_emoji_EmojiFactory.cpp index 81dae88c1e115..a658561b059fb 100644 --- a/core/jni/android_emoji_EmojiFactory.cpp +++ b/core/jni/android_emoji_EmojiFactory.cpp @@ -60,7 +60,7 @@ FAIL: error_str = "unknown reason"; } - LOGE("%s: %s", error_msg, error_str); + ALOGE("%s: %s", error_msg, error_str); if (m_handle != NULL) { dlclose(m_handle); m_handle = NULL; @@ -109,7 +109,7 @@ static jobject create_java_EmojiFactory( jobject obj = env->NewObject(gEmojiFactory_class, gEmojiFactory_constructorMethodID, static_cast(reinterpret_cast(factory)), name); if (env->ExceptionCheck() != 0) { - LOGE("*** Uncaught exception returned from Java call!\n"); + ALOGE("*** Uncaught exception returned from Java call!\n"); env->ExceptionDescribe(); } return obj; @@ -172,14 +172,14 @@ static jobject android_emoji_EmojiFactory_getBitmapFromAndroidPua( SkBitmap *bitmap = new SkBitmap; if (!SkImageDecoder::DecodeMemory(bytes, size, bitmap)) { - LOGE("SkImageDecoder::DecodeMemory() failed."); + ALOGE("SkImageDecoder::DecodeMemory() failed."); return NULL; } jobject obj = env->NewObject(gBitmap_class, gBitmap_constructorMethodID, static_cast(reinterpret_cast(bitmap)), NULL, false, NULL, -1); if (env->ExceptionCheck() != 0) { - LOGE("*** Uncaught exception returned from Java call!\n"); + ALOGE("*** Uncaught exception returned from Java call!\n"); env->ExceptionDescribe(); } return obj; diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp index 6d1fb7096ee6a..8dcc14a127398 100644 --- a/core/jni/android_hardware_Camera.cpp +++ b/core/jni/android_hardware_Camera.cpp @@ -208,7 +208,7 @@ jbyteArray JNICameraContext::getCallbackBuffer( if (obj != NULL) { jsize bufferLength = env->GetArrayLength(obj); if ((int)bufferLength < (int)bufferSize) { - LOGE("Callback buffer was too small! Expected %d bytes, but got %d bytes!", + ALOGE("Callback buffer was too small! Expected %d bytes, but got %d bytes!", bufferSize, bufferLength); env->DeleteLocalRef(obj); return NULL; @@ -254,13 +254,13 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp& dataPtr, int } if (obj == NULL) { - LOGE("Couldn't allocate byte array for JPEG data"); + ALOGE("Couldn't allocate byte array for JPEG data"); env->ExceptionClear(); } else { env->SetByteArrayRegion(obj, 0, size, data); } } else { - LOGE("image heap is NULL"); + ALOGE("image heap is NULL"); } } @@ -331,7 +331,7 @@ void JNICameraContext::postMetadata(JNIEnv *env, int32_t msgType, camera_frame_m obj = (jobjectArray) env->NewObjectArray(metadata->number_of_faces, mFaceClass, NULL); if (obj == NULL) { - LOGE("Couldn't allocate face metadata array"); + ALOGE("Couldn't allocate face metadata array"); return; } @@ -419,7 +419,7 @@ void JNICameraContext::addCallbackBuffer( } } } else { - LOGE("Null byte array!"); + ALOGE("Null byte array!"); } } @@ -885,13 +885,13 @@ static int find_fields(JNIEnv *env, field *fields, int count) field *f = &fields[i]; jclass clazz = env->FindClass(f->class_name); if (clazz == NULL) { - LOGE("Can't find %s", f->class_name); + ALOGE("Can't find %s", f->class_name); return -1; } jfieldID field = env->GetFieldID(clazz, f->field_name, f->field_type); if (field == NULL) { - LOGE("Can't find %s.%s", f->class_name, f->field_name); + ALOGE("Can't find %s.%s", f->class_name, f->field_name); return -1; } @@ -926,21 +926,21 @@ int register_android_hardware_Camera(JNIEnv *env) fields.post_event = env->GetStaticMethodID(clazz, "postEventFromNative", "(Ljava/lang/Object;IIILjava/lang/Object;)V"); if (fields.post_event == NULL) { - LOGE("Can't find android/hardware/Camera.postEventFromNative"); + ALOGE("Can't find android/hardware/Camera.postEventFromNative"); return -1; } clazz = env->FindClass("android/graphics/Rect"); fields.rect_constructor = env->GetMethodID(clazz, "", "()V"); if (fields.rect_constructor == NULL) { - LOGE("Can't find android/graphics/Rect.Rect()"); + ALOGE("Can't find android/graphics/Rect.Rect()"); return -1; } clazz = env->FindClass("android/hardware/Camera$Face"); fields.face_constructor = env->GetMethodID(clazz, "", "()V"); if (fields.face_constructor == NULL) { - LOGE("Can't find android/hardware/Camera$Face.Face()"); + ALOGE("Can't find android/hardware/Camera$Face.Face()"); return -1; } diff --git a/core/jni/android_hardware_UsbDeviceConnection.cpp b/core/jni/android_hardware_UsbDeviceConnection.cpp index f53e2f7e5e71e..923781ed33104 100644 --- a/core/jni/android_hardware_UsbDeviceConnection.cpp +++ b/core/jni/android_hardware_UsbDeviceConnection.cpp @@ -53,7 +53,7 @@ android_hardware_UsbDeviceConnection_open(JNIEnv *env, jobject thiz, jstring dev if (device) { env->SetIntField(thiz, field_context, (int)device); } else { - LOGE("usb_device_open failed for %s", deviceNameStr); + ALOGE("usb_device_open failed for %s", deviceNameStr); close(fd); } @@ -77,7 +77,7 @@ android_hardware_UsbDeviceConnection_get_fd(JNIEnv *env, jobject thiz) { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_get_fd"); + ALOGE("device is closed in native_get_fd"); return -1; } return usb_device_get_fd(device); @@ -110,7 +110,7 @@ android_hardware_UsbDeviceConnection_claim_interface(JNIEnv *env, jobject thiz, { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_claim_interface"); + ALOGE("device is closed in native_claim_interface"); return -1; } @@ -128,7 +128,7 @@ android_hardware_UsbDeviceConnection_release_interface(JNIEnv *env, jobject thiz { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_release_interface"); + ALOGE("device is closed in native_release_interface"); return -1; } int ret = usb_device_release_interface(device, interfaceID); @@ -146,7 +146,7 @@ android_hardware_UsbDeviceConnection_control_request(JNIEnv *env, jobject thiz, { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_control_request"); + ALOGE("device is closed in native_control_request"); return -1; } @@ -174,7 +174,7 @@ android_hardware_UsbDeviceConnection_bulk_request(JNIEnv *env, jobject thiz, { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_control_request"); + ALOGE("device is closed in native_control_request"); return -1; } @@ -200,7 +200,7 @@ android_hardware_UsbDeviceConnection_request_wait(JNIEnv *env, jobject thiz) { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_request_wait"); + ALOGE("device is closed in native_request_wait"); return NULL; } @@ -216,7 +216,7 @@ android_hardware_UsbDeviceConnection_get_serial(JNIEnv *env, jobject thiz) { struct usb_device* device = get_device_from_object(env, thiz); if (!device) { - LOGE("device is closed in native_request_wait"); + ALOGE("device is closed in native_request_wait"); return NULL; } char* serial = usb_device_get_serial(device); @@ -249,12 +249,12 @@ int register_android_hardware_UsbDeviceConnection(JNIEnv *env) { jclass clazz = env->FindClass("android/hardware/usb/UsbDeviceConnection"); if (clazz == NULL) { - LOGE("Can't find android/hardware/usb/UsbDeviceConnection"); + ALOGE("Can't find android/hardware/usb/UsbDeviceConnection"); return -1; } field_context = env->GetFieldID(clazz, "mNativeContext", "I"); if (field_context == NULL) { - LOGE("Can't find UsbDeviceConnection.mNativeContext"); + ALOGE("Can't find UsbDeviceConnection.mNativeContext"); return -1; } diff --git a/core/jni/android_hardware_UsbRequest.cpp b/core/jni/android_hardware_UsbRequest.cpp index 6e1d4431b16be..1398968b043dc 100644 --- a/core/jni/android_hardware_UsbRequest.cpp +++ b/core/jni/android_hardware_UsbRequest.cpp @@ -46,7 +46,7 @@ android_hardware_UsbRequest_init(JNIEnv *env, jobject thiz, jobject java_device, struct usb_device* device = get_device_from_object(env, java_device); if (!device) { - LOGE("device null in native_init"); + ALOGE("device null in native_init"); return false; } @@ -82,7 +82,7 @@ android_hardware_UsbRequest_queue_array(JNIEnv *env, jobject thiz, { struct usb_request* request = get_request_from_object(env, thiz); if (!request) { - LOGE("request is closed in native_queue"); + ALOGE("request is closed in native_queue"); return false; } @@ -119,7 +119,7 @@ android_hardware_UsbRequest_dequeue_array(JNIEnv *env, jobject thiz, { struct usb_request* request = get_request_from_object(env, thiz); if (!request) { - LOGE("request is closed in native_dequeue"); + ALOGE("request is closed in native_dequeue"); return; } @@ -138,7 +138,7 @@ android_hardware_UsbRequest_queue_direct(JNIEnv *env, jobject thiz, { struct usb_request* request = get_request_from_object(env, thiz); if (!request) { - LOGE("request is closed in native_queue"); + ALOGE("request is closed in native_queue"); return false; } @@ -168,7 +168,7 @@ android_hardware_UsbRequest_dequeue_direct(JNIEnv *env, jobject thiz) { struct usb_request* request = get_request_from_object(env, thiz); if (!request) { - LOGE("request is closed in native_dequeue"); + ALOGE("request is closed in native_dequeue"); return; } // all we need to do is delete our global ref @@ -180,7 +180,7 @@ android_hardware_UsbRequest_cancel(JNIEnv *env, jobject thiz) { struct usb_request* request = get_request_from_object(env, thiz); if (!request) { - LOGE("request is closed in native_cancel"); + ALOGE("request is closed in native_cancel"); return false; } return (usb_request_cancel(request) == 0); @@ -202,12 +202,12 @@ int register_android_hardware_UsbRequest(JNIEnv *env) { jclass clazz = env->FindClass("android/hardware/usb/UsbRequest"); if (clazz == NULL) { - LOGE("Can't find android/hardware/usb/UsbRequest"); + ALOGE("Can't find android/hardware/usb/UsbRequest"); return -1; } field_context = env->GetFieldID(clazz, "mNativeContext", "I"); if (field_context == NULL) { - LOGE("Can't find UsbRequest.mNativeContext"); + ALOGE("Can't find UsbRequest.mNativeContext"); return -1; } diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp index ca13c18873479..305255355ff5c 100644 --- a/core/jni/android_media_AudioRecord.cpp +++ b/core/jni/android_media_AudioRecord.cpp @@ -134,7 +134,7 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this, // sampleRateInHertz, audioFormat, channels, buffSizeInBytes); if (!audio_is_input_channel(channels)) { - LOGE("Error creating AudioRecord: channel count is not 1 or 2."); + ALOGE("Error creating AudioRecord: channel count is not 1 or 2."); return AUDIORECORD_ERROR_SETUP_INVALIDCHANNELMASK; } uint32_t nbChannels = popcount(channels); @@ -142,7 +142,7 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this, // compare the format against the Java constants if ((audioFormat != javaAudioRecordFields.PCM16) && (audioFormat != javaAudioRecordFields.PCM8)) { - LOGE("Error creating AudioRecord: unsupported audio format."); + ALOGE("Error creating AudioRecord: unsupported audio format."); return AUDIORECORD_ERROR_SETUP_INVALIDFORMAT; } @@ -151,25 +151,25 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this, AUDIO_FORMAT_PCM_16_BIT : AUDIO_FORMAT_PCM_8_BIT; if (buffSizeInBytes == 0) { - LOGE("Error creating AudioRecord: frameCount is 0."); + ALOGE("Error creating AudioRecord: frameCount is 0."); return AUDIORECORD_ERROR_SETUP_ZEROFRAMECOUNT; } int frameSize = nbChannels * bytesPerSample; size_t frameCount = buffSizeInBytes / frameSize; if (source >= AUDIO_SOURCE_CNT) { - LOGE("Error creating AudioRecord: unknown source."); + ALOGE("Error creating AudioRecord: unknown source."); return AUDIORECORD_ERROR_SETUP_INVALIDSOURCE; } if (jSession == NULL) { - LOGE("Error creating AudioRecord: invalid session ID pointer"); + ALOGE("Error creating AudioRecord: invalid session ID pointer"); return AUDIORECORD_ERROR; } jint* nSession = (jint *) env->GetPrimitiveArrayCritical(jSession, NULL); if (nSession == NULL) { - LOGE("Error creating AudioRecord: Error retrieving session id pointer"); + ALOGE("Error creating AudioRecord: Error retrieving session id pointer"); return AUDIORECORD_ERROR; } int sessionId = nSession[0]; @@ -182,7 +182,7 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this, // create an uninitialized AudioRecord object lpRecorder = new AudioRecord(); if(lpRecorder == NULL) { - LOGE("Error creating AudioRecord instance."); + ALOGE("Error creating AudioRecord instance."); return AUDIORECORD_ERROR_SETUP_NATIVEINITFAILED; } @@ -190,7 +190,7 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this, // this data will be passed with every AudioRecord callback jclass clazz = env->GetObjectClass(thiz); if (clazz == NULL) { - LOGE("Can't find %s when setting up callback.", kClassPathName); + ALOGE("Can't find %s when setting up callback.", kClassPathName); goto native_track_failure; } lpCallbackData = new audiorecord_callback_cookie; @@ -211,13 +211,13 @@ android_media_AudioRecord_setup(JNIEnv *env, jobject thiz, jobject weak_this, sessionId); if(lpRecorder->initCheck() != NO_ERROR) { - LOGE("Error creating AudioRecord instance: initialization check failed."); + ALOGE("Error creating AudioRecord instance: initialization check failed."); goto native_init_failure; } nSession = (jint *) env->GetPrimitiveArrayCritical(jSession, NULL); if (nSession == NULL) { - LOGE("Error creating AudioRecord: Error retrieving session id pointer"); + ALOGE("Error creating AudioRecord: Error retrieving session id pointer"); goto native_init_failure; } // read the audio session ID back from AudioTrack in case a new session was created during set() @@ -332,12 +332,12 @@ static jint android_media_AudioRecord_readInByteArray(JNIEnv *env, jobject thiz lpRecorder = (AudioRecord *)env->GetIntField(thiz, javaAudioRecordFields.nativeRecorderInJavaObj); if (lpRecorder == NULL) { - LOGE("Unable to retrieve AudioRecord object, can't record"); + ALOGE("Unable to retrieve AudioRecord object, can't record"); return 0; } if (!javaAudioData) { - LOGE("Invalid Java array to store recorded audio, can't record"); + ALOGE("Invalid Java array to store recorded audio, can't record"); return 0; } @@ -349,7 +349,7 @@ static jint android_media_AudioRecord_readInByteArray(JNIEnv *env, jobject thiz recordBuff = (jbyte *)env->GetByteArrayElements(javaAudioData, NULL); if (recordBuff == NULL) { - LOGE("Error retrieving destination for recorded audio data, can't record"); + ALOGE("Error retrieving destination for recorded audio data, can't record"); return 0; } @@ -390,13 +390,13 @@ static jint android_media_AudioRecord_readInDirectBuffer(JNIEnv *env, jobject t long capacity = env->GetDirectBufferCapacity(jBuffer); if(capacity == -1) { // buffer direct access is not supported - LOGE("Buffer direct access is not supported, can't record"); + ALOGE("Buffer direct access is not supported, can't record"); return 0; } //ALOGV("capacity = %ld", capacity); jbyte* nativeFromJavaBuf = (jbyte*) env->GetDirectBufferAddress(jBuffer); if(nativeFromJavaBuf==NULL) { - LOGE("Buffer direct access is not supported, can't record"); + ALOGE("Buffer direct access is not supported, can't record"); return 0; } @@ -555,7 +555,7 @@ int register_android_media_AudioRecord(JNIEnv *env) // Get the AudioRecord class jclass audioRecordClass = env->FindClass(kClassPathName); if (audioRecordClass == NULL) { - LOGE("Can't find %s", kClassPathName); + ALOGE("Can't find %s", kClassPathName); return -1; } // Get the postEvent method @@ -563,7 +563,7 @@ int register_android_media_AudioRecord(JNIEnv *env) audioRecordClass, JAVA_POSTEVENT_CALLBACK_NAME, "(Ljava/lang/Object;IIILjava/lang/Object;)V"); if (javaAudioRecordFields.postNativeEventInJava == NULL) { - LOGE("Can't find AudioRecord.%s", JAVA_POSTEVENT_CALLBACK_NAME); + ALOGE("Can't find AudioRecord.%s", JAVA_POSTEVENT_CALLBACK_NAME); return -1; } @@ -573,7 +573,7 @@ int register_android_media_AudioRecord(JNIEnv *env) env->GetFieldID(audioRecordClass, JAVA_NATIVERECORDERINJAVAOBJ_FIELD_NAME, "I"); if (javaAudioRecordFields.nativeRecorderInJavaObj == NULL) { - LOGE("Can't find AudioRecord.%s", JAVA_NATIVERECORDERINJAVAOBJ_FIELD_NAME); + ALOGE("Can't find AudioRecord.%s", JAVA_NATIVERECORDERINJAVAOBJ_FIELD_NAME); return -1; } // mNativeCallbackCookie @@ -581,7 +581,7 @@ int register_android_media_AudioRecord(JNIEnv *env) audioRecordClass, JAVA_NATIVECALLBACKINFO_FIELD_NAME, "I"); if (javaAudioRecordFields.nativeCallbackCookie == NULL) { - LOGE("Can't find AudioRecord.%s", JAVA_NATIVECALLBACKINFO_FIELD_NAME); + ALOGE("Can't find AudioRecord.%s", JAVA_NATIVECALLBACKINFO_FIELD_NAME); return -1; } @@ -589,7 +589,7 @@ int register_android_media_AudioRecord(JNIEnv *env) jclass audioFormatClass = NULL; audioFormatClass = env->FindClass(JAVA_AUDIOFORMAT_CLASS_NAME); if (audioFormatClass == NULL) { - LOGE("Can't find %s", JAVA_AUDIOFORMAT_CLASS_NAME); + ALOGE("Can't find %s", JAVA_AUDIOFORMAT_CLASS_NAME); return -1; } if ( !android_media_getIntConstantFromClass(env, audioFormatClass, diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp index 84e7432decccb..859878dce57bd 100644 --- a/core/jni/android_media_AudioTrack.cpp +++ b/core/jni/android_media_AudioTrack.cpp @@ -176,11 +176,11 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th int afFrameCount; if (AudioSystem::getOutputFrameCount(&afFrameCount, streamType) != NO_ERROR) { - LOGE("Error creating AudioTrack: Could not get AudioSystem frame count."); + ALOGE("Error creating AudioTrack: Could not get AudioSystem frame count."); return AUDIOTRACK_ERROR_SETUP_AUDIOSYSTEM; } if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) { - LOGE("Error creating AudioTrack: Could not get AudioSystem sampling rate."); + ALOGE("Error creating AudioTrack: Could not get AudioSystem sampling rate."); return AUDIOTRACK_ERROR_SETUP_AUDIOSYSTEM; } @@ -189,7 +189,7 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th uint32_t nativeChannelMask = ((uint32_t)javaChannelMask) >> 2; if (!audio_is_output_channel(nativeChannelMask)) { - LOGE("Error creating AudioTrack: invalid channel mask."); + ALOGE("Error creating AudioTrack: invalid channel mask."); return AUDIOTRACK_ERROR_SETUP_INVALIDCHANNELMASK; } @@ -214,14 +214,14 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th } else if (streamType == javaAudioTrackFields.STREAM_DTMF) { atStreamType = AUDIO_STREAM_DTMF; } else { - LOGE("Error creating AudioTrack: unknown stream type."); + ALOGE("Error creating AudioTrack: unknown stream type."); return AUDIOTRACK_ERROR_SETUP_INVALIDSTREAMTYPE; } // check the format. // This function was called from Java, so we compare the format against the Java constants if ((audioFormat != javaAudioTrackFields.PCM16) && (audioFormat != javaAudioTrackFields.PCM8)) { - LOGE("Error creating AudioTrack: unsupported audio format."); + ALOGE("Error creating AudioTrack: unsupported audio format."); return AUDIOTRACK_ERROR_SETUP_INVALIDFORMAT; } @@ -250,7 +250,7 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th // this data will be passed with every AudioTrack callback jclass clazz = env->GetObjectClass(thiz); if (clazz == NULL) { - LOGE("Can't find %s when setting up callback.", kClassPathName); + ALOGE("Can't find %s when setting up callback.", kClassPathName); delete lpJniStorage; return AUDIOTRACK_ERROR_SETUP_NATIVEINITFAILED; } @@ -261,14 +261,14 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th lpJniStorage->mStreamType = atStreamType; if (jSession == NULL) { - LOGE("Error creating AudioTrack: invalid session ID pointer"); + ALOGE("Error creating AudioTrack: invalid session ID pointer"); delete lpJniStorage; return AUDIOTRACK_ERROR; } jint* nSession = (jint *) env->GetPrimitiveArrayCritical(jSession, NULL); if (nSession == NULL) { - LOGE("Error creating AudioTrack: Error retrieving session id pointer"); + ALOGE("Error creating AudioTrack: Error retrieving session id pointer"); delete lpJniStorage; return AUDIOTRACK_ERROR; } @@ -279,7 +279,7 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th // create the native AudioTrack object AudioTrack* lpTrack = new AudioTrack(); if (lpTrack == NULL) { - LOGE("Error creating uninitialized AudioTrack"); + ALOGE("Error creating uninitialized AudioTrack"); goto native_track_failure; } @@ -303,7 +303,7 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th // AudioTrack is using shared memory if (!lpJniStorage->allocSharedMem(buffSizeInBytes)) { - LOGE("Error creating AudioTrack in static mode: error creating mem heap base"); + ALOGE("Error creating AudioTrack in static mode: error creating mem heap base"); goto native_init_failure; } @@ -322,13 +322,13 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th } if (lpTrack->initCheck() != NO_ERROR) { - LOGE("Error initializing AudioTrack"); + ALOGE("Error initializing AudioTrack"); goto native_init_failure; } nSession = (jint *) env->GetPrimitiveArrayCritical(jSession, NULL); if (nSession == NULL) { - LOGE("Error creating AudioTrack: Error retrieving session id pointer"); + ALOGE("Error creating AudioTrack: Error retrieving session id pointer"); goto native_init_failure; } // read the audio session ID back from AudioTrack in case we create a new session @@ -544,11 +544,11 @@ static jint android_media_AudioTrack_native_write(JNIEnv *env, jobject thiz, if (javaAudioData) { cAudioData = (jbyte *)env->GetByteArrayElements(javaAudioData, NULL); if (cAudioData == NULL) { - LOGE("Error retrieving source of audio data to play, can't play"); + ALOGE("Error retrieving source of audio data to play, can't play"); return 0; // out of memory or no data to load } } else { - LOGE("NULL java array of audio data to play, can't play"); + ALOGE("NULL java array of audio data to play, can't play"); return 0; } @@ -785,7 +785,7 @@ static jint android_media_AudioTrack_get_output_sample_rate(JNIEnv *env, jobjec } if (AudioSystem::getOutputSamplingRate(&afSamplingRate, nativeStreamType) != NO_ERROR) { - LOGE("AudioSystem::getOutputSamplingRate() for stream type %d failed in AudioTrack JNI", + ALOGE("AudioSystem::getOutputSamplingRate() for stream type %d failed in AudioTrack JNI", nativeStreamType); return DEFAULT_OUTPUT_SAMPLE_RATE; } else { @@ -913,7 +913,7 @@ bool android_media_getIntConstantFromClass(JNIEnv* pEnv, jclass theClass, const *constVal = pEnv->GetStaticIntField(theClass, javaConst); return true; } else { - LOGE("Can't find %s.%s", className, constName); + ALOGE("Can't find %s.%s", className, constName); return false; } } @@ -928,7 +928,7 @@ int register_android_media_AudioTrack(JNIEnv *env) // Get the AudioTrack class jclass audioTrackClass = env->FindClass(kClassPathName); if (audioTrackClass == NULL) { - LOGE("Can't find %s", kClassPathName); + ALOGE("Can't find %s", kClassPathName); return -1; } @@ -937,7 +937,7 @@ int register_android_media_AudioTrack(JNIEnv *env) audioTrackClass, JAVA_POSTEVENT_CALLBACK_NAME, "(Ljava/lang/Object;IIILjava/lang/Object;)V"); if (javaAudioTrackFields.postNativeEventInJava == NULL) { - LOGE("Can't find AudioTrack.%s", JAVA_POSTEVENT_CALLBACK_NAME); + ALOGE("Can't find AudioTrack.%s", JAVA_POSTEVENT_CALLBACK_NAME); return -1; } @@ -947,7 +947,7 @@ int register_android_media_AudioTrack(JNIEnv *env) audioTrackClass, JAVA_NATIVETRACKINJAVAOBJ_FIELD_NAME, "I"); if (javaAudioTrackFields.nativeTrackInJavaObj == NULL) { - LOGE("Can't find AudioTrack.%s", JAVA_NATIVETRACKINJAVAOBJ_FIELD_NAME); + ALOGE("Can't find AudioTrack.%s", JAVA_NATIVETRACKINJAVAOBJ_FIELD_NAME); return -1; } // jniData; @@ -955,7 +955,7 @@ int register_android_media_AudioTrack(JNIEnv *env) audioTrackClass, JAVA_JNIDATA_FIELD_NAME, "I"); if (javaAudioTrackFields.jniData == NULL) { - LOGE("Can't find AudioTrack.%s", JAVA_JNIDATA_FIELD_NAME); + ALOGE("Can't find AudioTrack.%s", JAVA_JNIDATA_FIELD_NAME); return -1; } @@ -974,7 +974,7 @@ int register_android_media_AudioTrack(JNIEnv *env) jclass audioFormatClass = NULL; audioFormatClass = env->FindClass(JAVA_AUDIOFORMAT_CLASS_NAME); if (audioFormatClass == NULL) { - LOGE("Can't find %s", JAVA_AUDIOFORMAT_CLASS_NAME); + ALOGE("Can't find %s", JAVA_AUDIOFORMAT_CLASS_NAME); return -1; } if ( !android_media_getIntConstantFromClass(env, audioFormatClass, @@ -991,7 +991,7 @@ int register_android_media_AudioTrack(JNIEnv *env) jclass audioManagerClass = NULL; audioManagerClass = env->FindClass(JAVA_AUDIOMANAGER_CLASS_NAME); if (audioManagerClass == NULL) { - LOGE("Can't find %s", JAVA_AUDIOMANAGER_CLASS_NAME); + ALOGE("Can't find %s", JAVA_AUDIOMANAGER_CLASS_NAME); return -1; } if ( !android_media_getIntConstantFromClass(env, audioManagerClass, diff --git a/core/jni/android_media_JetPlayer.cpp b/core/jni/android_media_JetPlayer.cpp index 66421a98d391d..85c0a9c66af19 100644 --- a/core/jni/android_media_JetPlayer.cpp +++ b/core/jni/android_media_JetPlayer.cpp @@ -66,7 +66,7 @@ jetPlayerEventCallback(int what, int arg1=0, int arg2=0, void* javaTarget = NULL env->ExceptionClear(); } } else { - LOGE("JET jetPlayerEventCallback(): No JNI env for JET event callback, can't post event."); + ALOGE("JET jetPlayerEventCallback(): No JNI env for JET event callback, can't post event."); return; } } @@ -90,7 +90,7 @@ android_media_JetPlayer_setup(JNIEnv *env, jobject thiz, jobject weak_this, env->SetIntField(thiz, javaJetPlayerFields.nativePlayerInJavaObj, (int)lpJet); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_setup(): initialization failed with EAS error code %d", (int)result); + ALOGE("android_media_JetPlayer_setup(): initialization failed with EAS error code %d", (int)result); delete lpJet; env->SetIntField(weak_this, javaJetPlayerFields.nativePlayerInJavaObj, 0); return JNI_FALSE; @@ -140,7 +140,7 @@ android_media_JetPlayer_loadFromFile(JNIEnv *env, jobject thiz, jstring path) const char *pathStr = env->GetStringUTFChars(path, NULL); if (pathStr == NULL) { // Out of memory - LOGE("android_media_JetPlayer_openFile(): aborting, out of memory"); + ALOGE("android_media_JetPlayer_openFile(): aborting, out of memory"); return JNI_FALSE; } @@ -152,7 +152,7 @@ android_media_JetPlayer_loadFromFile(JNIEnv *env, jobject thiz, jstring path) //ALOGV("android_media_JetPlayer_openFile(): file successfully opened"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_openFile(): failed to open file with EAS error %d", + ALOGE("android_media_JetPlayer_openFile(): failed to open file with EAS error %d", (int)result); return JNI_FALSE; } @@ -182,7 +182,7 @@ android_media_JetPlayer_loadFromFileD(JNIEnv *env, jobject thiz, ALOGV("android_media_JetPlayer_openFileDescr(): file successfully opened"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_openFileDescr(): failed to open file with EAS error %d", + ALOGE("android_media_JetPlayer_openFileDescr(): failed to open file with EAS error %d", (int)result); return JNI_FALSE; } @@ -204,7 +204,7 @@ android_media_JetPlayer_closeFile(JNIEnv *env, jobject thiz) //ALOGV("android_media_JetPlayer_closeFile(): file successfully closed"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_closeFile(): failed to close file"); + ALOGE("android_media_JetPlayer_closeFile(): failed to close file"); return JNI_FALSE; } } @@ -226,7 +226,7 @@ android_media_JetPlayer_play(JNIEnv *env, jobject thiz) //ALOGV("android_media_JetPlayer_play(): play successful"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_play(): failed to play with EAS error code %ld", + ALOGE("android_media_JetPlayer_play(): failed to play with EAS error code %ld", result); return JNI_FALSE; } @@ -253,7 +253,7 @@ android_media_JetPlayer_pause(JNIEnv *env, jobject thiz) ALOGV("android_media_JetPlayer_pause(): paused with an empty queue"); return JNI_TRUE; } else - LOGE("android_media_JetPlayer_pause(): failed to pause with EAS error code %ld", + ALOGE("android_media_JetPlayer_pause(): failed to pause with EAS error code %ld", result); return JNI_FALSE; } @@ -279,7 +279,7 @@ android_media_JetPlayer_queueSegment(JNIEnv *env, jobject thiz, //ALOGV("android_media_JetPlayer_queueSegment(): segment successfully queued"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_queueSegment(): failed with EAS error code %ld", + ALOGE("android_media_JetPlayer_queueSegment(): failed with EAS error code %ld", result); return JNI_FALSE; } @@ -304,7 +304,7 @@ android_media_JetPlayer_queueSegmentMuteArray(JNIEnv *env, jobject thiz, jboolean *muteTracks = NULL; muteTracks = env->GetBooleanArrayElements(muteArray, NULL); if (muteTracks == NULL) { - LOGE("android_media_JetPlayer_queueSegment(): failed to read track mute mask."); + ALOGE("android_media_JetPlayer_queueSegment(): failed to read track mute mask."); return JNI_FALSE; } @@ -325,7 +325,7 @@ android_media_JetPlayer_queueSegmentMuteArray(JNIEnv *env, jobject thiz, //ALOGV("android_media_JetPlayer_queueSegmentMuteArray(): segment successfully queued"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_queueSegmentMuteArray(): failed with EAS error code %ld", + ALOGE("android_media_JetPlayer_queueSegmentMuteArray(): failed with EAS error code %ld", result); return JNI_FALSE; } @@ -350,7 +350,7 @@ android_media_JetPlayer_setMuteFlags(JNIEnv *env, jobject thiz, //ALOGV("android_media_JetPlayer_setMuteFlags(): mute flags successfully updated"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_setMuteFlags(): failed with EAS error code %ld", result); + ALOGE("android_media_JetPlayer_setMuteFlags(): failed with EAS error code %ld", result); return JNI_FALSE; } } @@ -373,7 +373,7 @@ android_media_JetPlayer_setMuteArray(JNIEnv *env, jobject thiz, jboolean *muteTracks = NULL; muteTracks = env->GetBooleanArrayElements(muteArray, NULL); if (muteTracks == NULL) { - LOGE("android_media_JetPlayer_setMuteArray(): failed to read track mute mask."); + ALOGE("android_media_JetPlayer_setMuteArray(): failed to read track mute mask."); return JNI_FALSE; } @@ -394,7 +394,7 @@ android_media_JetPlayer_setMuteArray(JNIEnv *env, jobject thiz, //ALOGV("android_media_JetPlayer_setMuteArray(): mute flags successfully updated"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_setMuteArray(): \ + ALOGE("android_media_JetPlayer_setMuteArray(): \ failed to update mute flags with EAS error code %ld", result); return JNI_FALSE; } @@ -420,7 +420,7 @@ android_media_JetPlayer_setMuteFlag(JNIEnv *env, jobject thiz, //ALOGV("android_media_JetPlayer_setMuteFlag(): mute flag successfully updated for track %d", trackId); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_setMuteFlag(): failed to update mute flag for track %d with EAS error code %ld", + ALOGE("android_media_JetPlayer_setMuteFlag(): failed to update mute flag for track %d with EAS error code %ld", trackId, result); return JNI_FALSE; } @@ -444,7 +444,7 @@ android_media_JetPlayer_triggerClip(JNIEnv *env, jobject thiz, jint clipId) //ALOGV("android_media_JetPlayer_triggerClip(): triggerClip successful for clip %d", clipId); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_triggerClip(): triggerClip for clip %d failed with EAS error code %ld", + ALOGE("android_media_JetPlayer_triggerClip(): triggerClip for clip %d failed with EAS error code %ld", clipId, result); return JNI_FALSE; } @@ -467,7 +467,7 @@ android_media_JetPlayer_clearQueue(JNIEnv *env, jobject thiz) //ALOGV("android_media_JetPlayer_clearQueue(): clearQueue successful"); return JNI_TRUE; } else { - LOGE("android_media_JetPlayer_clearQueue(): clearQueue failed with EAS error code %ld", + ALOGE("android_media_JetPlayer_clearQueue(): clearQueue failed with EAS error code %ld", result); return JNI_FALSE; } @@ -513,7 +513,7 @@ int register_android_media_JetPlayer(JNIEnv *env) // Get the JetPlayer java class jetPlayerClass = env->FindClass(kClassPathName); if (jetPlayerClass == NULL) { - LOGE("Can't find %s", kClassPathName); + ALOGE("Can't find %s", kClassPathName); return -1; } javaJetPlayerFields.jetClass = (jclass)env->NewGlobalRef(jetPlayerClass); @@ -523,7 +523,7 @@ int register_android_media_JetPlayer(JNIEnv *env) jetPlayerClass, JAVA_NATIVEJETPLAYERINJAVAOBJ_FIELD_NAME, "I"); if (javaJetPlayerFields.nativePlayerInJavaObj == NULL) { - LOGE("Can't find AudioTrack.%s", JAVA_NATIVEJETPLAYERINJAVAOBJ_FIELD_NAME); + ALOGE("Can't find AudioTrack.%s", JAVA_NATIVEJETPLAYERINJAVAOBJ_FIELD_NAME); return -1; } @@ -531,7 +531,7 @@ int register_android_media_JetPlayer(JNIEnv *env) javaJetPlayerFields.postNativeEventInJava = env->GetStaticMethodID(javaJetPlayerFields.jetClass, JAVA_NATIVEJETPOSTEVENT_CALLBACK_NAME, "(Ljava/lang/Object;III)V"); if (javaJetPlayerFields.postNativeEventInJava == NULL) { - LOGE("Can't find Jet.%s", JAVA_NATIVEJETPOSTEVENT_CALLBACK_NAME); + ALOGE("Can't find Jet.%s", JAVA_NATIVEJETPOSTEVENT_CALLBACK_NAME); return -1; } diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp index 965afae297cc3..49be1c71ffe06 100644 --- a/core/jni/android_media_ToneGenerator.cpp +++ b/core/jni/android_media_ToneGenerator.cpp @@ -86,14 +86,14 @@ static void android_media_ToneGenerator_native_setup(JNIEnv *env, jobject thiz, ALOGV("android_media_ToneGenerator_native_setup jobject: %x\n", (int)thiz); if (lpToneGen == NULL) { - LOGE("ToneGenerator creation failed \n"); + ALOGE("ToneGenerator creation failed \n"); jniThrowException(env, "java/lang/OutOfMemoryError", NULL); return; } ALOGV("ToneGenerator lpToneGen: %x\n", (unsigned int)lpToneGen); if (!lpToneGen->isInited()) { - LOGE("ToneGenerator init failed \n"); + ALOGE("ToneGenerator init failed \n"); jniThrowRuntimeException(env, "Init failed"); return; } @@ -133,13 +133,13 @@ int register_android_media_ToneGenerator(JNIEnv *env) { clazz = env->FindClass("android/media/ToneGenerator"); if (clazz == NULL) { - LOGE("Can't find %s", "android/media/ToneGenerator"); + ALOGE("Can't find %s", "android/media/ToneGenerator"); return -1; } fields.context = env->GetFieldID(clazz, "mNativeContext", "I"); if (fields.context == NULL) { - LOGE("Can't find ToneGenerator.mNativeContext"); + ALOGE("Can't find ToneGenerator.mNativeContext"); return -1; } ALOGV("register_android_media_ToneGenerator ToneGenerator fields.context: %x", (unsigned int)fields.context); diff --git a/core/jni/android_net_LocalSocketImpl.cpp b/core/jni/android_net_LocalSocketImpl.cpp index c8add7066d7c1..1426b2cd376b4 100644 --- a/core/jni/android_net_LocalSocketImpl.cpp +++ b/core/jni/android_net_LocalSocketImpl.cpp @@ -957,7 +957,7 @@ int register_android_net_LocalSocketImpl(JNIEnv *env) "android/net/LocalSocketImpl", gMethods, NELEM(gMethods)); error: - LOGE("Error registering android.net.LocalSocketImpl"); + ALOGE("Error registering android.net.LocalSocketImpl"); return -1; } diff --git a/core/jni/android_net_TrafficStats.cpp b/core/jni/android_net_TrafficStats.cpp index 7a6143226265c..0ab659b2382f0 100644 --- a/core/jni/android_net_TrafficStats.cpp +++ b/core/jni/android_net_TrafficStats.cpp @@ -47,13 +47,13 @@ static jlong readNumber(char const* filename) { char buf[80]; int fd = open(filename, O_RDONLY); if (fd < 0) { - if (errno != ENOENT) LOGE("Can't open %s: %s", filename, strerror(errno)); + if (errno != ENOENT) ALOGE("Can't open %s: %s", filename, strerror(errno)); return -1; } int len = read(fd, buf, sizeof(buf) - 1); if (len < 0) { - LOGE("Can't read %s: %s", filename, strerror(errno)); + ALOGE("Can't read %s: %s", filename, strerror(errno)); close(fd); return -1; } @@ -101,7 +101,7 @@ static jlong readTotal(char const* suffix) { char filename[PATH_MAX] = "/sys/class/net/"; DIR *dir = opendir(filename); if (dir == NULL) { - LOGE("Can't list %s: %s", filename, strerror(errno)); + ALOGE("Can't list %s: %s", filename, strerror(errno)); return -1; } diff --git a/core/jni/android_nfc_NdefMessage.cpp b/core/jni/android_nfc_NdefMessage.cpp index 82476cd6f99cf..e6c05547b6754 100644 --- a/core/jni/android_nfc_NdefMessage.cpp +++ b/core/jni/android_nfc_NdefMessage.cpp @@ -55,7 +55,7 @@ static jint android_nfc_NdefMessage_parseNdefMessage(JNIEnv *e, jobject o, (uint32_t)raw_msg_size, NULL, NULL, &num_of_records); if (status) { - LOGE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x", status); + ALOGE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x", status); goto end; } TRACE("phFriNfc_NdefRecord_GetRecords(NULL) returned 0x%04x, with %d records", status, num_of_records); @@ -74,7 +74,7 @@ static jint android_nfc_NdefMessage_parseNdefMessage(JNIEnv *e, jobject o, (uint32_t)raw_msg_size, records, is_chunked, &num_of_records); if (status) { - LOGE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x", status); + ALOGE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x", status); goto end; } TRACE("phFriNfc_NdefRecord_GetRecords() returned 0x%04x, with %d records", status, num_of_records); @@ -97,7 +97,7 @@ static jint android_nfc_NdefMessage_parseNdefMessage(JNIEnv *e, jobject o, status = phFriNfc_NdefRecord_Parse(&record, records[i]); if (status) { - LOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status); + ALOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status); goto end; } TRACE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status); @@ -111,7 +111,7 @@ static jint android_nfc_NdefMessage_parseNdefMessage(JNIEnv *e, jobject o, (uint64_t)record.PayloadLength; if (indicatedMsgLength > (uint64_t)raw_msg_size) { - LOGE("phFri_NdefRecord_Parse: invalid length field"); + ALOGE("phFri_NdefRecord_Parse: invalid length field"); goto end; } diff --git a/core/jni/android_nfc_NdefRecord.cpp b/core/jni/android_nfc_NdefRecord.cpp index 67907b69d20c5..2d0e2b9dfdedf 100644 --- a/core/jni/android_nfc_NdefRecord.cpp +++ b/core/jni/android_nfc_NdefRecord.cpp @@ -60,7 +60,7 @@ static jbyteArray android_nfc_NdefRecord_generate( &record_size); if (status) { - LOGE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status); + ALOGE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status); goto end; } TRACE("phFriNfc_NdefRecord_Generate() returned 0x%04x", status); @@ -107,7 +107,7 @@ static jint android_nfc_NdefRecord_parseNdefRecord(JNIEnv *e, jobject o, TRACE("phFriNfc_NdefRecord_Parse()"); status = phFriNfc_NdefRecord_Parse(&record, (uint8_t *)raw_record); if (status) { - LOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status); + ALOGE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status); goto clean_and_return; } TRACE("phFriNfc_NdefRecord_Parse() returned 0x%04x", status); diff --git a/core/jni/android_os_StatFs.cpp b/core/jni/android_os_StatFs.cpp index c658aa587ec62..79d8fef12862e 100644 --- a/core/jni/android_os_StatFs.cpp +++ b/core/jni/android_os_StatFs.cpp @@ -91,7 +91,7 @@ android_os_StatFs_native_restat(JNIEnv *env, jobject thiz, jstring path) // note that stat will contain the new file data corresponding to // pathstr if (statfs(pathstr, stat) != 0) { - LOGE("statfs %s failed, errno: %d", pathstr, errno); + ALOGE("statfs %s failed, errno: %d", pathstr, errno); delete stat; env->SetIntField(thiz, fields.context, 0); jniThrowException(env, "java/lang/IllegalArgumentException", NULL); @@ -146,13 +146,13 @@ int register_android_os_StatFs(JNIEnv *env) clazz = env->FindClass("android/os/StatFs"); if (clazz == NULL) { - LOGE("Can't find android/os/StatFs"); + ALOGE("Can't find android/os/StatFs"); return -1; } fields.context = env->GetFieldID(clazz, "mNativeContext", "I"); if (fields.context == NULL) { - LOGE("Can't find StatFs.mNativeContext"); + ALOGE("Can't find StatFs.mNativeContext"); return -1; } diff --git a/core/jni/android_os_UEventObserver.cpp b/core/jni/android_os_UEventObserver.cpp index 7f31b00270ae5..5639f4f8a01f0 100644 --- a/core/jni/android_os_UEventObserver.cpp +++ b/core/jni/android_os_UEventObserver.cpp @@ -59,7 +59,7 @@ int register_android_os_UEventObserver(JNIEnv *env) clazz = env->FindClass("android/os/UEventObserver"); if (clazz == NULL) { - LOGE("Can't find android/os/UEventObserver"); + ALOGE("Can't find android/os/UEventObserver"); return -1; } diff --git a/core/jni/android_server_BluetoothA2dpService.cpp b/core/jni/android_server_BluetoothA2dpService.cpp index 2bab4b565cde5..d065a9e1ecaf3 100644 --- a/core/jni/android_server_BluetoothA2dpService.cpp +++ b/core/jni/android_server_BluetoothA2dpService.cpp @@ -65,7 +65,7 @@ static bool initNative(JNIEnv* env, jobject object) { #ifdef HAVE_BLUETOOTH nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { - LOGE("%s: out of memory!", __FUNCTION__); + ALOGE("%s: out of memory!", __FUNCTION__); return false; } env->GetJavaVM( &(nat->vm) ); @@ -77,7 +77,7 @@ static bool initNative(JNIEnv* env, jobject object) { dbus_threads_init_default(); nat->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); if (dbus_error_is_set(&err)) { - LOGE("Could not get onto the system bus: %s", err.message); + ALOGE("Could not get onto the system bus: %s", err.message); dbus_error_free(&err); return false; } @@ -117,7 +117,7 @@ static jobjectArray getSinkPropertiesNative(JNIEnv *env, jobject object, LOG_AND_FREE_DBUS_ERROR_WITH_MSG(&err, reply); return NULL; } else if (!reply) { - LOGE("DBus reply is NULL in function %s", __FUNCTION__); + ALOGE("DBus reply is NULL in function %s", __FUNCTION__); return NULL; } DBusMessageIter iter; @@ -268,7 +268,7 @@ DBusHandlerResult a2dp_event_filter(DBusMessage *msg, JNIEnv *env) { ALOGV("... ignored"); } if (env->ExceptionCheck()) { - LOGE("VM Exception occurred while handling %s.%s (%s) in %s," + ALOGE("VM Exception occurred while handling %s.%s (%s) in %s," " leaving for VM", dbus_message_get_interface(msg), dbus_message_get_member(msg), dbus_message_get_path(msg), __FUNCTION__); @@ -326,7 +326,7 @@ static JNINativeMethod sMethods[] = { int register_android_server_BluetoothA2dpService(JNIEnv *env) { jclass clazz = env->FindClass("android/server/BluetoothA2dpService"); if (clazz == NULL) { - LOGE("Can't find android/server/BluetoothA2dpService"); + ALOGE("Can't find android/server/BluetoothA2dpService"); return -1; } diff --git a/core/jni/android_server_BluetoothEventLoop.cpp b/core/jni/android_server_BluetoothEventLoop.cpp index 1924dbf95ca3b..9292fc02113c5 100644 --- a/core/jni/android_server_BluetoothEventLoop.cpp +++ b/core/jni/android_server_BluetoothEventLoop.cpp @@ -161,7 +161,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object) { #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { - LOGE("%s: out of memory!", __FUNCTION__); + ALOGE("%s: out of memory!", __FUNCTION__); return; } memset(nat, 0, sizeof(native_data_t)); @@ -176,7 +176,7 @@ static void initializeNativeDataNative(JNIEnv* env, jobject object) { dbus_threads_init_default(); nat->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); if (dbus_error_is_set(&err)) { - LOGE("%s: Could not get onto the system bus!", __FUNCTION__); + ALOGE("%s: Could not get onto the system bus!", __FUNCTION__); dbus_error_free(&err); } dbus_connection_set_exit_on_disconnect(nat->conn, FALSE); @@ -321,7 +321,7 @@ const char * get_adapter_path(DBusConnection *conn) { msg = dbus_message_new_method_call("org.bluez", "/", "org.bluez.Manager", "DefaultAdapter"); if (!msg) { - LOGE("%s: Can't allocate new method call for get_adapter_path!", + ALOGE("%s: Can't allocate new method call for get_adapter_path!", __FUNCTION__); return NULL; } @@ -346,7 +346,7 @@ const char * get_adapter_path(DBusConnection *conn) { } } if (attempt == 1000) { - LOGE("Time out while trying to get Adapter path, is bluetoothd up ?"); + ALOGE("Time out while trying to get Adapter path, is bluetoothd up ?"); goto failed; } @@ -375,7 +375,7 @@ static int register_agent(native_data_t *nat, if (!dbus_connection_register_object_path(nat->conn, agent_path, &agent_vtable, nat)) { - LOGE("%s: Can't register object path %s for agent!", + ALOGE("%s: Can't register object path %s for agent!", __FUNCTION__, agent_path); return -1; } @@ -387,7 +387,7 @@ static int register_agent(native_data_t *nat, msg = dbus_message_new_method_call("org.bluez", nat->adapter, "org.bluez.Adapter", "RegisterAgent"); if (!msg) { - LOGE("%s: Can't allocate new method call for agent!", + ALOGE("%s: Can't allocate new method call for agent!", __FUNCTION__); return -1; } @@ -400,7 +400,7 @@ static int register_agent(native_data_t *nat, dbus_message_unref(msg); if (!reply) { - LOGE("%s: Can't register agent!", __FUNCTION__); + ALOGE("%s: Can't register agent!", __FUNCTION__); if (dbus_error_is_set(&err)) { LOG_AND_FREE_DBUS_ERROR(&err); } @@ -442,7 +442,7 @@ static void tearDownEventLoop(native_data_t *nat) { } dbus_message_unref(msg); } else { - LOGE("%s: Can't create new method call!", __FUNCTION__); + ALOGE("%s: Can't create new method call!", __FUNCTION__); } dbus_connection_flush(nat->conn); @@ -725,14 +725,14 @@ static jboolean startEventLoopNative(JNIEnv *env, jobject object) { nat->pollData = (struct pollfd *)malloc(sizeof(struct pollfd) * DEFAULT_INITIAL_POLLFD_COUNT); if (!nat->pollData) { - LOGE("out of memory error starting EventLoop!"); + ALOGE("out of memory error starting EventLoop!"); goto done; } nat->watchData = (DBusWatch **)malloc(sizeof(DBusWatch *) * DEFAULT_INITIAL_POLLFD_COUNT); if (!nat->watchData) { - LOGE("out of memory error starting EventLoop!"); + ALOGE("out of memory error starting EventLoop!"); goto done; } @@ -744,7 +744,7 @@ static jboolean startEventLoopNative(JNIEnv *env, jobject object) { nat->pollMemberCount = 1; if (socketpair(AF_LOCAL, SOCK_STREAM, 0, &(nat->controlFdR))) { - LOGE("Error getting BT control socket"); + ALOGE("Error getting BT control socket"); goto done; } nat->pollData[0].fd = nat->controlFdR; @@ -756,7 +756,7 @@ static jboolean startEventLoopNative(JNIEnv *env, jobject object) { nat->me = env->NewGlobalRef(object); if (setUpEventLoop(nat) != JNI_TRUE) { - LOGE("failure setting up Event Loop!"); + ALOGE("failure setting up Event Loop!"); goto done; } @@ -1111,7 +1111,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, // reply DBusMessage *reply = dbus_message_new_method_return(msg); if (!reply) { - LOGE("%s: Cannot create message reply\n", __FUNCTION__); + ALOGE("%s: Cannot create message reply\n", __FUNCTION__); goto failure; } dbus_connection_send(nat->conn, reply, NULL); @@ -1126,7 +1126,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for Authorize() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for Authorize() method", __FUNCTION__); goto failure; } @@ -1145,7 +1145,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for OutOfBandData available() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for OutOfBandData available() method", __FUNCTION__); goto failure; } @@ -1160,7 +1160,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, if (available) { DBusMessage *reply = dbus_message_new_method_return(msg); if (!reply) { - LOGE("%s: Cannot create message reply\n", __FUNCTION__); + ALOGE("%s: Cannot create message reply\n", __FUNCTION__); goto failure; } dbus_connection_send(nat->conn, reply, NULL); @@ -1169,7 +1169,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, DBusMessage *reply = dbus_message_new_error(msg, "org.bluez.Error.DoesNotExist", "OutofBand data not available"); if (!reply) { - LOGE("%s: Cannot create message reply\n", __FUNCTION__); + ALOGE("%s: Cannot create message reply\n", __FUNCTION__); goto failure; } dbus_connection_send(nat->conn, reply, NULL); @@ -1182,7 +1182,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for RequestPinCode() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for RequestPinCode() method", __FUNCTION__); goto failure; } @@ -1197,7 +1197,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for RequestPasskey() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for RequestPasskey() method", __FUNCTION__); goto failure; } @@ -1212,7 +1212,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for RequestOobData() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for RequestOobData() method", __FUNCTION__); goto failure; } @@ -1229,7 +1229,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_UINT32, &passkey, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for RequestPasskey() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for RequestPasskey() method", __FUNCTION__); goto failure; } @@ -1247,7 +1247,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_UINT32, &passkey, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for RequestConfirmation() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for RequestConfirmation() method", __FUNCTION__); goto failure; } @@ -1263,7 +1263,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID)) { - LOGE("%s: Invalid arguments for RequestPairingConsent() method", __FUNCTION__); + ALOGE("%s: Invalid arguments for RequestPairingConsent() method", __FUNCTION__); goto failure; } @@ -1277,7 +1277,7 @@ DBusHandlerResult agent_event_filter(DBusConnection *conn, // reply DBusMessage *reply = dbus_message_new_method_return(msg); if (!reply) { - LOGE("%s: Cannot create message reply\n", __FUNCTION__); + ALOGE("%s: Cannot create message reply\n", __FUNCTION__); goto failure; } dbus_connection_send(nat->conn, reply, NULL); @@ -1354,7 +1354,7 @@ void onCreatePairedDeviceResult(DBusMessage *msg, void *user, void *n) { ALOGV("... error = %s (%s)\n", err.name, err.message); result = BOND_RESULT_AUTH_TIMEOUT; } else { - LOGE("%s: D-Bus error: %s (%s)\n", __FUNCTION__, err.name, err.message); + ALOGE("%s: D-Bus error: %s (%s)\n", __FUNCTION__, err.name, err.message); result = BOND_RESULT_ERROR; } } @@ -1445,7 +1445,7 @@ void onGetDeviceServiceChannelResult(DBusMessage *msg, void *user, void *n) { !dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &channel, DBUS_TYPE_INVALID)) { - LOGE("%s: D-Bus error: %s (%s)\n", __FUNCTION__, err.name, err.message); + ALOGE("%s: D-Bus error: %s (%s)\n", __FUNCTION__, err.name, err.message); dbus_error_free(&err); } diff --git a/core/jni/android_server_BluetoothService.cpp b/core/jni/android_server_BluetoothService.cpp index 2aeca86d7828b..eba378dbb2df8 100644 --- a/core/jni/android_server_BluetoothService.cpp +++ b/core/jni/android_server_BluetoothService.cpp @@ -89,7 +89,7 @@ static inline native_data_t * get_native_data(JNIEnv *env, jobject object) { native_data_t *nat = (native_data_t *)(env->GetIntField(object, field_mNativeData)); if (nat == NULL || nat->conn == NULL) { - LOGE("Uninitialized native data\n"); + ALOGE("Uninitialized native data\n"); return NULL; } return nat; @@ -113,7 +113,7 @@ static bool initializeNativeDataNative(JNIEnv* env, jobject object) { #ifdef HAVE_BLUETOOTH native_data_t *nat = (native_data_t *)calloc(1, sizeof(native_data_t)); if (NULL == nat) { - LOGE("%s: out of memory!", __FUNCTION__); + ALOGE("%s: out of memory!", __FUNCTION__); return false; } nat->env = env; @@ -124,7 +124,7 @@ static bool initializeNativeDataNative(JNIEnv* env, jobject object) { dbus_threads_init_default(); nat->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); if (dbus_error_is_set(&err)) { - LOGE("Could not get onto the system bus: %s", err.message); + ALOGE("Could not get onto the system bus: %s", err.message); dbus_error_free(&err); return false; } @@ -162,7 +162,7 @@ static jboolean setupNativeDataNative(JNIEnv* env, jobject object) { if (!dbus_connection_register_object_path(nat->conn, device_agent_path, &agent_vtable, event_nat)) { - LOGE("%s: Can't register object path %s for remote device agent!", + ALOGE("%s: Can't register object path %s for remote device agent!", __FUNCTION__, device_agent_path); return JNI_FALSE; } @@ -332,7 +332,7 @@ static jbyteArray readAdapterOutOfBandDataNative(JNIEnv *env, jobject object) { env->SetByteArrayRegion(byteArray, 16, 16, randomizer); } } else { - LOGE("readAdapterOutOfBandDataNative: Hash len = %d, R len = %d", + ALOGE("readAdapterOutOfBandDataNative: Hash len = %d, R len = %d", hash_len, r_len); } } else { @@ -466,7 +466,7 @@ static jboolean cancelDeviceCreationNative(JNIEnv *env, jobject object, if (dbus_error_is_set(&err)) { LOG_AND_FREE_DBUS_ERROR(&err); } else - LOGE("DBus reply is NULL in function %s", __FUNCTION__); + ALOGE("DBus reply is NULL in function %s", __FUNCTION__); return JNI_FALSE; } else { result = JNI_TRUE; @@ -540,7 +540,7 @@ static jboolean setPairingConfirmationNative(JNIEnv *env, jobject object, } if (!reply) { - LOGE("%s: Cannot create message reply to RequestPasskeyConfirmation or" + ALOGE("%s: Cannot create message reply to RequestPasskeyConfirmation or" "RequestPairingConsent to D-Bus\n", __FUNCTION__); dbus_message_unref(msg); return JNI_FALSE; @@ -564,7 +564,7 @@ static jboolean setPasskeyNative(JNIEnv *env, jobject object, jstring address, DBusMessage *msg = (DBusMessage *)nativeData; DBusMessage *reply = dbus_message_new_method_return(msg); if (!reply) { - LOGE("%s: Cannot create message reply to return Passkey code to " + ALOGE("%s: Cannot create message reply to return Passkey code to " "D-Bus\n", __FUNCTION__); dbus_message_unref(msg); return JNI_FALSE; @@ -593,7 +593,7 @@ static jboolean setRemoteOutOfBandDataNative(JNIEnv *env, jobject object, jstrin jbyte *h_ptr = env->GetByteArrayElements(hash, NULL); jbyte *r_ptr = env->GetByteArrayElements(randomizer, NULL); if (!reply) { - LOGE("%s: Cannot create message reply to return remote OOB data to " + ALOGE("%s: Cannot create message reply to return remote OOB data to " "D-Bus\n", __FUNCTION__); dbus_message_unref(msg); return JNI_FALSE; @@ -631,7 +631,7 @@ static jboolean setAuthorizationNative(JNIEnv *env, jobject object, jstring addr "org.bluez.Error.Rejected", "Authorization rejected"); } if (!reply) { - LOGE("%s: Cannot create message reply D-Bus\n", __FUNCTION__); + ALOGE("%s: Cannot create message reply D-Bus\n", __FUNCTION__); dbus_message_unref(msg); return JNI_FALSE; } @@ -654,7 +654,7 @@ static jboolean setPinNative(JNIEnv *env, jobject object, jstring address, DBusMessage *msg = (DBusMessage *)nativeData; DBusMessage *reply = dbus_message_new_method_return(msg); if (!reply) { - LOGE("%s: Cannot create message reply to return PIN code to " + ALOGE("%s: Cannot create message reply to return PIN code to " "D-Bus\n", __FUNCTION__); dbus_message_unref(msg); return JNI_FALSE; @@ -685,7 +685,7 @@ static jboolean cancelPairingUserInputNative(JNIEnv *env, jobject object, DBusMessage *reply = dbus_message_new_error(msg, "org.bluez.Error.Canceled", "Pairing User Input was canceled"); if (!reply) { - LOGE("%s: Cannot create message reply to return cancelUserInput to" + ALOGE("%s: Cannot create message reply to return cancelUserInput to" "D-BUS\n", __FUNCTION__); dbus_message_unref(msg); return JNI_FALSE; @@ -722,7 +722,7 @@ static jobjectArray getDevicePropertiesNative(JNIEnv *env, jobject object, if (dbus_error_is_set(&err)) { LOG_AND_FREE_DBUS_ERROR(&err); } else - LOGE("DBus reply is NULL in function %s", __FUNCTION__); + ALOGE("DBus reply is NULL in function %s", __FUNCTION__); return NULL; } env->PushLocalFrame(PROPERTIES_NREFS); @@ -756,7 +756,7 @@ static jobjectArray getAdapterPropertiesNative(JNIEnv *env, jobject object) { if (dbus_error_is_set(&err)) { LOG_AND_FREE_DBUS_ERROR(&err); } else - LOGE("DBus reply is NULL in function %s", __FUNCTION__); + ALOGE("DBus reply is NULL in function %s", __FUNCTION__); return NULL; } env->PushLocalFrame(PROPERTIES_NREFS); @@ -788,7 +788,7 @@ static jboolean setAdapterPropertyNative(JNIEnv *env, jobject object, jstring ke get_adapter_path(env, object), DBUS_ADAPTER_IFACE, "SetProperty"); if (!msg) { - LOGE("%s: Can't allocate new method call for GetProperties!", + ALOGE("%s: Can't allocate new method call for GetProperties!", __FUNCTION__); env->ReleaseStringUTFChars(key, c_key); return JNI_FALSE; @@ -856,7 +856,7 @@ static jboolean setDevicePropertyNative(JNIEnv *env, jobject object, jstring pat msg = dbus_message_new_method_call(BLUEZ_DBUS_BASE_IFC, c_path, DBUS_DEVICE_IFACE, "SetProperty"); if (!msg) { - LOGE("%s: Can't allocate new method call for device SetProperty!", __FUNCTION__); + ALOGE("%s: Can't allocate new method call for device SetProperty!", __FUNCTION__); env->ReleaseStringUTFChars(key, c_key); env->ReleaseStringUTFChars(path, c_path); return JNI_FALSE; @@ -985,7 +985,7 @@ static jintArray extract_handles(JNIEnv *env, DBusMessage *reply) { if (handleArray) { env->SetIntArrayRegion(handleArray, 0, len, handles); } else { - LOGE("Null array in extract_handles"); + ALOGE("Null array in extract_handles"); } } else { LOG_AND_FREE_DBUS_ERROR(&err); @@ -1169,7 +1169,7 @@ static jboolean setBluetoothTetheringNative(JNIEnv *env, jobject object, jboolea const char *c_role = env->GetStringUTFChars(src_role, NULL); const char *c_bridge = env->GetStringUTFChars(bridge, NULL); if (value) { - LOGE("setBluetoothTetheringNative true"); + ALOGE("setBluetoothTetheringNative true"); reply = dbus_func_args(env, nat->conn, get_adapter_path(env, object), DBUS_NETWORKSERVER_IFACE, @@ -1178,7 +1178,7 @@ static jboolean setBluetoothTetheringNative(JNIEnv *env, jobject object, jboolea DBUS_TYPE_STRING, &c_bridge, DBUS_TYPE_INVALID); } else { - LOGE("setBluetoothTetheringNative false"); + ALOGE("setBluetoothTetheringNative false"); reply = dbus_func_args(env, nat->conn, get_adapter_path(env, object), DBUS_NETWORKSERVER_IFACE, @@ -1198,7 +1198,7 @@ static jboolean connectPanDeviceNative(JNIEnv *env, jobject object, jstring path jstring dstRole) { ALOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH - LOGE("connectPanDeviceNative"); + ALOGE("connectPanDeviceNative"); native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); struct event_loop_native_data_t *eventLoopNat = @@ -1230,7 +1230,7 @@ static jboolean disconnectPanDeviceNative(JNIEnv *env, jobject object, jstring path) { ALOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH - LOGE("disconnectPanDeviceNative"); + ALOGE("disconnectPanDeviceNative"); native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); struct event_loop_native_data_t *eventLoopNat = @@ -1260,7 +1260,7 @@ static jboolean disconnectPanServerDeviceNative(JNIEnv *env, jobject object, jstring iface) { ALOGV("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH - LOGE("disconnectPanServerDeviceNative"); + ALOGE("disconnectPanServerDeviceNative"); native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); struct event_loop_native_data_t *eventLoopNat = @@ -1316,7 +1316,7 @@ static jstring registerHealthApplicationNative(JNIEnv *env, jobject object, "CreateApplication"); if (msg == NULL) { - LOGE("Could not allocate D-Bus message object!"); + ALOGE("Could not allocate D-Bus message object!"); return NULL; } @@ -1379,7 +1379,7 @@ static jstring registerSinkHealthApplicationNative(JNIEnv *env, jobject object, "CreateApplication"); if (msg == NULL) { - LOGE("Could not allocate D-Bus message object!"); + ALOGE("Could not allocate D-Bus message object!"); return NULL; } @@ -1487,7 +1487,7 @@ static jboolean createChannelNative(JNIEnv *env, jobject object, static jboolean destroyChannelNative(JNIEnv *env, jobject object, jstring devicePath, jstring channelPath, jint code) { - LOGE("%s", __FUNCTION__); + ALOGE("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); jobject eventLoop = env->GetObjectField(object, field_mEventLoop); @@ -1517,7 +1517,7 @@ static jboolean destroyChannelNative(JNIEnv *env, jobject object, jstring device } static jstring getMainChannelNative(JNIEnv *env, jobject object, jstring devicePath) { - LOGE("%s", __FUNCTION__); + ALOGE("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { @@ -1551,7 +1551,7 @@ static jstring getMainChannelNative(JNIEnv *env, jobject object, jstring deviceP } static jstring getChannelApplicationNative(JNIEnv *env, jobject object, jstring channelPath) { - LOGE("%s", __FUNCTION__); + ALOGE("%s", __FUNCTION__); #ifdef HAVE_BLUETOOTH native_data_t *nat = get_native_data(env, object); if (nat) { diff --git a/core/jni/android_server_NetworkManagementSocketTagger.cpp b/core/jni/android_server_NetworkManagementSocketTagger.cpp index c279cedc40e60..12beff7463e03 100644 --- a/core/jni/android_server_NetworkManagementSocketTagger.cpp +++ b/core/jni/android_server_NetworkManagementSocketTagger.cpp @@ -36,7 +36,7 @@ static jint QTagUid_tagSocketFd(JNIEnv* env, jclass, int userFd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionOccurred() != NULL) { - LOGE("Can't get FileDescriptor num"); + ALOGE("Can't get FileDescriptor num"); return (jint)-1; } @@ -52,7 +52,7 @@ static int QTagUid_untagSocketFd(JNIEnv* env, jclass, int userFd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionOccurred() != NULL) { - LOGE("Can't get FileDescriptor num"); + ALOGE("Can't get FileDescriptor num"); return (jint)-1; } diff --git a/core/jni/android_server_Watchdog.cpp b/core/jni/android_server_Watchdog.cpp index cf52833802b8a..6726c14a26e2c 100644 --- a/core/jni/android_server_Watchdog.cpp +++ b/core/jni/android_server_Watchdog.cpp @@ -48,7 +48,7 @@ static void dumpOneStack(int tid, int outFd) { write(outFd, "\n", 1); close(stackFd); } else { - LOGE("Unable to open stack of tid %d : %d (%s)", tid, errno, strerror(errno)); + ALOGE("Unable to open stack of tid %d : %d (%s)", tid, errno, strerror(errno)); } } @@ -67,7 +67,7 @@ static void dumpKernelStacks(JNIEnv* env, jobject clazz, jstring pathStr) { int outFd = open(path, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (outFd < 0) { - LOGE("Unable to open stack dump file: %d (%s)", errno, strerror(errno)); + ALOGE("Unable to open stack dump file: %d (%s)", errno, strerror(errno)); goto done; } diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index 4d6bfbc1e60a0..990a617e723fa 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -194,8 +194,8 @@ static void report_exception(JNIEnv* env, jthrowable excep, const char* msg) if ((tagstr == NULL) || (msgstr == NULL)) { env->ExceptionClear(); /* assume exception (OOM?) was thrown */ - LOGE("Unable to call Log.e()\n"); - LOGE("%s", msg); + ALOGE("Unable to call Log.e()\n"); + ALOGE("%s", msg); goto bail; } @@ -221,7 +221,7 @@ static void report_exception(JNIEnv* env, jthrowable excep, const char* msg) env->Throw(excep); vm->DetachCurrentThread(); sleep(60); - LOGE("Forcefully exiting"); + ALOGE("Forcefully exiting"); exit(1); *((int *) 1) = 1; } @@ -699,7 +699,7 @@ static void signalExceptionForError(JNIEnv* env, jobject obj, status_t err, jniThrowException(env, "java/lang/RuntimeException", "Unknown transaction code"); break; case FAILED_TRANSACTION: - LOGE("!!! FAILED BINDER TRANSACTION !!!"); + ALOGE("!!! FAILED BINDER TRANSACTION !!!"); // TransactionTooLargeException is a checked exception, only throw from certain methods. // FIXME: Transaction too large is the most common reason for FAILED_TRANSACTION // but it is not the only one. The Binder driver can return BR_FAILED_REPLY @@ -715,7 +715,7 @@ static void signalExceptionForError(JNIEnv* env, jobject obj, status_t err, "Not allowed to write file descriptors here"); break; default: - LOGE("Unknown binder error code. 0x%x", err); + ALOGE("Unknown binder error code. 0x%x", err); String8 msg; msg.appendFormat("Unknown binder error code. 0x%x", err); // RemoteException is a checked exception, only throw from certain methods. diff --git a/core/jni/android_util_EventLog.cpp b/core/jni/android_util_EventLog.cpp index 5d51110c3d33d..a3981ce8ec00f 100644 --- a/core/jni/android_util_EventLog.cpp +++ b/core/jni/android_util_EventLog.cpp @@ -267,7 +267,7 @@ int register_android_util_EventLog(JNIEnv* env) { for (int i = 0; i < NELEM(gClasses); ++i) { jclass clazz = env->FindClass(gClasses[i].name); if (clazz == NULL) { - LOGE("Can't find class: %s\n", gClasses[i].name); + ALOGE("Can't find class: %s\n", gClasses[i].name); return -1; } *gClasses[i].clazz = (jclass) env->NewGlobalRef(clazz); @@ -277,7 +277,7 @@ int register_android_util_EventLog(JNIEnv* env) { *gFields[i].id = env->GetFieldID( *gFields[i].c, gFields[i].name, gFields[i].ft); if (*gFields[i].id == NULL) { - LOGE("Can't find field: %s\n", gFields[i].name); + ALOGE("Can't find field: %s\n", gFields[i].name); return -1; } } @@ -286,7 +286,7 @@ int register_android_util_EventLog(JNIEnv* env) { *gMethods[i].id = env->GetMethodID( *gMethods[i].c, gMethods[i].name, gMethods[i].mt); if (*gMethods[i].id == NULL) { - LOGE("Can't find method: %s\n", gMethods[i].name); + ALOGE("Can't find method: %s\n", gMethods[i].name); return -1; } } diff --git a/core/jni/android_util_FileObserver.cpp b/core/jni/android_util_FileObserver.cpp index 65e71304e8b67..0327d8c491d96 100644 --- a/core/jni/android_util_FileObserver.cpp +++ b/core/jni/android_util_FileObserver.cpp @@ -67,7 +67,7 @@ static void android_os_fileobserver_observe(JNIEnv* env, jobject object, jint fd if (errno == EINTR) continue; - LOGE("***** ERROR! android_os_fileobserver_observe() got a short event!"); + ALOGE("***** ERROR! android_os_fileobserver_observe() got a short event!"); return; } @@ -148,14 +148,14 @@ int register_android_os_FileObserver(JNIEnv* env) if (clazz == NULL) { - LOGE("Can't find android/os/FileObserver$ObserverThread"); + ALOGE("Can't find android/os/FileObserver$ObserverThread"); return -1; } method_onEvent = env->GetMethodID(clazz, "onEvent", "(IILjava/lang/String;)V"); if (method_onEvent == NULL) { - LOGE("Can't find FileObserver.onEvent(int, int, String)"); + ALOGE("Can't find FileObserver.onEvent(int, int, String)"); return -1; } diff --git a/core/jni/android_util_Log.cpp b/core/jni/android_util_Log.cpp index 2c7bb8466b41f..a57aad72db524 100644 --- a/core/jni/android_util_Log.cpp +++ b/core/jni/android_util_Log.cpp @@ -139,7 +139,7 @@ int register_android_util_Log(JNIEnv* env) jclass clazz = env->FindClass("android/util/Log"); if (clazz == NULL) { - LOGE("Can't find android/util/Log"); + ALOGE("Can't find android/util/Log"); return -1; } diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp index 9245d994c1a2e..2c494ac82ae2b 100644 --- a/core/jni/android_util_Process.cpp +++ b/core/jni/android_util_Process.cpp @@ -227,7 +227,7 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin t_pid = atoi(de->d_name); if (!t_pid) { - LOGE("Error getting pid for '%s'\n", de->d_name); + ALOGE("Error getting pid for '%s'\n", de->d_name); continue; } @@ -274,7 +274,7 @@ void android_os_Process_setThreadPriority(JNIEnv* env, jobject clazz, if (pid == androidGetTid()) { void* bgOk = pthread_getspecific(gBgKey); if (bgOk == ((void*)0xbaad)) { - LOGE("Thread marked fg-only put self in background!"); + ALOGE("Thread marked fg-only put self in background!"); jniThrowException(env, "java/lang/SecurityException", "May not put this thread into background"); return; } diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp index d4b902474cdf5..03d94c9e73ca0 100644 --- a/core/jni/android_view_GLES20Canvas.cpp +++ b/core/jni/android_view_GLES20Canvas.cpp @@ -492,7 +492,7 @@ static void renderText(OpenGLRenderer* renderer, const jchar* text, int count, #if USE_TEXT_LAYOUT_CACHE value = TextLayoutCache::getInstance().getValue(paint, text, 0, count, count, flags); if (value == NULL) { - LOGE("Cannot get TextLayoutCache value"); + ALOGE("Cannot get TextLayoutCache value"); return ; } #else @@ -522,7 +522,7 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text, #if USE_TEXT_LAYOUT_CACHE value = TextLayoutCache::getInstance().getValue(paint, text, start, count, contextCount, flags); if (value == NULL) { - LOGE("Cannot get TextLayoutCache value"); + ALOGE("Cannot get TextLayoutCache value"); return ; } #else diff --git a/core/jni/android_view_InputChannel.cpp b/core/jni/android_view_InputChannel.cpp index e0976a11e0141..fce432bf5d0d3 100644 --- a/core/jni/android_view_InputChannel.cpp +++ b/core/jni/android_view_InputChannel.cpp @@ -202,17 +202,17 @@ static void android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject int32_t parcelAshmemFd = parcel->readFileDescriptor(); int32_t ashmemFd = dup(parcelAshmemFd); if (ashmemFd < 0) { - LOGE("Error %d dup ashmem fd %d.", errno, parcelAshmemFd); + ALOGE("Error %d dup ashmem fd %d.", errno, parcelAshmemFd); } int32_t parcelReceivePipeFd = parcel->readFileDescriptor(); int32_t receivePipeFd = dup(parcelReceivePipeFd); if (receivePipeFd < 0) { - LOGE("Error %d dup receive pipe fd %d.", errno, parcelReceivePipeFd); + ALOGE("Error %d dup receive pipe fd %d.", errno, parcelReceivePipeFd); } int32_t parcelSendPipeFd = parcel->readFileDescriptor(); int32_t sendPipeFd = dup(parcelSendPipeFd); if (sendPipeFd < 0) { - LOGE("Error %d dup send pipe fd %d.", errno, parcelSendPipeFd); + ALOGE("Error %d dup send pipe fd %d.", errno, parcelSendPipeFd); } if (ashmemFd < 0 || receivePipeFd < 0 || sendPipeFd < 0) { if (ashmemFd >= 0) ::close(ashmemFd); diff --git a/core/jni/android_view_InputQueue.cpp b/core/jni/android_view_InputQueue.cpp index f4955cde857c4..8541933b25ce8 100644 --- a/core/jni/android_view_InputQueue.cpp +++ b/core/jni/android_view_InputQueue.cpp @@ -307,14 +307,14 @@ int NativeInputQueue::handleReceiveCallback(int receiveFd, int events, void* dat ssize_t connectionIndex = q->mConnectionsByReceiveFd.indexOfKey(receiveFd); if (connectionIndex < 0) { - LOGE("Received spurious receive callback for unknown input channel. " + ALOGE("Received spurious receive callback for unknown input channel. " "fd=%d, events=0x%x", receiveFd, events); return 0; // remove the callback } connection = q->mConnectionsByReceiveFd.valueAt(connectionIndex); if (events & (ALOOPER_EVENT_ERROR | ALOOPER_EVENT_HANGUP)) { - LOGE("channel '%s' ~ Publisher closed input channel or an error occurred. " + ALOGE("channel '%s' ~ Publisher closed input channel or an error occurred. " "events=0x%x", connection->getInputChannelName(), events); return 0; // remove the callback } @@ -327,7 +327,7 @@ int NativeInputQueue::handleReceiveCallback(int receiveFd, int events, void* dat status_t status = connection->inputConsumer.receiveDispatchSignal(); if (status) { - LOGE("channel '%s' ~ Failed to receive dispatch signal. status=%d", + ALOGE("channel '%s' ~ Failed to receive dispatch signal. status=%d", connection->getInputChannelName(), status); return 0; // remove the callback } @@ -409,7 +409,7 @@ int NativeInputQueue::handleReceiveCallback(int receiveFd, int events, void* dat #endif if (env->ExceptionCheck()) { - LOGE("An exception occurred while invoking the input handler for an event."); + ALOGE("An exception occurred while invoking the input handler for an event."); LOGE_EX(env); env->ExceptionClear(); diff --git a/core/jni/android_view_KeyEvent.cpp b/core/jni/android_view_KeyEvent.cpp index 78951aa985322..27469a22f06f2 100644 --- a/core/jni/android_view_KeyEvent.cpp +++ b/core/jni/android_view_KeyEvent.cpp @@ -63,7 +63,7 @@ jobject android_view_KeyEvent_fromNative(JNIEnv* env, const KeyEvent* event) { event->getSource(), NULL); if (env->ExceptionCheck()) { - LOGE("An exception occurred while obtaining a key event."); + ALOGE("An exception occurred while obtaining a key event."); LOGE_EX(env); env->ExceptionClear(); return NULL; diff --git a/core/jni/android_view_MotionEvent.cpp b/core/jni/android_view_MotionEvent.cpp index fccc66ea18a15..2def1d14b7f39 100644 --- a/core/jni/android_view_MotionEvent.cpp +++ b/core/jni/android_view_MotionEvent.cpp @@ -80,7 +80,7 @@ jobject android_view_MotionEvent_obtainAsCopy(JNIEnv* env, const MotionEvent* ev jobject eventObj = env->CallStaticObjectMethod(gMotionEventClassInfo.clazz, gMotionEventClassInfo.obtain); if (env->ExceptionCheck() || !eventObj) { - LOGE("An exception occurred while obtaining a motion event."); + ALOGE("An exception occurred while obtaining a motion event."); LOGE_EX(env); env->ExceptionClear(); return NULL; diff --git a/drm/common/ReadWriteUtils.cpp b/drm/common/ReadWriteUtils.cpp index c16214e2eaff1..fd17e98d307a2 100644 --- a/drm/common/ReadWriteUtils.cpp +++ b/drm/common/ReadWriteUtils.cpp @@ -85,7 +85,7 @@ void ReadWriteUtils::writeToFile(const String8& filePath, const String8& data) { int size = data.size(); if (FAILURE != ftruncate(fd, size)) { if (size != write(fd, data.string(), size)) { - LOGE("Failed to write the data to: %s", filePath.string()); + ALOGE("Failed to write the data to: %s", filePath.string()); } } fclose(file); @@ -101,7 +101,7 @@ void ReadWriteUtils::appendToFile(const String8& filePath, const String8& data) int size = data.size(); if (size != write(fd, data.string(), size)) { - LOGE("Failed to write the data to: %s", filePath.string()); + ALOGE("Failed to write the data to: %s", filePath.string()); } fclose(file); } diff --git a/drm/jni/android_drm_DrmManagerClient.cpp b/drm/jni/android_drm_DrmManagerClient.cpp index e34046fe9e31e..dfc7fb2c66a7d 100644 --- a/drm/jni/android_drm_DrmManagerClient.cpp +++ b/drm/jni/android_drm_DrmManagerClient.cpp @@ -169,7 +169,7 @@ JNIOnInfoListener::JNIOnInfoListener(JNIEnv* env, jobject thiz, jobject weak_thi jclass clazz = env->GetObjectClass(thiz); if (clazz == NULL) { - LOGE("Can't find android/drm/DrmManagerClient"); + ALOGE("Can't find android/drm/DrmManagerClient"); jniThrowException(env, "java/lang/Exception", NULL); return; } diff --git a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp index 7799040e3ddb7..0273a4b532a44 100644 --- a/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp +++ b/drm/libdrmframework/plugins/forward-lock/FwdLockEngine/src/FwdLockEngine.cpp @@ -92,12 +92,12 @@ int FwdLockEngine::getConvertedStatus(FwdLockConv_Status_t status) { case FwdLockConv_Status_InvalidArgument: case FwdLockConv_Status_UnsupportedFileFormat: case FwdLockConv_Status_UnsupportedContentTransferEncoding: - LOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. " + ALOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. " "Returning STATUS_INPUTDATA_ERROR", status); retStatus = DrmConvertedStatus::STATUS_INPUTDATA_ERROR; break; default: - LOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. " + ALOGE("FwdLockEngine getConvertedStatus: file conversion Error %d. " "Returning STATUS_ERROR", status); retStatus = DrmConvertedStatus::STATUS_ERROR; break; @@ -139,7 +139,7 @@ android::status_t FwdLockEngine::onInitialize(int uniqueId) { if (FwdLockGlue_InitializeKeyEncryption()) { LOG_VERBOSE("FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption succeeded"); } else { - LOGE("FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption failed:" + ALOGE("FwdLockEngine::onInitialize -- FwdLockGlue_InitializeKeyEncryption failed:" "errno = %d", errno); } @@ -351,7 +351,7 @@ status_t FwdLockEngine::onOpenConvertSession(int uniqueId, convertSessionMap.addValue(convertId, newSession); result = DRM_NO_ERROR; } else { - LOGE("FwdLockEngine::onOpenConvertSession -- FwdLockConv_OpenSession failed."); + ALOGE("FwdLockEngine::onOpenConvertSession -- FwdLockConv_OpenSession failed."); delete newSession; } } @@ -448,7 +448,7 @@ status_t FwdLockEngine::onOpenDecryptSession(int uniqueId, (!decodeSessionMap.isCreated(decryptHandle->decryptId))) { fileDesc = dup(fd); } else { - LOGE("FwdLockEngine::onOpenDecryptSession parameter error"); + ALOGE("FwdLockEngine::onOpenDecryptSession parameter error"); return result; } @@ -550,13 +550,13 @@ status_t FwdLockEngine::onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo) { - LOGE("FwdLockEngine::onInitializeDecryptUnit is not supported for this DRM scheme"); + ALOGE("FwdLockEngine::onInitializeDecryptUnit is not supported for this DRM scheme"); return DRM_ERROR_UNKNOWN; } status_t FwdLockEngine::onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) { - LOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme"); + ALOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme"); return DRM_ERROR_UNKNOWN; } @@ -565,14 +565,14 @@ status_t FwdLockEngine::onDecrypt(int uniqueId, int decryptUnitId, const DrmBuffer* encBuffer, DrmBuffer** decBuffer) { - LOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme"); + ALOGE("FwdLockEngine::onDecrypt is not supported for this DRM scheme"); return DRM_ERROR_UNKNOWN; } status_t FwdLockEngine::onFinalizeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) { - LOGE("FwdLockEngine::onFinalizeDecryptUnit is not supported for this DRM scheme"); + ALOGE("FwdLockEngine::onFinalizeDecryptUnit is not supported for this DRM scheme"); return DRM_ERROR_UNKNOWN; } @@ -650,11 +650,11 @@ ssize_t FwdLockEngine::onPread(int uniqueId, if (((off_t)-1) != decoderSession->offset) { bytesRead = onRead(uniqueId, decryptHandle, buffer, numBytes); if (bytesRead < 0) { - LOGE("FwdLockEngine::onPread error reading"); + ALOGE("FwdLockEngine::onPread error reading"); } } } else { - LOGE("FwdLockEngine::onPread decryptId not found"); + ALOGE("FwdLockEngine::onPread decryptId not found"); } return bytesRead; diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index c4ef9931fd4d0..bc1db4dc33100 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -47,7 +47,7 @@ #include #include -//#define LOG_API LOGE +//#define LOG_API ALOGE #define LOG_API(...) using namespace android; @@ -1333,13 +1333,13 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) jint result = -1; if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { - LOGE("ERROR: GetEnv failed\n"); + ALOGE("ERROR: GetEnv failed\n"); goto bail; } assert(env != NULL); if (registerFuncs(env) < 0) { - LOGE("ERROR: MediaPlayer native registration failed\n"); + ALOGE("ERROR: MediaPlayer native registration failed\n"); goto bail; } diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp index e8fb1d9b7d7f8..47a62db41d25b 100644 --- a/libs/binder/BpBinder.cpp +++ b/libs/binder/BpBinder.cpp @@ -50,7 +50,7 @@ void BpBinder::ObjectManager::attach( e.func = func; if (mObjects.indexOfKey(objectID) >= 0) { - LOGE("Trying to attach object ID %p to binder ObjectManager %p with object %p, but object ID already in use", + ALOGE("Trying to attach object ID %p to binder ObjectManager %p with object %p, but object ID already in use", objectID, this, object); return; } diff --git a/libs/binder/CursorWindow.cpp b/libs/binder/CursorWindow.cpp index 19b763180b9bb..a6e5f711da540 100644 --- a/libs/binder/CursorWindow.cpp +++ b/libs/binder/CursorWindow.cpp @@ -150,7 +150,7 @@ status_t CursorWindow::setNumColumns(uint32_t numColumns) { uint32_t cur = mHeader->numColumns; if ((cur > 0 || mHeader->numRows > 0) && cur != numColumns) { - LOGE("Trying to go from %d columns to %d", cur, numColumns); + ALOGE("Trying to go from %d columns to %d", cur, numColumns); return INVALID_OPERATION; } mHeader->numColumns = numColumns; @@ -255,14 +255,14 @@ CursorWindow::RowSlot* CursorWindow::allocRowSlot() { CursorWindow::FieldSlot* CursorWindow::getFieldSlot(uint32_t row, uint32_t column) { if (row >= mHeader->numRows || column >= mHeader->numColumns) { - LOGE("Failed to read row %d, column %d from a CursorWindow which " + ALOGE("Failed to read row %d, column %d from a CursorWindow which " "has %d rows, %d columns.", row, column, mHeader->numRows, mHeader->numColumns); return NULL; } RowSlot* rowSlot = getRowSlot(row); if (!rowSlot) { - LOGE("Failed to find rowSlot for row %d.", row); + ALOGE("Failed to find rowSlot for row %d.", row); return NULL; } FieldSlot* fieldDir = static_cast(offsetToPtr(rowSlot->offset)); diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp index 2111fe80c3abe..cd2451a67652f 100644 --- a/libs/binder/IMemory.cpp +++ b/libs/binder/IMemory.cpp @@ -298,11 +298,11 @@ void BpMemoryHeap::assertReallyMapped() const uint32_t flags = reply.readInt32(); uint32_t offset = reply.readInt32(); - LOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)", + ALOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)", asBinder().get(), parcel_fd, size, err, strerror(-err)); int fd = dup( parcel_fd ); - LOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, err=%d (%s)", + ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, err=%d (%s)", parcel_fd, size, err, strerror(errno)); int access = PROT_READ; @@ -315,7 +315,7 @@ void BpMemoryHeap::assertReallyMapped() const mRealHeap = true; mBase = mmap(0, size, access, MAP_SHARED, fd, offset); if (mBase == MAP_FAILED) { - LOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)", + ALOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)", asBinder().get(), size, fd, strerror(errno)); close(fd); } else { @@ -446,7 +446,7 @@ void HeapCache::free_heap(const wp& binder) mHeapCache.removeItemsAt(i); } } else { - LOGE("free_heap binder=%p not found!!!", binder.unsafe_get()); + ALOGE("free_heap binder=%p not found!!!", binder.unsafe_get()); } } } diff --git a/libs/binder/MemoryDealer.cpp b/libs/binder/MemoryDealer.cpp index fcdb1bce149a3..ff5e6bda95cd6 100644 --- a/libs/binder/MemoryDealer.cpp +++ b/libs/binder/MemoryDealer.cpp @@ -344,7 +344,7 @@ ssize_t SimpleBestFitAllocator::alloc(size_t size, uint32_t flags) mList.insertBefore(free_chunk, split); } - LOGE_IF((flags&PAGE_ALIGNED) && + ALOGE_IF((flags&PAGE_ALIGNED) && ((free_chunk->start*kMemoryAlign)&(pagesize-1)), "PAGE_ALIGNED requested, but page is not aligned!!!"); diff --git a/libs/binder/MemoryHeapBase.cpp b/libs/binder/MemoryHeapBase.cpp index e171374700512..d1cbf1cbae85f 100644 --- a/libs/binder/MemoryHeapBase.cpp +++ b/libs/binder/MemoryHeapBase.cpp @@ -53,7 +53,7 @@ MemoryHeapBase::MemoryHeapBase(size_t size, uint32_t flags, char const * name) const size_t pagesize = getpagesize(); size = ((size + pagesize-1) & ~(pagesize-1)); int fd = ashmem_create_region(name == NULL ? "MemoryHeapBase" : name, size); - LOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); + ALOGE_IF(fd<0, "error creating ashmem region: %s", strerror(errno)); if (fd >= 0) { if (mapfd(fd, size) == NO_ERROR) { if (flags & READ_ONLY) { @@ -72,7 +72,7 @@ MemoryHeapBase::MemoryHeapBase(const char* device, size_t size, uint32_t flags) open_flags |= O_SYNC; int fd = open(device, open_flags); - LOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); + ALOGE_IF(fd<0, "error opening %s: %s", device, strerror(errno)); if (fd >= 0) { const size_t pagesize = getpagesize(); size = ((size + pagesize-1) & ~(pagesize-1)); @@ -127,7 +127,7 @@ status_t MemoryHeapBase::mapfd(int fd, size_t size, uint32_t offset) void* base = (uint8_t*)mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); if (base == MAP_FAILED) { - LOGE("mmap(fd=%d, size=%u) failed (%s)", + ALOGE("mmap(fd=%d, size=%u) failed (%s)", fd, uint32_t(size), strerror(errno)); close(fd); return -errno; diff --git a/libs/binder/MemoryHeapPmem.cpp b/libs/binder/MemoryHeapPmem.cpp index 03322ea5d9c4c..66bcf4d2c7294 100644 --- a/libs/binder/MemoryHeapPmem.cpp +++ b/libs/binder/MemoryHeapPmem.cpp @@ -79,7 +79,7 @@ SubRegionMemory::SubRegionMemory(const sp& heap, int our_fd = heap->heapID(); struct pmem_region sub = { offset, size }; int err = ioctl(our_fd, PMEM_MAP, &sub); - LOGE_IF(err<0, "PMEM_MAP failed (%s), " + ALOGE_IF(err<0, "PMEM_MAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); } @@ -115,7 +115,7 @@ void SubRegionMemory::revoke() sub.offset = mOffset; sub.len = mSize; int err = ioctl(our_fd, PMEM_UNMAP, &sub); - LOGE_IF(err<0, "PMEM_UNMAP failed (%s), " + ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); mSize = 0; @@ -133,11 +133,11 @@ MemoryHeapPmem::MemoryHeapPmem(const sp& pmemHeap, #ifdef HAVE_ANDROID_OS if (device) { int fd = open(device, O_RDWR | (flags & NO_CACHING ? O_SYNC : 0)); - LOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno)); + ALOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno)); if (fd >= 0) { int err = ioctl(fd, PMEM_CONNECT, pmemHeap->heapID()); if (err < 0) { - LOGE("PMEM_CONNECT failed (%s), mFD=%d, sub-fd=%d", + ALOGE("PMEM_CONNECT failed (%s), mFD=%d, sub-fd=%d", strerror(errno), fd, pmemHeap->heapID()); close(fd); } else { @@ -194,7 +194,7 @@ status_t MemoryHeapPmem::slap() int our_fd = getHeapID(); struct pmem_region sub = { 0, size }; int err = ioctl(our_fd, PMEM_MAP, &sub); - LOGE_IF(err<0, "PMEM_MAP failed (%s), " + ALOGE_IF(err<0, "PMEM_MAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); return -errno; @@ -212,7 +212,7 @@ status_t MemoryHeapPmem::unslap() int our_fd = getHeapID(); struct pmem_region sub = { 0, size }; int err = ioctl(our_fd, PMEM_UNMAP, &sub); - LOGE_IF(err<0, "PMEM_UNMAP failed (%s), " + ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), " "mFD=%d, sub.offset=%lu, sub.size=%lu", strerror(errno), our_fd, sub.offset, sub.len); return -errno; diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 728107362eb3e..3400e97aee692 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -139,7 +139,7 @@ void release_object(const sp& proc, } } - LOGE("Invalid object type 0x%08lx", obj.type); + ALOGE("Invalid object type 0x%08lx", obj.type); } inline static status_t finish_flatten_binder( @@ -159,7 +159,7 @@ status_t flatten_binder(const sp& proc, if (!local) { BpBinder *proxy = binder->remoteBinder(); if (proxy == NULL) { - LOGE("null proxy"); + ALOGE("null proxy"); } const int32_t handle = proxy ? proxy->handle() : 0; obj.type = BINDER_TYPE_HANDLE; @@ -192,7 +192,7 @@ status_t flatten_binder(const sp& proc, if (!local) { BpBinder *proxy = real->remoteBinder(); if (proxy == NULL) { - LOGE("null proxy"); + ALOGE("null proxy"); } const int32_t handle = proxy ? proxy->handle() : 0; obj.type = BINDER_TYPE_WEAK_HANDLE; @@ -213,7 +213,7 @@ status_t flatten_binder(const sp& proc, // The OpenBinder implementation uses a dynamic_cast<> here, // but we can't do that with the different reference counting // implementation we are using. - LOGE("Unable to unflatten Binder weak reference!"); + ALOGE("Unable to unflatten Binder weak reference!"); obj.type = BINDER_TYPE_BINDER; obj.binder = NULL; obj.cookie = NULL; @@ -1010,7 +1010,7 @@ String16 Parcel::readString16() const size_t len; const char16_t* str = readString16Inplace(&len); if (str) return String16(str, len); - LOGE("Reading a NULL string not supported here."); + ALOGE("Reading a NULL string not supported here."); return String16(); } @@ -1503,7 +1503,7 @@ status_t Parcel::continueWrite(size_t desired) if(!(mDataCapacity == 0 && mObjects == NULL && mObjectsCapacity == 0)) { - LOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired); + ALOGE("continueWrite: %d/%p/%d/%d", mDataCapacity, mObjects, mObjectsCapacity, desired); } mData = data; diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index b6d4f1abecb32..f96fe50e03f36 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -109,7 +109,7 @@ sp ProcessState::getContextObject(const String16& name, const sp& Camera::getCameraService() binder->linkToDeath(mDeathNotifier); mCameraService = interface_cast(binder); } - LOGE_IF(mCameraService==0, "no CameraService!?"); + ALOGE_IF(mCameraService==0, "no CameraService!?"); return mCameraService; } @@ -72,7 +72,7 @@ sp Camera::create(const sp& camera) { ALOGV("create"); if (camera == 0) { - LOGE("camera remote is a NULL pointer"); + ALOGE("camera remote is a NULL pointer"); return 0; } diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp index 209d84a98bbd2..059a8a5fa5e4f 100644 --- a/libs/camera/CameraParameters.cpp +++ b/libs/camera/CameraParameters.cpp @@ -231,12 +231,12 @@ void CameraParameters::set(const char *key, const char *value) { // XXX i think i can do this with strspn() if (strchr(key, '=') || strchr(key, ';')) { - //XXX LOGE("Key \"%s\"contains invalid character (= or ;)", key); + //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key); return; } if (strchr(value, '=') || strchr(key, ';')) { - //XXX LOGE("Value \"%s\"contains invalid character (= or ;)", value); + //XXX ALOGE("Value \"%s\"contains invalid character (= or ;)", value); return; } @@ -294,7 +294,7 @@ static int parse_pair(const char *str, int *first, int *second, char delim, int w = (int)strtol(str, &end, 10); // If a delimeter does not immediately follow, give up. if (*end != delim) { - LOGE("Cannot find delimeter (%c) in str=%s", delim, str); + ALOGE("Cannot find delimeter (%c) in str=%s", delim, str); return -1; } @@ -324,7 +324,7 @@ static void parseSizesList(const char *sizesStr, Vector &sizes) int success = parse_pair(sizeStartPtr, &width, &height, 'x', &sizeStartPtr); if (success == -1 || (*sizeStartPtr != ',' && *sizeStartPtr != '\0')) { - LOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr); + ALOGE("Picture sizes string \"%s\" contains invalid character.", sizesStr); return; } sizes.push(Size(width, height)); diff --git a/libs/cpustats/ThreadCpuUsage.cpp b/libs/cpustats/ThreadCpuUsage.cpp index c1fb365b803d7..ffee039e1ee1c 100644 --- a/libs/cpustats/ThreadCpuUsage.cpp +++ b/libs/cpustats/ThreadCpuUsage.cpp @@ -31,7 +31,7 @@ bool ThreadCpuUsage::setEnabled(bool isEnabled) if (isEnabled) { rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &mPreviousTs); if (rc) { - LOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); isEnabled = false; } else { mWasEverEnabled = true; @@ -39,7 +39,7 @@ bool ThreadCpuUsage::setEnabled(bool isEnabled) if (!mMonotonicKnown) { rc = clock_gettime(CLOCK_MONOTONIC, &mMonotonicTs); if (rc) { - LOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); } else { mMonotonicKnown = true; } @@ -50,7 +50,7 @@ bool ThreadCpuUsage::setEnabled(bool isEnabled) struct timespec ts; rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); if (rc) { - LOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); } else { long long delta = (ts.tv_sec - mPreviousTs.tv_sec) * 1000000000LL + (ts.tv_nsec - mPreviousTs.tv_nsec); @@ -86,7 +86,7 @@ void ThreadCpuUsage::sample() int rc; rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); if (rc) { - LOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_THREAD_CPUTIME_ID) errno=%d", errno); } else { long long delta = (ts.tv_sec - mPreviousTs.tv_sec) * 1000000000LL + (ts.tv_nsec - mPreviousTs.tv_nsec); @@ -111,7 +111,7 @@ long long ThreadCpuUsage::elapsed() const int rc; rc = clock_gettime(CLOCK_MONOTONIC, &ts); if (rc) { - LOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); elapsed = 0; } else { // mMonotonicTs is updated only at first enable and resetStatistics @@ -132,7 +132,7 @@ void ThreadCpuUsage::resetStatistics() int rc; rc = clock_gettime(CLOCK_MONOTONIC, &mMonotonicTs); if (rc) { - LOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); + ALOGE("clock_gettime(CLOCK_MONOTONIC) errno=%d", errno); mMonotonicKnown = false; } } diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index 86bc62aa28066..b1b9adbdfddf5 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -148,27 +148,27 @@ public: err = data.writeInterfaceToken( ISurfaceComposer::getInterfaceDescriptor()); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " "interface descriptor: %s (%d)", strerror(-err), -err); return false; } err = data.writeStrongBinder(surfaceTexture->asBinder()); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error writing " "strong binder to parcel: %s (%d)", strerror(-err), -err); return false; } err = remote()->transact(BnSurfaceComposer::AUTHENTICATE_SURFACE, data, &reply); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " "performing transaction: %s (%d)", strerror(-err), -err); return false; } int32_t result = 0; err = reply.readInt32(&result); if (err != NO_ERROR) { - LOGE("ISurfaceComposer::authenticateSurfaceTexture: error " + ALOGE("ISurfaceComposer::authenticateSurfaceTexture: error " "retrieving result: %s (%d)", strerror(-err), -err); return false; } diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp index f9355249ab92d..ac362fcce0624 100644 --- a/libs/gui/SensorEventQueue.cpp +++ b/libs/gui/SensorEventQueue.cpp @@ -70,12 +70,12 @@ ssize_t SensorEventQueue::write(ASensorEvent const* events, size_t numEvents) ssize_t SensorEventQueue::read(ASensorEvent* events, size_t numEvents) { ssize_t size = mSensorChannel->read(events, numEvents*sizeof(events[0])); - LOGE_IF(size<0 && size!=-EAGAIN, + ALOGE_IF(size<0 && size!=-EAGAIN, "SensorChannel::read error (%s)", strerror(-size)); if (size >= 0) { if (size % sizeof(events[0])) { // partial read!!! should never happen. - LOGE("SensorEventQueue partial read (event-size=%u, read=%d)", + ALOGE("SensorEventQueue partial read (event-size=%u, read=%d)", sizeof(events[0]), int(size)); return -EINVAL; } @@ -104,7 +104,7 @@ status_t SensorEventQueue::waitForEvent() const do { result = looper->pollOnce(-1); if (result == ALOOPER_EVENT_ERROR) { - LOGE("SensorChannel::waitForEvent error (errno=%d)", errno); + ALOGE("SensorChannel::waitForEvent error (errno=%d)", errno); result = -EPIPE; // unknown error, so we make up one break; } diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp index 3b39601bc9a28..b80da5681396a 100644 --- a/libs/gui/SensorManager.cpp +++ b/libs/gui/SensorManager.cpp @@ -137,7 +137,7 @@ sp SensorManager::createEventQueue() mSensorServer->createSensorEventConnection(); if (connection == NULL) { // SensorService just died. - LOGE("createEventQueue: connection is NULL. SensorService died."); + ALOGE("createEventQueue: connection is NULL. SensorService died."); continue; } queue = new SensorEventQueue(connection); diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index ff45fa34706ba..337950c3e6ee9 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -167,7 +167,7 @@ status_t SurfaceControl::setFreezeTint(uint32_t tint) { status_t SurfaceControl::validate() const { if (mToken<0 || mClient==0) { - LOGE("invalid token (%d, identity=%u) or client (%p)", + ALOGE("invalid token (%d, identity=%u) or client (%p)", mToken, mIdentity, mClient.get()); return NO_INIT; } @@ -254,7 +254,7 @@ status_t Surface::writeToParcel( } else if (surface != 0 && (surface->mSurface != NULL || surface->getISurfaceTexture() != NULL)) { - LOGE("Parceling invalid surface with non-NULL ISurface/ISurfaceTexture as NULL: " + ALOGE("Parceling invalid surface with non-NULL ISurface/ISurfaceTexture as NULL: " "mSurface = %p, surfaceTexture = %p, mIdentity = %d, ", surface->mSurface.get(), surface->getISurfaceTexture().get(), surface->mIdentity); @@ -304,7 +304,7 @@ void Surface::cleanCachedSurfacesLocked() { void Surface::init(const sp& surfaceTexture) { if (mSurface != NULL || surfaceTexture != NULL) { - LOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface"); + ALOGE_IF(surfaceTexture==0, "got a NULL ISurfaceTexture from ISurface"); if (surfaceTexture != NULL) { setISurfaceTexture(surfaceTexture); setUsage(GraphicBuffer::USAGE_HW_RENDER); diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 91294ed4f8e09..c80d93d7512c4 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -64,7 +64,7 @@ #define ST_LOGD(x, ...) ALOGD("[%s] "x, mName.string(), ##__VA_ARGS__) #define ST_LOGI(x, ...) ALOGI("[%s] "x, mName.string(), ##__VA_ARGS__) #define ST_LOGW(x, ...) ALOGW("[%s] "x, mName.string(), ##__VA_ARGS__) -#define ST_LOGE(x, ...) LOGE("[%s] "x, mName.string(), ##__VA_ARGS__) +#define ST_LOGE(x, ...) ALOGE("[%s] "x, mName.string(), ##__VA_ARGS__) namespace android { @@ -491,9 +491,9 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h, // synchronizing access to it. It's too late at this point to abort the // dequeue operation. if (result == EGL_FALSE) { - LOGE("dequeueBuffer: error waiting for fence: %#x", eglGetError()); + ALOGE("dequeueBuffer: error waiting for fence: %#x", eglGetError()); } else if (result == EGL_TIMEOUT_EXPIRED_KHR) { - LOGE("dequeueBuffer: timeout waiting for fence"); + ALOGE("dequeueBuffer: timeout waiting for fence"); } eglDestroySyncKHR(dpy, fence); } @@ -802,7 +802,7 @@ status_t SurfaceTexture::updateTexImage() { EGLSyncKHR fence = eglCreateSyncKHR(dpy, EGL_SYNC_FENCE_KHR, NULL); if (fence == EGL_NO_SYNC_KHR) { - LOGE("updateTexImage: error creating fence: %#x", + ALOGE("updateTexImage: error creating fence: %#x", eglGetError()); return -EINVAL; } diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index c51f45a78ffbd..5f01ae9c58c04 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -155,7 +155,7 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { if ((result & ISurfaceTexture::BUFFER_NEEDS_REALLOCATION) || gbuf == 0) { result = mSurfaceTexture->requestBuffer(buf, &gbuf); if (result != NO_ERROR) { - LOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed: %d", + ALOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed: %d", result); return result; } @@ -200,7 +200,7 @@ int SurfaceTextureClient::getSlotFromBufferLocked( return i; } } - LOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle); + ALOGE("getSlotFromBufferLocked: unknown buffer: %p", buffer->handle); return BAD_VALUE; } @@ -228,7 +228,7 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) { status_t err = mSurfaceTexture->queueBuffer(i, timestamp, &mDefaultWidth, &mDefaultHeight, &mTransformHint); if (err != OK) { - LOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err); + ALOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err); } return err; } @@ -450,7 +450,7 @@ int SurfaceTextureClient::setCrop(Rect const* rect) } status_t err = mSurfaceTexture->setCrop(*rect); - LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); + ALOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); return err; } @@ -461,7 +461,7 @@ int SurfaceTextureClient::setBufferCount(int bufferCount) Mutex::Autolock lock(mMutex); status_t err = mSurfaceTexture->setBufferCount(bufferCount); - LOGE_IF(err, "ISurfaceTexture::setBufferCount(%d) returned %s", + ALOGE_IF(err, "ISurfaceTexture::setBufferCount(%d) returned %s", bufferCount, strerror(-err)); if (err == NO_ERROR) { @@ -486,7 +486,7 @@ int SurfaceTextureClient::setBuffersDimensions(int w, int h) mReqHeight = h; status_t err = mSurfaceTexture->setCrop(Rect(0, 0)); - LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); + ALOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); return err; } @@ -510,7 +510,7 @@ int SurfaceTextureClient::setScalingMode(int mode) Mutex::Autolock lock(mMutex); // mode is validated on the server status_t err = mSurfaceTexture->setScalingMode(mode); - LOGE_IF(err, "ISurfaceTexture::setScalingMode(%d) returned %s", + ALOGE_IF(err, "ISurfaceTexture::setScalingMode(%d) returned %s", mode, strerror(-err)); return err; @@ -551,11 +551,11 @@ static status_t copyBlt( status_t err; uint8_t const * src_bits = NULL; err = src->lock(GRALLOC_USAGE_SW_READ_OFTEN, reg.bounds(), (void**)&src_bits); - LOGE_IF(err, "error locking src buffer %s", strerror(-err)); + ALOGE_IF(err, "error locking src buffer %s", strerror(-err)); uint8_t* dst_bits = NULL; err = dst->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, reg.bounds(), (void**)&dst_bits); - LOGE_IF(err, "error locking dst buffer %s", strerror(-err)); + ALOGE_IF(err, "error locking dst buffer %s", strerror(-err)); Region::const_iterator head(reg.begin()); Region::const_iterator tail(reg.end()); @@ -598,7 +598,7 @@ status_t SurfaceTextureClient::lock( ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds) { if (mLockedBuffer != 0) { - LOGE("Surface::lock failed, already locked"); + ALOGE("Surface::lock failed, already locked"); return INVALID_OPERATION; } @@ -613,11 +613,11 @@ status_t SurfaceTextureClient::lock( ANativeWindowBuffer* out; status_t err = dequeueBuffer(&out); - LOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err)); + ALOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err)); if (err == NO_ERROR) { sp backBuffer(GraphicBuffer::getSelf(out)); err = lockBuffer(backBuffer.get()); - LOGE_IF(err, "lockBuffer (handle=%p) failed (%s)", + ALOGE_IF(err, "lockBuffer (handle=%p) failed (%s)", backBuffer->handle, strerror(-err)); if (err == NO_ERROR) { const Rect bounds(backBuffer->width, backBuffer->height); @@ -678,15 +678,15 @@ status_t SurfaceTextureClient::lock( status_t SurfaceTextureClient::unlockAndPost() { if (mLockedBuffer == 0) { - LOGE("Surface::unlockAndPost failed, no locked buffer"); + ALOGE("Surface::unlockAndPost failed, no locked buffer"); return INVALID_OPERATION; } status_t err = mLockedBuffer->unlock(); - LOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle); + ALOGE_IF(err, "failed unlocking buffer (%p)", mLockedBuffer->handle); err = queueBuffer(mLockedBuffer.get()); - LOGE_IF(err, "queueBuffer (handle=%p) failed (%s)", + ALOGE_IF(err, "queueBuffer (handle=%p) failed (%s)", mLockedBuffer->handle, strerror(-err)); mPostedBuffer = mLockedBuffer; diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 158f785036891..42e672b5da15c 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -126,7 +126,7 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) { for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) { if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) { - LOGE("Skipping invalid index"); + ALOGE("Skipping invalid index"); continue; } uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX]; @@ -168,7 +168,7 @@ void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len void Font::measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len, int numGlyphs, Rect *bounds) { if (bounds == NULL) { - LOGE("No return rectangle provided to measure text"); + ALOGE("No return rectangle provided to measure text"); return; } bounds->set(1e6, -1e6, -1e6, 1e6); @@ -401,7 +401,7 @@ bool FontRenderer::cacheBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint3 initTextTexture(true); } if (glyph.fHeight + 2 > mCacheLines[mCacheLines.size() - 1]->mMaxHeight) { - LOGE("Font size to large to fit in cache. width, height = %i, %i", + ALOGE("Font size to large to fit in cache. width, height = %i, %i", (int) glyph.fWidth, (int) glyph.fHeight); return false; } @@ -433,7 +433,7 @@ bool FontRenderer::cacheBitmap(const SkGlyph& glyph, uint32_t* retOriginX, uint3 // if we still don't fit, something is wrong and we shouldn't draw if (!bitmapFit) { - LOGE("Bitmap doesn't fit in cache. width, height = %i, %i", + ALOGE("Bitmap doesn't fit in cache. width, height = %i, %i", (int) glyph.fWidth, (int) glyph.fHeight); return false; } @@ -758,12 +758,12 @@ bool FontRenderer::renderText(SkPaint* paint, const Rect* clip, const char *text checkInit(); if (!mCurrentFont) { - LOGE("No font set"); + ALOGE("No font set"); return false; } if (mPositionAttrSlot < 0 || mTexcoordAttrSlot < 0) { - LOGE("Font renderer unable to draw, attribute slots undefined"); + ALOGE("Font renderer unable to draw, attribute slots undefined"); return false; } diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp index aacf22a19e7eb..27c267741bf5e 100644 --- a/libs/hwui/GradientCache.cpp +++ b/libs/hwui/GradientCache.cpp @@ -154,7 +154,7 @@ Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient, void GradientCache::generateTexture(SkBitmap* bitmap, Texture* texture) { SkAutoLockPixels autoLock(*bitmap); if (!bitmap->readyToDraw()) { - LOGE("Cannot generate texture from shader"); + ALOGE("Cannot generate texture from shader"); return; } diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index fb8664e20619c..5089c5cc974a9 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -176,7 +176,7 @@ void OpenGLRenderer::finish() { ALOGD("GL error from OpenGLRenderer: 0x%x", status); switch (status) { case GL_OUT_OF_MEMORY: - LOGE(" OpenGLRenderer is out of memory!"); + ALOGE(" OpenGLRenderer is out of memory!"); break; } } @@ -539,7 +539,7 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, sp sna #if DEBUG_LAYERS_AS_REGIONS GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { - LOGE("Framebuffer incomplete (GL error code 0x%x)", status); + ALOGE("Framebuffer incomplete (GL error code 0x%x)", status); glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); layer->deleteTexture(); @@ -571,7 +571,7 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, sp sna */ void OpenGLRenderer::composeLayer(sp current, sp previous) { if (!current->layer) { - LOGE("Attempting to compose a layer that does not exist"); + ALOGE("Attempting to compose a layer that does not exist"); return; } diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 972dd87a5d719..043a0921e36a9 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -42,13 +42,13 @@ Program::Program(const char* vertex, const char* fragment) { GLint status; glGetProgramiv(id, GL_LINK_STATUS, &status); if (status != GL_TRUE) { - LOGE("Error while linking shaders:"); + ALOGE("Error while linking shaders:"); GLint infoLen = 0; glGetProgramiv(id, GL_INFO_LOG_LENGTH, &infoLen); if (infoLen > 1) { GLchar log[infoLen]; glGetProgramInfoLog(id, infoLen, 0, &log[0]); - LOGE("%s", log); + ALOGE("%s", log); } glDeleteShader(vertexShader); glDeleteShader(fragmentShader); @@ -115,7 +115,7 @@ GLuint Program::buildShader(const char* source, GLenum type) { // use a fixed size instead GLchar log[512]; glGetShaderInfoLog(shader, sizeof(log), 0, &log[0]); - LOGE("Error while compiling shader: %s", log); + ALOGE("Error while compiling shader: %s", log); glDeleteShader(shader); return 0; } diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h index b019af39e45c2..c07a6c9ebf684 100644 --- a/libs/hwui/ShapeCache.h +++ b/libs/hwui/ShapeCache.h @@ -570,7 +570,7 @@ template void ShapeCache::generateTexture(SkBitmap& bitmap, Texture* texture) { SkAutoLockPixels alp(bitmap); if (!bitmap.readyToDraw()) { - LOGE("Cannot generate texture from bitmap"); + ALOGE("Cannot generate texture from bitmap"); return; } diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 5b8854b4fd759..7a88f2a1bef71 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -201,7 +201,7 @@ void TextureCache::generateTexture(SkBitmap* bitmap, Texture* texture, bool rege SkAutoLockPixels alp(*bitmap); if (!bitmap->readyToDraw()) { - LOGE("Cannot generate texture from bitmap"); + ALOGE("Cannot generate texture from bitmap"); return; } diff --git a/libs/rs/driver/rsdAllocation.cpp b/libs/rs/driver/rsdAllocation.cpp index e79cd0f3cc3a6..1f70e660f720c 100644 --- a/libs/rs/driver/rsdAllocation.cpp +++ b/libs/rs/driver/rsdAllocation.cpp @@ -172,7 +172,7 @@ static void AllocateRenderTarget(const Context *rsc, const Allocation *alloc) { if (!drv->renderTargetID) { // This should generally not happen - LOGE("allocateRenderTarget failed to gen mRenderTargetID"); + ALOGE("allocateRenderTarget failed to gen mRenderTargetID"); rsc->dumpDebug(); return; } @@ -195,7 +195,7 @@ static void UploadToBufferObject(const Context *rsc, const Allocation *alloc) { RSD_CALL_GL(glGenBuffers, 1, &drv->bufferID); } if (!drv->bufferID) { - LOGE("Upload to buffer object failed"); + ALOGE("Upload to buffer object failed"); drv->uploadDeferred = true; return; } @@ -460,7 +460,7 @@ void rsdAllocationData2D_alloc_script(const android::renderscript::Context *rsc, uint8_t *srcPtr = getOffsetPtr(srcAlloc, srcXoff, srcYoff + i, srcLod, srcFace); memcpy(dstPtr, srcPtr, w * elementSize); - //LOGE("COPIED dstXoff(%u), dstYoff(%u), dstLod(%u), dstFace(%u), w(%u), h(%u), srcXoff(%u), srcYoff(%u), srcLod(%u), srcFace(%u)", + //ALOGE("COPIED dstXoff(%u), dstYoff(%u), dstLod(%u), dstFace(%u), w(%u), h(%u), srcXoff(%u), srcYoff(%u), srcLod(%u), srcFace(%u)", // dstXoff, dstYoff, dstLod, dstFace, w, h, srcXoff, srcYoff, srcLod, srcFace); } } diff --git a/libs/rs/driver/rsdBcc.cpp b/libs/rs/driver/rsdBcc.cpp index c16091c58b3f4..a36bae9d0d8e6 100644 --- a/libs/rs/driver/rsdBcc.cpp +++ b/libs/rs/driver/rsdBcc.cpp @@ -69,7 +69,7 @@ bool rsdScriptInit(const Context *rsc, uint8_t const *bitcode, size_t bitcodeSize, uint32_t flags) { - //LOGE("rsdScriptCreate %p %p %p %p %i %i %p", rsc, resName, cacheDir, bitcode, bitcodeSize, flags, lookupFunc); + //ALOGE("rsdScriptCreate %p %p %p %p %i %i %p", rsc, resName, cacheDir, bitcode, bitcodeSize, flags, lookupFunc); pthread_mutex_lock(&rsdgInitMutex); char *cachePath = NULL; @@ -93,14 +93,14 @@ bool rsdScriptInit(const Context *rsc, drv->ME = new bcinfo::MetadataExtractor((const char*)drv->mScriptText, drv->mScriptTextLength); if (!drv->ME->extract()) { - LOGE("bcinfo: failed to read script metadata"); + ALOGE("bcinfo: failed to read script metadata"); goto error; } - //LOGE("mBccScript %p", script->mBccScript); + //ALOGE("mBccScript %p", script->mBccScript); if (bccRegisterSymbolCallback(drv->mBccScript, &rsdLookupRuntimeStub, script) != 0) { - LOGE("bcc: FAILS to register symbol callback"); + ALOGE("bcc: FAILS to register symbol callback"); goto error; } @@ -108,17 +108,17 @@ bool rsdScriptInit(const Context *rsc, resName, (char const *)drv->mScriptText, drv->mScriptTextLength, 0) != 0) { - LOGE("bcc: FAILS to read bitcode"); + ALOGE("bcc: FAILS to read bitcode"); goto error; } if (bccLinkFile(drv->mBccScript, "/system/lib/libclcore.bc", 0) != 0) { - LOGE("bcc: FAILS to link bitcode"); + ALOGE("bcc: FAILS to link bitcode"); goto error; } if (bccPrepareExecutable(drv->mBccScript, cacheDir, resName, 0) != 0) { - LOGE("bcc: FAILS to prepare executable"); + ALOGE("bcc: FAILS to prepare executable"); goto error; } @@ -236,8 +236,8 @@ static void wc_xy(void *usr, uint32_t idx) { return; } - //LOGE("usr idx %i, x %i,%i y %i,%i", idx, mtls->xStart, mtls->xEnd, yStart, yEnd); - //LOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); + //ALOGE("usr idx %i, x %i,%i y %i,%i", idx, mtls->xStart, mtls->xEnd, yStart, yEnd); + //ALOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); for (p.y = yStart; p.y < yEnd; p.y++) { uint32_t offset = mtls->dimX * p.y; p.out = mtls->ptrOut + (mtls->eStrideOut * offset); @@ -267,8 +267,8 @@ static void wc_x(void *usr, uint32_t idx) { return; } - //LOGE("usr slice %i idx %i, x %i,%i", slice, idx, xStart, xEnd); - //LOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); + //ALOGE("usr slice %i idx %i, x %i,%i", slice, idx, xStart, xEnd); + //ALOGE("usr ptr in %p, out %p", mtls->ptrIn, mtls->ptrOut); p.out = mtls->ptrOut + (mtls->eStrideOut * xStart); p.in = mtls->ptrIn + (mtls->eStrideIn * xStart); @@ -374,7 +374,7 @@ void rsdScriptInvokeForEach(const Context *rsc, rsdLaunchThreads(mrsc, wc_x, &mtls); } - //LOGE("launch 1"); + //ALOGE("launch 1"); } else { RsForEachStubParamStruct p; memset(&p, 0, sizeof(p)); @@ -382,7 +382,7 @@ void rsdScriptInvokeForEach(const Context *rsc, p.usr_len = mtls.usrLen; uint32_t sig = mtls.sig; - //LOGE("launch 3"); + //ALOGE("launch 3"); outer_foreach_t fn = dc->mForEachLaunch[sig]; for (p.ar[0] = mtls.arrayStart; p.ar[0] < mtls.arrayEnd; p.ar[0]++) { for (p.z = mtls.zStart; p.z < mtls.zEnd; p.z++) { @@ -434,7 +434,7 @@ void rsdScriptInvokeFunction(const Context *dc, Script *script, const void *params, size_t paramLength) { DrvScript *drv = (DrvScript *)script->mHal.drv; - //LOGE("invoke %p %p %i %p %i", dc, script, slot, params, paramLength); + //ALOGE("invoke %p %p %i %p %i", dc, script, slot, params, paramLength); Script * oldTLS = setTLS(script); ((void (*)(const void *, uint32_t)) @@ -446,7 +446,7 @@ void rsdScriptSetGlobalVar(const Context *dc, const Script *script, uint32_t slot, void *data, size_t dataLength) { DrvScript *drv = (DrvScript *)script->mHal.drv; //rsAssert(!script->mFieldIsObject[slot]); - //LOGE("setGlobalVar %p %p %i %p %i", dc, script, slot, data, dataLength); + //ALOGE("setGlobalVar %p %p %i %p %i", dc, script, slot, data, dataLength); int32_t *destPtr = ((int32_t **)drv->mFieldAddress)[slot]; if (!destPtr) { @@ -460,7 +460,7 @@ void rsdScriptSetGlobalVar(const Context *dc, const Script *script, void rsdScriptSetGlobalBind(const Context *dc, const Script *script, uint32_t slot, void *data) { DrvScript *drv = (DrvScript *)script->mHal.drv; //rsAssert(!script->mFieldIsObject[slot]); - //LOGE("setGlobalBind %p %p %i %p", dc, script, slot, data); + //ALOGE("setGlobalBind %p %p %i %p", dc, script, slot, data); int32_t *destPtr = ((int32_t **)drv->mFieldAddress)[slot]; if (!destPtr) { @@ -474,7 +474,7 @@ void rsdScriptSetGlobalBind(const Context *dc, const Script *script, uint32_t sl void rsdScriptSetGlobalObj(const Context *dc, const Script *script, uint32_t slot, ObjectBase *data) { DrvScript *drv = (DrvScript *)script->mHal.drv; //rsAssert(script->mFieldIsObject[slot]); - //LOGE("setGlobalObj %p %p %i %p", dc, script, slot, data); + //ALOGE("setGlobalObj %p %p %i %p", dc, script, slot, data); int32_t *destPtr = ((int32_t **)drv->mFieldAddress)[slot]; if (!destPtr) { diff --git a/libs/rs/driver/rsdCore.cpp b/libs/rs/driver/rsdCore.cpp index 9292fa15a05ac..b514e21828831 100644 --- a/libs/rs/driver/rsdCore.cpp +++ b/libs/rs/driver/rsdCore.cpp @@ -146,7 +146,7 @@ static void * HelperThreadProc(void *vrsc) { int status = pthread_setspecific(rsdgThreadTLSKey, &dc->mTlsStruct); if (status) { - LOGE("pthread_setspecific %i", status); + ALOGE("pthread_setspecific %i", status); } #if 0 @@ -156,7 +156,7 @@ static void * HelperThreadProc(void *vrsc) { cpuset.bits[idx / 64] |= 1ULL << (idx % 64); int ret = syscall(241, rsc->mWorkers.mNativeThreadId[idx], sizeof(cpuset), &cpuset); - LOGE("SETAFFINITY ret = %i %s", ret, EGLUtils::strerror(ret)); + ALOGE("SETAFFINITY ret = %i %s", ret, EGLUtils::strerror(ret)); #endif while (!dc->mExit) { @@ -191,7 +191,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { RsdHal *dc = (RsdHal *)calloc(1, sizeof(RsdHal)); if (!dc) { - LOGE("Calloc for driver hal failed."); + ALOGE("Calloc for driver hal failed."); return false; } rsc->mHal.drv = dc; @@ -200,7 +200,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { if (!rsdgThreadTLSKeyCount) { int status = pthread_key_create(&rsdgThreadTLSKey, NULL); if (status) { - LOGE("Failed to init thread tls key."); + ALOGE("Failed to init thread tls key."); pthread_mutex_unlock(&rsdgInitMutex); return false; } @@ -214,7 +214,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { dc->mTlsStruct.mScript = NULL; int status = pthread_setspecific(rsdgThreadTLSKey, &dc->mTlsStruct); if (status) { - LOGE("pthread_setspecific %i", status); + ALOGE("pthread_setspecific %i", status); } @@ -236,7 +236,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { pthread_attr_t threadAttr; status = pthread_attr_init(&threadAttr); if (status) { - LOGE("Failed to init thread attribute."); + ALOGE("Failed to init thread attribute."); return false; } @@ -244,7 +244,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { status = pthread_create(&dc->mWorkers.mThreadId[ct], &threadAttr, HelperThreadProc, rsc); if (status) { dc->mWorkers.mCount = ct; - LOGE("Created fewer than expected number of RS threads."); + ALOGE("Created fewer than expected number of RS threads."); break; } } diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index d4deefb1e4752..b53a68cf9efd2 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -107,14 +107,14 @@ static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) { } static void DumpDebug(RsdHal *dc) { - LOGE(" EGL ver %i %i", dc->gl.egl.majorVersion, dc->gl.egl.minorVersion); - LOGE(" EGL context %p surface %p, Display=%p", dc->gl.egl.context, dc->gl.egl.surface, + ALOGE(" EGL ver %i %i", dc->gl.egl.majorVersion, dc->gl.egl.minorVersion); + ALOGE(" EGL context %p surface %p, Display=%p", dc->gl.egl.context, dc->gl.egl.surface, dc->gl.egl.display); - LOGE(" GL vendor: %s", dc->gl.gl.vendor); - LOGE(" GL renderer: %s", dc->gl.gl.renderer); - LOGE(" GL Version: %s", dc->gl.gl.version); - LOGE(" GL Extensions: %s", dc->gl.gl.extensions); - LOGE(" GL int Versions %i %i", dc->gl.gl.majorVersion, dc->gl.gl.minorVersion); + ALOGE(" GL vendor: %s", dc->gl.gl.vendor); + ALOGE(" GL renderer: %s", dc->gl.gl.renderer); + ALOGE(" GL Version: %s", dc->gl.gl.version); + ALOGE(" GL Extensions: %s", dc->gl.gl.extensions); + ALOGE(" GL int Versions %i %i", dc->gl.gl.majorVersion, dc->gl.gl.minorVersion); ALOGV("MAX Textures %i, %i %i", dc->gl.gl.maxVertexTextureUnits, dc->gl.gl.maxFragmentTextureImageUnits, dc->gl.gl.maxTextureImageUnits); @@ -223,7 +223,7 @@ bool rsdGLInit(const Context *rsc) { configAttribs, configs, numConfigs, &n); if (!ret || !n) { checkEglError("eglChooseConfig", ret); - LOGE("%p, couldn't find an EGLConfig matching the screen format\n", rsc); + ALOGE("%p, couldn't find an EGLConfig matching the screen format\n", rsc); } // The first config is guaranteed to over-satisfy the constraints @@ -268,7 +268,7 @@ bool rsdGLInit(const Context *rsc) { EGL_NO_CONTEXT, context_attribs2); checkEglError("eglCreateContext"); if (dc->gl.egl.context == EGL_NO_CONTEXT) { - LOGE("%p, eglCreateContext returned EGL_NO_CONTEXT", rsc); + ALOGE("%p, eglCreateContext returned EGL_NO_CONTEXT", rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; } @@ -281,7 +281,7 @@ bool rsdGLInit(const Context *rsc) { pbuffer_attribs); checkEglError("eglCreatePbufferSurface"); if (dc->gl.egl.surfaceDefault == EGL_NO_SURFACE) { - LOGE("eglCreatePbufferSurface returned EGL_NO_SURFACE"); + ALOGE("eglCreatePbufferSurface returned EGL_NO_SURFACE"); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; @@ -291,7 +291,7 @@ bool rsdGLInit(const Context *rsc) { ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surfaceDefault, dc->gl.egl.surfaceDefault, dc->gl.egl.context); if (ret == EGL_FALSE) { - LOGE("eglMakeCurrent returned EGL_FALSE"); + ALOGE("eglMakeCurrent returned EGL_FALSE"); checkEglError("eglMakeCurrent", ret); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); @@ -320,7 +320,7 @@ bool rsdGLInit(const Context *rsc) { } if (!verptr) { - LOGE("Error, OpenGL ES Lite not supported"); + ALOGE("Error, OpenGL ES Lite not supported"); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; @@ -402,7 +402,7 @@ bool rsdGLSetSurface(const Context *rsc, uint32_t w, uint32_t h, RsNativeWindow dc->gl.wndSurface, NULL); checkEglError("eglCreateWindowSurface"); if (dc->gl.egl.surface == EGL_NO_SURFACE) { - LOGE("eglCreateWindowSurface returned EGL_NO_SURFACE"); + ALOGE("eglCreateWindowSurface returned EGL_NO_SURFACE"); } rsc->setWatchdogGL("eglMakeCurrent", __LINE__, __FILE__); @@ -439,7 +439,7 @@ void rsdGLCheckError(const android::renderscript::Context *rsc, } } - LOGE("%p, %s", rsc, buf); + ALOGE("%p, %s", rsc, buf); } } diff --git a/libs/rs/driver/rsdMeshObj.cpp b/libs/rs/driver/rsdMeshObj.cpp index 24a718331776a..99d79dceda794 100644 --- a/libs/rs/driver/rsdMeshObj.cpp +++ b/libs/rs/driver/rsdMeshObj.cpp @@ -133,7 +133,7 @@ bool RsdMeshObj::init() { void RsdMeshObj::renderPrimitiveRange(const Context *rsc, uint32_t primIndex, uint32_t start, uint32_t len) const { if (len < 1 || primIndex >= mRSMesh->mHal.state.primitivesCount || mAttribCount == 0) { - LOGE("Invalid mesh or parameters"); + ALOGE("Invalid mesh or parameters"); return; } diff --git a/libs/rs/driver/rsdProgramStore.cpp b/libs/rs/driver/rsdProgramStore.cpp index af44b026dd120..fca9ba9e11e8f 100644 --- a/libs/rs/driver/rsdProgramStore.cpp +++ b/libs/rs/driver/rsdProgramStore.cpp @@ -70,7 +70,7 @@ bool rsdProgramStoreInit(const Context *rsc, const ProgramStore *ps) { drv->depthFunc = GL_NOTEQUAL; break; default: - LOGE("Unknown depth function."); + ALOGE("Unknown depth function."); goto error; } @@ -111,7 +111,7 @@ bool rsdProgramStoreInit(const Context *rsc, const ProgramStore *ps) { drv->blendSrc = GL_SRC_ALPHA_SATURATE; break; default: - LOGE("Unknown blend src mode."); + ALOGE("Unknown blend src mode."); goto error; } @@ -141,7 +141,7 @@ bool rsdProgramStoreInit(const Context *rsc, const ProgramStore *ps) { drv->blendDst = GL_ONE_MINUS_DST_ALPHA; break; default: - LOGE("Unknown blend dst mode."); + ALOGE("Unknown blend dst mode."); goto error; } diff --git a/libs/rs/driver/rsdRuntimeMath.cpp b/libs/rs/driver/rsdRuntimeMath.cpp index d29da7e8f9257..4c300b7b00b80 100644 --- a/libs/rs/driver/rsdRuntimeMath.cpp +++ b/libs/rs/driver/rsdRuntimeMath.cpp @@ -120,7 +120,7 @@ static float SC_min_f32(float v, float v2) { } static float SC_mix_f32(float start, float stop, float amount) { - //LOGE("lerpf %f %f %f", start, stop, amount); + //ALOGE("lerpf %f %f %f", start, stop, amount); return start + (stop - start) * amount; } diff --git a/libs/rs/driver/rsdRuntimeStubs.cpp b/libs/rs/driver/rsdRuntimeStubs.cpp index b457d8be276bc..14c297004f44a 100644 --- a/libs/rs/driver/rsdRuntimeStubs.cpp +++ b/libs/rs/driver/rsdRuntimeStubs.cpp @@ -686,7 +686,7 @@ void* rsdLookupRuntimeStub(void* pContext, char const* name) { s->mHal.info.isThreadable &= sym->threadable; return sym->mPtr; } - LOGE("ScriptC sym lookup failed for %s", name); + ALOGE("ScriptC sym lookup failed for %s", name); return NULL; } diff --git a/libs/rs/driver/rsdShader.cpp b/libs/rs/driver/rsdShader.cpp index e9ce7c208cd0e..a10deb41a7342 100644 --- a/libs/rs/driver/rsdShader.cpp +++ b/libs/rs/driver/rsdShader.cpp @@ -190,7 +190,7 @@ bool RsdShader::loadShader(const Context *rsc) { char* buf = (char*) malloc(infoLen); if (buf) { RSD_CALL_GL(glGetShaderInfoLog, mShaderID, infoLen, NULL, buf); - LOGE("Could not compile shader \n%s\n", buf); + ALOGE("Could not compile shader \n%s\n", buf); free(buf); } RSD_CALL_GL(glDeleteShader, mShaderID); @@ -287,9 +287,9 @@ void RsdShader::logUniform(const Element *field, const float *fd, uint32_t array rsAssert(0); } } - LOGE("Element size %u data=%p", elementSize, fd); + ALOGE("Element size %u data=%p", elementSize, fd); fd += elementSize; - LOGE("New data=%p", fd); + ALOGE("New data=%p", fd); } } @@ -404,7 +404,7 @@ void RsdShader::setupTextures(const Context *rsc, RsdShaderCache *sc) { uint32_t numTexturesToBind = mRSProgram->mHal.state.texturesCount; uint32_t numTexturesAvailable = dc->gl.gl.maxFragmentTextureImageUnits; if (numTexturesToBind >= numTexturesAvailable) { - LOGE("Attempting to bind %u textures on shader id %u, but only %u are available", + ALOGE("Attempting to bind %u textures on shader id %u, but only %u are available", mRSProgram->mHal.state.texturesCount, (uint32_t)this, numTexturesAvailable); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind more textuers than available"); numTexturesToBind = numTexturesAvailable; @@ -422,7 +422,7 @@ void RsdShader::setupTextures(const Context *rsc, RsdShaderCache *sc) { DrvAllocation *drvTex = (DrvAllocation *)mRSProgram->mHal.state.textures[ct]->mHal.drv; if (drvTex->glTarget != GL_TEXTURE_2D && drvTex->glTarget != GL_TEXTURE_CUBE_MAP) { - LOGE("Attempting to bind unknown texture to shader id %u, texture unit %u", (uint)this, ct); + ALOGE("Attempting to bind unknown texture to shader id %u, texture unit %u", (uint)this, ct); rsc->setError(RS_ERROR_BAD_SHADER, "Non-texture allocation bound to a shader"); } RSD_CALL_GL(glBindTexture, drvTex->glTarget, drvTex->textureID); @@ -450,7 +450,7 @@ void RsdShader::setupUserConstants(const Context *rsc, RsdShaderCache *sc, bool for (uint32_t ct=0; ct < mRSProgram->mHal.state.constantsCount; ct++) { Allocation *alloc = mRSProgram->mHal.state.constants[ct]; if (!alloc) { - LOGE("Attempting to set constants on shader id %u, but alloc at slot %u is not set", + ALOGE("Attempting to set constants on shader id %u, but alloc at slot %u is not set", (uint32_t)this, ct); rsc->setError(RS_ERROR_BAD_SHADER, "No constant allocation bound"); continue; diff --git a/libs/rs/driver/rsdShaderCache.cpp b/libs/rs/driver/rsdShaderCache.cpp index 2871a12231a59..f6236e794a072 100644 --- a/libs/rs/driver/rsdShaderCache.cpp +++ b/libs/rs/driver/rsdShaderCache.cpp @@ -135,7 +135,7 @@ bool RsdShaderCache::link(const Context *rsc) { } //ALOGV("RsdShaderCache miss"); - //LOGE("e0 %x", glGetError()); + //ALOGE("e0 %x", glGetError()); ProgramEntry *e = new ProgramEntry(vtx->getAttribCount(), vtx->getUniformCount(), frag->getUniformCount()); @@ -147,7 +147,7 @@ bool RsdShaderCache::link(const Context *rsc) { if (e->program) { GLuint pgm = e->program; glAttachShader(pgm, vtx->getShaderID()); - //LOGE("e1 %x", glGetError()); + //ALOGE("e1 %x", glGetError()); glAttachShader(pgm, frag->getShaderID()); glBindAttribLocation(pgm, 0, "ATTRIB_position"); @@ -155,9 +155,9 @@ bool RsdShaderCache::link(const Context *rsc) { glBindAttribLocation(pgm, 2, "ATTRIB_normal"); glBindAttribLocation(pgm, 3, "ATTRIB_texture0"); - //LOGE("e2 %x", glGetError()); + //ALOGE("e2 %x", glGetError()); glLinkProgram(pgm); - //LOGE("e3 %x", glGetError()); + //ALOGE("e3 %x", glGetError()); GLint linkStatus = GL_FALSE; glGetProgramiv(pgm, GL_LINK_STATUS, &linkStatus); if (linkStatus != GL_TRUE) { @@ -167,7 +167,7 @@ bool RsdShaderCache::link(const Context *rsc) { char* buf = (char*) malloc(bufLength); if (buf) { glGetProgramInfoLog(pgm, bufLength, NULL, buf); - LOGE("Could not link program:\n%s\n", buf); + ALOGE("Could not link program:\n%s\n", buf); free(buf); } } @@ -205,7 +205,7 @@ bool RsdShaderCache::link(const Context *rsc) { glGetActiveUniform(pgm, ct, maxNameLength, &uniformList[ct]->writtenLength, &uniformList[ct]->arraySize, &uniformList[ct]->type, uniformList[ct]->name); - //LOGE("GL UNI idx=%u, arraySize=%u, name=%s", ct, + //ALOGE("GL UNI idx=%u, arraySize=%u, name=%s", ct, // uniformList[ct]->arraySize, uniformList[ct]->name); } } diff --git a/libs/rs/rsAdapter.cpp b/libs/rs/rsAdapter.cpp index 6e8ca705110ea..177fb6028009e 100644 --- a/libs/rs/rsAdapter.cpp +++ b/libs/rs/rsAdapter.cpp @@ -140,7 +140,7 @@ void * Adapter2D::getElement(uint32_t x, uint32_t y) const { rsAssert(mAllocation->getPtr()); rsAssert(mAllocation->getType()); if (mFace != 0 && !mAllocation->getType()->getDimFaces()) { - LOGE("Adapter wants cubemap face, but allocation has none"); + ALOGE("Adapter wants cubemap face, but allocation has none"); return NULL; } diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index 35d812d40f25f..7b92b39a99818 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -75,7 +75,7 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t lod, const uint32_t eSize = mHal.state.type->getElementSizeBytes(); if ((count * eSize) != sizeBytes) { - LOGE("Allocation::subData called with mismatched size expected %i, got %i", + ALOGE("Allocation::subData called with mismatched size expected %i, got %i", (count * eSize), sizeBytes); mHal.state.type->dumpLOGV("type info"); return; @@ -90,10 +90,10 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod, const uint32_t eSize = mHal.state.elementSizeBytes; const uint32_t lineSize = eSize * w; - //LOGE("data2d %p, %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes); + //ALOGE("data2d %p, %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes); if ((lineSize * h) != sizeBytes) { - LOGE("Allocation size mismatch, expected %i, got %i", (lineSize * h), sizeBytes); + ALOGE("Allocation size mismatch, expected %i, got %i", (lineSize * h), sizeBytes); rsAssert(!"Allocation::subData called with mismatched size"); return; } @@ -112,20 +112,20 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data, uint32_t eSize = mHal.state.elementSizeBytes; if (cIdx >= mHal.state.type->getElement()->getFieldCount()) { - LOGE("Error Allocation::subElementData component %i out of range.", cIdx); + ALOGE("Error Allocation::subElementData component %i out of range.", cIdx); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); return; } if (x >= mHal.state.dimensionX) { - LOGE("Error Allocation::subElementData X offset %i out of range.", x); + ALOGE("Error Allocation::subElementData X offset %i out of range.", x); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); return; } const Element * e = mHal.state.type->getElement()->getField(cIdx); if (sizeBytes != e->getSizeBytes()) { - LOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); + ALOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; } @@ -139,19 +139,19 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, uint32_t eSize = mHal.state.elementSizeBytes; if (x >= mHal.state.dimensionX) { - LOGE("Error Allocation::subElementData X offset %i out of range.", x); + ALOGE("Error Allocation::subElementData X offset %i out of range.", x); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); return; } if (y >= mHal.state.dimensionY) { - LOGE("Error Allocation::subElementData X offset %i out of range.", x); + ALOGE("Error Allocation::subElementData X offset %i out of range.", x); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData X offset out of range."); return; } if (cIdx >= mHal.state.type->getElement()->getFieldCount()) { - LOGE("Error Allocation::subElementData component %i out of range.", cIdx); + ALOGE("Error Allocation::subElementData component %i out of range.", cIdx); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData component out of range."); return; } @@ -159,7 +159,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, const Element * e = mHal.state.type->getElement()->getField(cIdx); if (sizeBytes != e->getSizeBytes()) { - LOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); + ALOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; } @@ -217,7 +217,7 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_ALLOCATION) { - LOGE("allocation loading skipped due to invalid class id\n"); + ALOGE("allocation loading skipped due to invalid class id\n"); return NULL; } @@ -233,7 +233,7 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { // Number of bytes we wrote out for this allocation uint32_t dataSize = stream->loadU32(); if (dataSize != type->getSizeBytes()) { - LOGE("failed to read allocation because numbytes written is not the same loaded type wants\n"); + ALOGE("failed to read allocation because numbytes written is not the same loaded type wants\n"); ObjectBase::checkDelete(type); return NULL; } @@ -319,7 +319,7 @@ void Allocation::resize1D(Context *rsc, uint32_t dimX) { } void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) { - LOGE("not implemented"); + ALOGE("not implemented"); } ///////////////// @@ -497,7 +497,7 @@ RsAllocation rsi_AllocationCreateFromBitmap(Context *rsc, RsType vtype, RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mips, usages); Allocation *texAlloc = static_cast(vTexAlloc); if (texAlloc == NULL) { - LOGE("Memory allocation failure"); + ALOGE("Memory allocation failure"); return NULL; } @@ -521,7 +521,7 @@ RsAllocation rsi_AllocationCubeCreateFromBitmap(Context *rsc, RsType vtype, RsAllocation vTexAlloc = rsi_AllocationCreateTyped(rsc, vtype, mips, usages); Allocation *texAlloc = static_cast(vTexAlloc); if (texAlloc == NULL) { - LOGE("Memory allocation failure"); + ALOGE("Memory allocation failure"); return NULL; } diff --git a/libs/rs/rsAnimation.cpp b/libs/rs/rsAnimation.cpp index 48b4f029c6d02..a4093d9f423a5 100644 --- a/libs/rs/rsAnimation.cpp +++ b/libs/rs/rsAnimation.cpp @@ -126,7 +126,7 @@ RsAnimation rsi_AnimationCreate(Context *rsc, RsAnimationInterpolation interp, RsAnimationEdge pre, RsAnimationEdge post) { - //LOGE("rsi_ElementCreate %i %i %i %i", dt, dk, norm, vecSize); + //ALOGE("rsi_ElementCreate %i %i %i %i", dt, dk, norm, vecSize); Animation *a = NULL;//Animation::create(rsc, inValues, outValues, valueCount, interp, pre, post); if (a != NULL) { a->incUserRef(); diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index f8213a1d2b112..54fe529eebca4 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -40,7 +40,7 @@ bool Context::initGLThread() { if (!mHal.funcs.initGraphics(this)) { pthread_mutex_unlock(&gInitMutex); - LOGE("%p initGraphics failed", this); + ALOGE("%p initGraphics failed", this); return false; } @@ -219,7 +219,7 @@ void * Context::threadProc(void *vrsc) { if (!rsdHalInit(rsc, 0, 0)) { rsc->setError(RS_ERROR_FATAL_DRIVER, "Failed initializing GL"); - LOGE("Hal init failed"); + ALOGE("Hal init failed"); return NULL; } rsc->mHal.funcs.setPriority(rsc, rsc->mThreadPriority); @@ -322,10 +322,10 @@ void Context::destroyWorkerThreadResources() { void Context::printWatchdogInfo(void *ctx) { Context *rsc = (Context *)ctx; if (rsc->watchdog.command && rsc->watchdog.file) { - LOGE("RS watchdog timeout: %i %s line %i %s", rsc->watchdog.inRoot, + ALOGE("RS watchdog timeout: %i %s line %i %s", rsc->watchdog.inRoot, rsc->watchdog.command, rsc->watchdog.line, rsc->watchdog.file); } else { - LOGE("RS watchdog timeout: %i", rsc->watchdog.inRoot); + ALOGE("RS watchdog timeout: %i", rsc->watchdog.inRoot); } } @@ -403,7 +403,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { status = pthread_attr_init(&threadAttr); if (status) { - LOGE("Failed to init thread attribute."); + ALOGE("Failed to init thread attribute."); return false; } @@ -414,7 +414,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { status = pthread_create(&mThreadId, &threadAttr, threadProc, this); if (status) { - LOGE("Failed to start rs context thread."); + ALOGE("Failed to start rs context thread."); return false; } while (!mRunning && (mError == RS_ERROR_NONE)) { @@ -422,7 +422,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { } if (mError != RS_ERROR_NONE) { - LOGE("Errors during thread init"); + ALOGE("Errors during thread init"); return false; } @@ -578,12 +578,12 @@ void Context::setError(RsError e, const char *msg) const { void Context::dumpDebug() const { - LOGE("RS Context debug %p", this); - LOGE("RS Context debug"); + ALOGE("RS Context debug %p", this); + ALOGE("RS Context debug"); - LOGE(" RS width %i, height %i", mWidth, mHeight); - LOGE(" RS running %i, exit %i, paused %i", mRunning, mExit, mPaused); - LOGE(" RS pThreadID %li, nativeThreadID %i", (long int)mThreadId, mNativeThreadId); + ALOGE(" RS width %i, height %i", mWidth, mHeight); + ALOGE(" RS running %i, exit %i, paused %i", mRunning, mExit, mPaused); + ALOGE(" RS pThreadID %li, nativeThreadID %i", (long int)mThreadId, mNativeThreadId); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -604,7 +604,7 @@ void rsi_ContextBindSampler(Context *rsc, uint32_t slot, RsSampler vs) { Sampler *s = static_cast(vs); if (slot > RS_MAX_SAMPLER_SLOT) { - LOGE("Invalid sampler slot"); + ALOGE("Invalid sampler slot"); return; } diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index 199cc5a36051f..35221e07d3035 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -50,13 +50,13 @@ namespace renderscript { #define CHECK_OBJ(o) { \ GET_TLS(); \ if (!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ - LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ + ALOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #define CHECK_OBJ_OR_NULL(o) { \ GET_TLS(); \ if (o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ - LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ + ALOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #else diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp index df90ce499e852..b65f3800e3cfb 100644 --- a/libs/rs/rsElement.cpp +++ b/libs/rs/rsElement.cpp @@ -94,7 +94,7 @@ Element *Element::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_ELEMENT) { - LOGE("element loading skipped due to invalid class id\n"); + ALOGE("element loading skipped due to invalid class id\n"); return NULL; } diff --git a/libs/rs/rsFBOCache.cpp b/libs/rs/rsFBOCache.cpp index f4a8bc6d7b30a..d50f3e08de6ca 100644 --- a/libs/rs/rsFBOCache.cpp +++ b/libs/rs/rsFBOCache.cpp @@ -46,12 +46,12 @@ void FBOCache::deinit(Context *rsc) { void FBOCache::bindColorTarget(Context *rsc, Allocation *a, uint32_t slot) { if (slot >= mHal.state.colorTargetsCount) { - LOGE("Invalid render target index"); + ALOGE("Invalid render target index"); return; } if (a != NULL) { if (!a->getIsTexture()) { - LOGE("Invalid Color Target"); + ALOGE("Invalid Color Target"); return; } } @@ -63,7 +63,7 @@ void FBOCache::bindColorTarget(Context *rsc, Allocation *a, uint32_t slot) { void FBOCache::bindDepthTarget(Context *rsc, Allocation *a) { if (a != NULL) { if (!a->getIsRenderTarget()) { - LOGE("Invalid Depth Target"); + ALOGE("Invalid Depth Target"); return; } } diff --git a/libs/rs/rsFifoSocket.cpp b/libs/rs/rsFifoSocket.cpp index 8b8008d5c0a2d..163a44be09925 100644 --- a/libs/rs/rsFifoSocket.cpp +++ b/libs/rs/rsFifoSocket.cpp @@ -48,31 +48,31 @@ void FifoSocket::writeAsync(const void *data, size_t bytes) { if (bytes == 0) { return; } - //LOGE("writeAsync %p %i", data, bytes); + //ALOGE("writeAsync %p %i", data, bytes); size_t ret = ::send(sv[0], data, bytes, 0); - //LOGE("writeAsync ret %i", ret); + //ALOGE("writeAsync ret %i", ret); rsAssert(ret == bytes); } void FifoSocket::writeWaitReturn(void *retData, size_t retBytes) { - //LOGE("writeWaitReturn %p %i", retData, retBytes); + //ALOGE("writeWaitReturn %p %i", retData, retBytes); size_t ret = ::recv(sv[0], retData, retBytes, 0); - //LOGE("writeWaitReturn %i", ret); + //ALOGE("writeWaitReturn %i", ret); rsAssert(ret == retBytes); } size_t FifoSocket::read(void *data, size_t bytes) { - //LOGE("read %p %i", data, bytes); + //ALOGE("read %p %i", data, bytes); size_t ret = ::recv(sv[1], data, bytes, 0); rsAssert(ret == bytes); - //LOGE("read ret %i", ret); + //ALOGE("read ret %i", ret); return ret; } void FifoSocket::readReturn(const void *data, size_t bytes) { - LOGE("readReturn %p %Zu", data, bytes); + ALOGE("readReturn %p %Zu", data, bytes); size_t ret = ::send(sv[1], data, bytes, 0); - LOGE("readReturn %Zu", ret); + ALOGE("readReturn %Zu", ret); rsAssert(ret == bytes); } diff --git a/libs/rs/rsFileA3D.cpp b/libs/rs/rsFileA3D.cpp index 530e79e2b0c8c..ac658c8e53ff8 100644 --- a/libs/rs/rsFileA3D.cpp +++ b/libs/rs/rsFileA3D.cpp @@ -278,17 +278,17 @@ ObjectBase *FileA3D::initializeFromEntry(size_t index) { bool FileA3D::writeFile(const char *filename) { if (!mWriteStream) { - LOGE("No objects to write\n"); + ALOGE("No objects to write\n"); return false; } if (mWriteStream->getPos() == 0) { - LOGE("No objects to write\n"); + ALOGE("No objects to write\n"); return false; } FILE *writeHandle = fopen(filename, "wb"); if (!writeHandle) { - LOGE("Couldn't open the file for writing\n"); + ALOGE("Couldn't open the file for writing\n"); return false; } @@ -335,7 +335,7 @@ bool FileA3D::writeFile(const char *filename) { int status = fclose(writeHandle); if (status != 0) { - LOGE("Couldn't close file\n"); + ALOGE("Couldn't close file\n"); return false; } @@ -364,7 +364,7 @@ void FileA3D::appendToFile(ObjectBase *obj) { RsObjectBase rsaFileA3DGetEntryByIndex(RsContext con, uint32_t index, RsFile file) { FileA3D *fa3d = static_cast(file); if (!fa3d) { - LOGE("Can't load entry. No valid file"); + ALOGE("Can't load entry. No valid file"); return NULL; } @@ -389,13 +389,13 @@ void rsaFileA3DGetIndexEntries(RsContext con, RsFileIndexEntry *fileEntries, uin FileA3D *fa3d = static_cast(file); if (!fa3d) { - LOGE("Can't load index entries. No valid file"); + ALOGE("Can't load index entries. No valid file"); return; } uint32_t numFileEntries = fa3d->getNumIndexEntries(); if (numFileEntries != numEntries || numEntries == 0 || fileEntries == NULL) { - LOGE("Can't load index entries. Invalid number requested"); + ALOGE("Can't load index entries. Invalid number requested"); return; } @@ -408,7 +408,7 @@ void rsaFileA3DGetIndexEntries(RsContext con, RsFileIndexEntry *fileEntries, uin RsFile rsaFileA3DCreateFromMemory(RsContext con, const void *data, uint32_t len) { if (data == NULL) { - LOGE("File load failed. Asset stream is NULL"); + ALOGE("File load failed. Asset stream is NULL"); return NULL; } @@ -432,7 +432,7 @@ RsFile rsaFileA3DCreateFromAsset(RsContext con, void *_asset) { RsFile rsaFileA3DCreateFromFile(RsContext con, const char *path) { if (path == NULL) { - LOGE("File load failed. Path is NULL"); + ALOGE("File load failed. Path is NULL"); return NULL; } @@ -446,7 +446,7 @@ RsFile rsaFileA3DCreateFromFile(RsContext con, const char *path) { fa3d->load(f); fclose(f); } else { - LOGE("Could not open file %s", path); + ALOGE("Could not open file %s", path); } return fa3d; diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp index 7efed9d9f948a..e09f81c264ac2 100644 --- a/libs/rs/rsFont.cpp +++ b/libs/rs/rsFont.cpp @@ -39,7 +39,7 @@ Font::Font(Context *rsc) : ObjectBase(rsc), mCachedGlyphs(NULL) { bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data, uint32_t dataLen) { #ifndef ANDROID_RS_SERIALIZE if (mInitialized) { - LOGE("Reinitialization of fonts not supported"); + ALOGE("Reinitialization of fonts not supported"); return false; } @@ -51,7 +51,7 @@ bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data } if (error) { - LOGE("Unable to initialize font %s", name); + ALOGE("Unable to initialize font %s", name); return false; } @@ -61,7 +61,7 @@ bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data error = FT_Set_Char_Size(mFace, (FT_F26Dot6)(fontSize * 64.0f), 0, dpi, 0); if (error) { - LOGE("Unable to set font size on %s", name); + ALOGE("Unable to set font size on %s", name); return false; } @@ -124,7 +124,7 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int32_t x, int32_t y, for (cacheX = glyph->mBitmapMinX, bX = nPenX; cacheX < endX; cacheX++, bX++) { for (cacheY = glyph->mBitmapMinY, bY = nPenY; cacheY < endY; cacheY++, bY++) { if (bX < 0 || bY < 0 || bX >= (int32_t) bitmapW || bY >= (int32_t) bitmapH) { - LOGE("Skipping invalid index"); + ALOGE("Skipping invalid index"); continue; } uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX]; @@ -165,7 +165,7 @@ void Font::renderUTF(const char *text, uint32_t len, int32_t x, int32_t y, if (mode == Font::MEASURE) { if (bounds == NULL) { - LOGE("No return rectangle provided to measure text"); + ALOGE("No return rectangle provided to measure text"); return; } // Reset min and max of the bounding box to something large @@ -237,7 +237,7 @@ void Font::updateGlyphCache(CachedGlyphInfo *glyph) { #ifndef ANDROID_RS_SERIALIZE FT_Error error = FT_Load_Glyph( mFace, glyph->mGlyphIndex, FT_LOAD_RENDER ); if (error) { - LOGE("Couldn't load glyph."); + ALOGE("Couldn't load glyph."); return; } @@ -378,7 +378,7 @@ FT_Library FontState::getLib() { if (!mLibrary) { FT_Error error = FT_Init_FreeType(&mLibrary); if (error) { - LOGE("Unable to initialize freetype"); + ALOGE("Unable to initialize freetype"); return NULL; } } @@ -409,7 +409,7 @@ void FontState::flushAllAndInvalidate() { bool FontState::cacheBitmap(FT_Bitmap *bitmap, uint32_t *retOriginX, uint32_t *retOriginY) { // If the glyph is too tall, don't cache it if ((uint32_t)bitmap->rows > mCacheLines[mCacheLines.size()-1]->mMaxHeight) { - LOGE("Font size to large to fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); + ALOGE("Font size to large to fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); return false; } @@ -439,7 +439,7 @@ bool FontState::cacheBitmap(FT_Bitmap *bitmap, uint32_t *retOriginX, uint32_t *r // if we still don't fit, something is wrong and we shouldn't draw if (!bitmapFit) { - LOGE("Bitmap doesn't fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); + ALOGE("Bitmap doesn't fit in cache. width, height = %i, %i", (int)bitmap->width, (int)bitmap->rows); return false; } } @@ -471,7 +471,7 @@ bool FontState::cacheBitmap(FT_Bitmap *bitmap, uint32_t *retOriginX, uint32_t *r // Some debug code /*for (uint32_t i = 0; i < mCacheLines.size(); i ++) { - LOGE("Cache Line: H: %u Empty Space: %f", + ALOGE("Cache Line: H: %u Empty Space: %f", mCacheLines[i]->mMaxHeight, (1.0f - (float)mCacheLines[i]->mCurrentCol/(float)mCacheLines[i]->mMaxWidth)*100.0f); @@ -663,9 +663,9 @@ void FontState::appendMeshQuad(float x1, float y1, float z1, } /*LOGE("V0 x: %f y: %f z: %f", x1, y1, z1); - LOGE("V1 x: %f y: %f z: %f", x2, y2, z2); - LOGE("V2 x: %f y: %f z: %f", x3, y3, z3); - LOGE("V3 x: %f y: %f z: %f", x4, y4, z4);*/ + ALOGE("V1 x: %f y: %f z: %f", x2, y2, z2); + ALOGE("V2 x: %f y: %f z: %f", x3, y3, z3); + ALOGE("V3 x: %f y: %f z: %f", x4, y4, z4);*/ (*currentPos++) = x1; (*currentPos++) = y1; @@ -742,7 +742,7 @@ void FontState::renderText(const char *text, uint32_t len, int32_t x, int32_t y, currentFont = mDefault.get(); } if (!currentFont) { - LOGE("Unable to initialize any fonts"); + ALOGE("Unable to initialize any fonts"); return; } diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index ce69a603f353d..0466d8bbf04ec 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -45,12 +45,12 @@ bool LocklessCommandFifo::init(uint32_t sizeInBytes) { // Add room for a buffer reset command mBuffer = static_cast(malloc(sizeInBytes + 4)); if (!mBuffer) { - LOGE("LocklessFifo allocation failure"); + ALOGE("LocklessFifo allocation failure"); return false; } if (!mSignalToControl.init() || !mSignalToWorker.init()) { - LOGE("Signal setup failed"); + ALOGE("Signal setup failed"); free(mBuffer); return false; } diff --git a/libs/rs/rsMesh.cpp b/libs/rs/rsMesh.cpp index bf9284f56aaf6..67c7299251353 100644 --- a/libs/rs/rsMesh.cpp +++ b/libs/rs/rsMesh.cpp @@ -107,7 +107,7 @@ Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) { // First make sure we are reading the correct object RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); if (classID != RS_A3D_CLASS_ID_MESH) { - LOGE("mesh loading skipped due to invalid class id"); + ALOGE("mesh loading skipped due to invalid class id"); return NULL; } @@ -178,7 +178,7 @@ void Mesh::render(Context *rsc) const { void Mesh::renderPrimitive(Context *rsc, uint32_t primIndex) const { if (primIndex >= mHal.state.primitivesCount) { - LOGE("Invalid primitive index"); + ALOGE("Invalid primitive index"); return; } @@ -192,7 +192,7 @@ void Mesh::renderPrimitive(Context *rsc, uint32_t primIndex) const { void Mesh::renderPrimitiveRange(Context *rsc, uint32_t primIndex, uint32_t start, uint32_t len) const { if (len < 1 || primIndex >= mHal.state.primitivesCount) { - LOGE("Invalid mesh or parameters"); + ALOGE("Invalid mesh or parameters"); return; } @@ -241,7 +241,7 @@ void Mesh::computeBBox() { mBBoxMin[0] = mBBoxMin[1] = mBBoxMin[2] = 1e6; mBBoxMax[0] = mBBoxMax[1] = mBBoxMax[2] = -1e6; if (!posPtr) { - LOGE("Unable to compute bounding box"); + ALOGE("Unable to compute bounding box"); mBBoxMin[0] = mBBoxMin[1] = mBBoxMin[2] = 0.0f; mBBoxMax[0] = mBBoxMax[1] = mBBoxMax[2] = 0.0f; return; diff --git a/libs/rs/rsMutex.cpp b/libs/rs/rsMutex.cpp index 2105288218bf5..6512372a3ed60 100644 --- a/libs/rs/rsMutex.cpp +++ b/libs/rs/rsMutex.cpp @@ -30,7 +30,7 @@ Mutex::~Mutex() { bool Mutex::init() { int status = pthread_mutex_init(&mMutex, NULL); if (status) { - LOGE("Mutex::Mutex init failure"); + ALOGE("Mutex::Mutex init failure"); return false; } return true; @@ -40,7 +40,7 @@ bool Mutex::lock() { int status; status = pthread_mutex_lock(&mMutex); if (status) { - LOGE("Mutex: error %i locking.", status); + ALOGE("Mutex: error %i locking.", status); return false; } return true; @@ -50,7 +50,7 @@ bool Mutex::unlock() { int status; status = pthread_mutex_unlock(&mMutex); if (status) { - LOGE("Mutex error %i unlocking.", status); + ALOGE("Mutex error %i unlocking.", status); return false; } return true; diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp index addf932a8e678..6a64582bcb8c7 100644 --- a/libs/rs/rsObjectBase.cpp +++ b/libs/rs/rsObjectBase.cpp @@ -204,14 +204,14 @@ void ObjectBase::zeroAllUserRef(Context *rsc) { // This operation can be slow, only to be called during context cleanup. const ObjectBase * o = rsc->mObjHead; while (o) { - //LOGE("o %p", o); + //ALOGE("o %p", o); if (o->zeroUserRef()) { // deleted the object and possibly others, restart from head. o = rsc->mObjHead; - //LOGE("o head %p", o); + //ALOGE("o head %p", o); } else { o = o->mNext; - //LOGE("o next %p", o); + //ALOGE("o next %p", o); } } diff --git a/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp index a9fd8776e5fd0..8061515e24fac 100644 --- a/libs/rs/rsProgram.cpp +++ b/libs/rs/rsProgram.cpp @@ -139,13 +139,13 @@ void Program::initMemberVars() { void Program::bindAllocation(Context *rsc, Allocation *alloc, uint32_t slot) { if (alloc != NULL) { if (slot >= mHal.state.constantsCount) { - LOGE("Attempt to bind alloc at slot %u, on shader id %u, but const count is %u", + ALOGE("Attempt to bind alloc at slot %u, on shader id %u, but const count is %u", slot, (uint32_t)this, mHal.state.constantsCount); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind allocation"); return; } if (alloc->getType() != mConstantTypes[slot].get()) { - LOGE("Attempt to bind alloc at slot %u, on shader id %u, but types mismatch", + ALOGE("Attempt to bind alloc at slot %u, on shader id %u, but types mismatch", slot, (uint32_t)this); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind allocation"); return; @@ -167,13 +167,13 @@ void Program::bindAllocation(Context *rsc, Allocation *alloc, uint32_t slot) { void Program::bindTexture(Context *rsc, uint32_t slot, Allocation *a) { if (slot >= mHal.state.texturesCount) { - LOGE("Attempt to bind texture to slot %u but tex count is %u", slot, mHal.state.texturesCount); + ALOGE("Attempt to bind texture to slot %u but tex count is %u", slot, mHal.state.texturesCount); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind texture"); return; } if (a && a->getType()->getDimFaces() && mHal.state.textureTargets[slot] != RS_TEXTURE_CUBE) { - LOGE("Attempt to bind cubemap to slot %u but 2d texture needed", slot); + ALOGE("Attempt to bind cubemap to slot %u but 2d texture needed", slot); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind cubemap to 2d texture slot"); return; } @@ -186,7 +186,7 @@ void Program::bindTexture(Context *rsc, uint32_t slot, Allocation *a) { void Program::bindSampler(Context *rsc, uint32_t slot, Sampler *s) { if (slot >= mHal.state.texturesCount) { - LOGE("Attempt to bind sampler to slot %u but tex count is %u", slot, mHal.state.texturesCount); + ALOGE("Attempt to bind sampler to slot %u but tex count is %u", slot, mHal.state.texturesCount); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind sampler"); return; } diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp index 81eedc4249941..4e73ca63e90bf 100644 --- a/libs/rs/rsProgramFragment.cpp +++ b/libs/rs/rsProgramFragment.cpp @@ -38,12 +38,12 @@ ProgramFragment::~ProgramFragment() { void ProgramFragment::setConstantColor(Context *rsc, float r, float g, float b, float a) { if (isUserProgram()) { - LOGE("Attempting to set fixed function emulation color on user program"); + ALOGE("Attempting to set fixed function emulation color on user program"); rsc->setError(RS_ERROR_BAD_SHADER, "Cannot set fixed function emulation color on user program"); return; } if (mHal.state.constants[0] == NULL) { - LOGE("Unable to set fixed function emulation color because allocation is missing"); + ALOGE("Unable to set fixed function emulation color because allocation is missing"); rsc->setError(RS_ERROR_BAD_SHADER, "Unable to set fixed function emulation color because allocation is missing"); return; } @@ -63,7 +63,7 @@ void ProgramFragment::setup(Context *rsc, ProgramFragmentState *state) { for (uint32_t ct=0; ct < mHal.state.texturesCount; ct++) { if (!mHal.state.textures[ct]) { - LOGE("No texture bound for shader id %u, texture unit %u", (uint)this, ct); + ALOGE("No texture bound for shader id %u, texture unit %u", (uint)this, ct); rsc->setError(RS_ERROR_BAD_SHADER, "No texture bound"); continue; } @@ -131,7 +131,7 @@ RsProgramFragment rsi_ProgramFragmentCreate(Context *rsc, const char * shaderTex size_t paramLength) { ProgramFragment *pf = new ProgramFragment(rsc, shaderText, shaderLength, params, paramLength); pf->incUserRef(); - //LOGE("rsi_ProgramFragmentCreate %p", pf); + //ALOGE("rsi_ProgramFragmentCreate %p", pf); return pf; } diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index 93513fe3e6a53..fad9c081b96f4 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -39,9 +39,9 @@ Script::~Script() { } void Script::setSlot(uint32_t slot, Allocation *a) { - //LOGE("setSlot %i %p", slot, a); + //ALOGE("setSlot %i %p", slot, a); if (slot >= mHal.info.exportedVariableCount) { - LOGE("Script::setSlot unable to set allocation, invalid slot index"); + ALOGE("Script::setSlot unable to set allocation, invalid slot index"); return; } @@ -54,21 +54,21 @@ void Script::setSlot(uint32_t slot, Allocation *a) { } void Script::setVar(uint32_t slot, const void *val, size_t len) { - //LOGE("setVar %i %p %i", slot, val, len); + //ALOGE("setVar %i %p %i", slot, val, len); if (slot >= mHal.info.exportedVariableCount) { - LOGE("Script::setVar unable to set allocation, invalid slot index"); + ALOGE("Script::setVar unable to set allocation, invalid slot index"); return; } mRSC->mHal.funcs.script.setGlobalVar(mRSC, this, slot, (void *)val, len); } void Script::setVarObj(uint32_t slot, ObjectBase *val) { - //LOGE("setVarObj %i %p", slot, val); + //ALOGE("setVarObj %i %p", slot, val); if (slot >= mHal.info.exportedVariableCount) { - LOGE("Script::setVarObj unable to set allocation, invalid slot index"); + ALOGE("Script::setVarObj unable to set allocation, invalid slot index"); return; } - //LOGE("setvarobj %i %p", slot, val); + //ALOGE("setvarobj %i %p", slot, val); mRSC->mHal.funcs.script.setGlobalObj(mRSC, this, slot, val); } @@ -85,7 +85,7 @@ void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint3 Script *s = static_cast