Loading cmds/app_process/app_main.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ public: * executing boot class Java code and thereby deny ourselves access to * non-boot classes. */ char* slashClassName = toSlashClassName(mClassName.string()); char* slashClassName = toSlashClassName(mClassName.c_str()); mClass = env->FindClass(slashClassName); if (mClass == NULL) { ALOGE("ERROR: could not find class '%s'\n", mClassName.string()); ALOGE("ERROR: could not find class '%s'\n", mClassName.c_str()); } free(slashClassName); Loading Loading @@ -179,7 +179,7 @@ int main(int argc, char* const argv[]) argv_String.append(argv[i]); argv_String.append("\" "); } ALOGV("app_process main with argv: %s", argv_String.string()); ALOGV("app_process main with argv: %s", argv_String.c_str()); } AppRuntime runtime(argv[0], computeArgBlockSize(argc, argv)); Loading Loading @@ -300,7 +300,7 @@ int main(int argc, char* const argv[]) restOfArgs.append(argv_new[k]); restOfArgs.append("\" "); } ALOGV("Class name = %s, args = %s", className.string(), restOfArgs.string()); ALOGV("Class name = %s, args = %s", className.c_str(), restOfArgs.c_str()); } } else { // We're in zygote mode. Loading Loading @@ -329,7 +329,7 @@ int main(int argc, char* const argv[]) } if (!niceName.empty()) { runtime.setArgv0(niceName.string(), true /* setProcName */); runtime.setArgv0(niceName.c_str(), true /* setProcName */); } if (zygote) { Loading cmds/bootanimation/BootAnimation.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -1137,7 +1137,7 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) { if (!readFile(animation.zip, "desc.txt", desString)) { return false; } char const* s = desString.string(); char const* s = desString.c_str(); std::string dynamicColoringPartName = ""; bool postDynamicColoring = false; Loading @@ -1146,7 +1146,7 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) { const char* endl = strstr(s, "\n"); if (endl == nullptr) break; String8 line(s, endl - s); const char* l = line.string(); const char* l = line.c_str(); int fps = 0; int width = 0; int height = 0; Loading Loading @@ -1330,7 +1330,7 @@ bool BootAnimation::preloadZip(Animation& animation) { // If there is trimData present, override the positioning defaults. for (Animation::Part& part : animation.parts) { const char* trimDataStr = part.trimData.string(); const char* trimDataStr = part.trimData.c_str(); for (size_t frameIdx = 0; frameIdx < part.frames.size(); frameIdx++) { const char* endl = strstr(trimDataStr, "\n"); // No more trimData for this part. Loading @@ -1338,7 +1338,7 @@ bool BootAnimation::preloadZip(Animation& animation) { break; } String8 line(trimDataStr, endl - trimDataStr); const char* lineStr = line.string(); const char* lineStr = line.c_str(); trimDataStr = ++endl; int width = 0, height = 0, x = 0, y = 0; if (sscanf(lineStr, "%dx%d+%d+%d", &width, &height, &x, &y) == 4) { Loading Loading @@ -1566,7 +1566,7 @@ bool BootAnimation::playAnimation(const Animation& animation) { 1.0f); ALOGD("Playing files = %s/%s, Requested repeat = %d, playUntilComplete = %s", animation.fileName.string(), part.path.string(), part.count, animation.fileName.c_str(), part.path.c_str(), part.count, part.playUntilComplete ? "true" : "false"); // For the last animation, if we have progress indicator from Loading Loading @@ -1787,17 +1787,17 @@ void BootAnimation::releaseAnimation(Animation* animation) const { BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn) { if (mLoadedFiles.indexOf(fn) >= 0) { SLOGE("File \"%s\" is already loaded. Cyclic ref is not allowed", fn.string()); fn.c_str()); return nullptr; } ZipFileRO *zip = ZipFileRO::open(fn); if (zip == nullptr) { SLOGE("Failed to open animation zip \"%s\": %s", fn.string(), strerror(errno)); fn.c_str(), strerror(errno)); return nullptr; } ALOGD("%s is loaded successfully", fn.string()); ALOGD("%s is loaded successfully", fn.c_str()); Animation *animation = new Animation; animation->fileName = fn; Loading cmds/incident/main.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -83,8 +83,8 @@ StatusListener::onReportSectionStatus(int32_t section, int32_t status) Status StatusListener::onReportServiceStatus(const String16& service, int32_t status) { fprintf(stderr, "service '%s' status %d\n", String8(service).string(), status); ALOGD("service '%s' status %d\n", String8(service).string(), status); fprintf(stderr, "service '%s' status %d\n", String8(service).c_str(), status); ALOGD("service '%s' status %d\n", String8(service).c_str(), status); return Status::ok(); } Loading Loading @@ -384,7 +384,7 @@ main(int argc, char** argv) status = service->reportIncidentToStream(args, listener, std::move(writeEnd)); if (!status.isOk()) { fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().string()); fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().c_str()); return 1; } Loading @@ -396,14 +396,14 @@ main(int argc, char** argv) sp<StatusListener> listener(new StatusListener()); status = service->reportIncidentToDumpstate(std::move(writeEnd), listener); if (!status.isOk()) { fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().string()); fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().c_str()); return 1; } return listener->getExitCodeOrElse(stream_output(fds[0], STDOUT_FILENO)); } else { status = service->reportIncident(args); if (!status.isOk()) { fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().string()); fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().c_str()); return 1; } else { return 0; Loading cmds/incident_helper/src/TextParserBase.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ status_t NoopParser::Parse(const int in, const int out) const { string content; if (!ReadFdToString(in, &content)) { fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.c_str()); return -1; } if (!WriteStringToFd(content, out)) { fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.c_str()); return -1; } return NO_ERROR; Loading @@ -42,13 +42,13 @@ status_t ReverseParser::Parse(const int in, const int out) const { string content; if (!ReadFdToString(in, &content)) { fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.c_str()); return -1; } // reverse the content reverse(content.begin(), content.end()); if (!WriteStringToFd(content, out)) { fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.c_str()); return -1; } return NO_ERROR; Loading cmds/incident_helper/src/main.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ int main(int argc, char** argv) { fprintf(stderr, "Pasring section %d...\n", sectionID); TextParserBase* parser = selectParser(sectionID); if (parser != nullptr) { fprintf(stderr, "Running parser: %s\n", parser->name.string()); fprintf(stderr, "Running parser: %s\n", parser->name.c_str()); status_t err = parser->Parse(STDIN_FILENO, STDOUT_FILENO); if (err != NO_ERROR) { fprintf(stderr, "Parse error in section %d: %s\n", sectionID, strerror(-err)); Loading Loading
cmds/app_process/app_main.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ public: * executing boot class Java code and thereby deny ourselves access to * non-boot classes. */ char* slashClassName = toSlashClassName(mClassName.string()); char* slashClassName = toSlashClassName(mClassName.c_str()); mClass = env->FindClass(slashClassName); if (mClass == NULL) { ALOGE("ERROR: could not find class '%s'\n", mClassName.string()); ALOGE("ERROR: could not find class '%s'\n", mClassName.c_str()); } free(slashClassName); Loading Loading @@ -179,7 +179,7 @@ int main(int argc, char* const argv[]) argv_String.append(argv[i]); argv_String.append("\" "); } ALOGV("app_process main with argv: %s", argv_String.string()); ALOGV("app_process main with argv: %s", argv_String.c_str()); } AppRuntime runtime(argv[0], computeArgBlockSize(argc, argv)); Loading Loading @@ -300,7 +300,7 @@ int main(int argc, char* const argv[]) restOfArgs.append(argv_new[k]); restOfArgs.append("\" "); } ALOGV("Class name = %s, args = %s", className.string(), restOfArgs.string()); ALOGV("Class name = %s, args = %s", className.c_str(), restOfArgs.c_str()); } } else { // We're in zygote mode. Loading Loading @@ -329,7 +329,7 @@ int main(int argc, char* const argv[]) } if (!niceName.empty()) { runtime.setArgv0(niceName.string(), true /* setProcName */); runtime.setArgv0(niceName.c_str(), true /* setProcName */); } if (zygote) { Loading
cmds/bootanimation/BootAnimation.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -1137,7 +1137,7 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) { if (!readFile(animation.zip, "desc.txt", desString)) { return false; } char const* s = desString.string(); char const* s = desString.c_str(); std::string dynamicColoringPartName = ""; bool postDynamicColoring = false; Loading @@ -1146,7 +1146,7 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) { const char* endl = strstr(s, "\n"); if (endl == nullptr) break; String8 line(s, endl - s); const char* l = line.string(); const char* l = line.c_str(); int fps = 0; int width = 0; int height = 0; Loading Loading @@ -1330,7 +1330,7 @@ bool BootAnimation::preloadZip(Animation& animation) { // If there is trimData present, override the positioning defaults. for (Animation::Part& part : animation.parts) { const char* trimDataStr = part.trimData.string(); const char* trimDataStr = part.trimData.c_str(); for (size_t frameIdx = 0; frameIdx < part.frames.size(); frameIdx++) { const char* endl = strstr(trimDataStr, "\n"); // No more trimData for this part. Loading @@ -1338,7 +1338,7 @@ bool BootAnimation::preloadZip(Animation& animation) { break; } String8 line(trimDataStr, endl - trimDataStr); const char* lineStr = line.string(); const char* lineStr = line.c_str(); trimDataStr = ++endl; int width = 0, height = 0, x = 0, y = 0; if (sscanf(lineStr, "%dx%d+%d+%d", &width, &height, &x, &y) == 4) { Loading Loading @@ -1566,7 +1566,7 @@ bool BootAnimation::playAnimation(const Animation& animation) { 1.0f); ALOGD("Playing files = %s/%s, Requested repeat = %d, playUntilComplete = %s", animation.fileName.string(), part.path.string(), part.count, animation.fileName.c_str(), part.path.c_str(), part.count, part.playUntilComplete ? "true" : "false"); // For the last animation, if we have progress indicator from Loading Loading @@ -1787,17 +1787,17 @@ void BootAnimation::releaseAnimation(Animation* animation) const { BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn) { if (mLoadedFiles.indexOf(fn) >= 0) { SLOGE("File \"%s\" is already loaded. Cyclic ref is not allowed", fn.string()); fn.c_str()); return nullptr; } ZipFileRO *zip = ZipFileRO::open(fn); if (zip == nullptr) { SLOGE("Failed to open animation zip \"%s\": %s", fn.string(), strerror(errno)); fn.c_str(), strerror(errno)); return nullptr; } ALOGD("%s is loaded successfully", fn.string()); ALOGD("%s is loaded successfully", fn.c_str()); Animation *animation = new Animation; animation->fileName = fn; Loading
cmds/incident/main.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -83,8 +83,8 @@ StatusListener::onReportSectionStatus(int32_t section, int32_t status) Status StatusListener::onReportServiceStatus(const String16& service, int32_t status) { fprintf(stderr, "service '%s' status %d\n", String8(service).string(), status); ALOGD("service '%s' status %d\n", String8(service).string(), status); fprintf(stderr, "service '%s' status %d\n", String8(service).c_str(), status); ALOGD("service '%s' status %d\n", String8(service).c_str(), status); return Status::ok(); } Loading Loading @@ -384,7 +384,7 @@ main(int argc, char** argv) status = service->reportIncidentToStream(args, listener, std::move(writeEnd)); if (!status.isOk()) { fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().string()); fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().c_str()); return 1; } Loading @@ -396,14 +396,14 @@ main(int argc, char** argv) sp<StatusListener> listener(new StatusListener()); status = service->reportIncidentToDumpstate(std::move(writeEnd), listener); if (!status.isOk()) { fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().string()); fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().c_str()); return 1; } return listener->getExitCodeOrElse(stream_output(fds[0], STDOUT_FILENO)); } else { status = service->reportIncident(args); if (!status.isOk()) { fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().string()); fprintf(stderr, "reportIncident returned \"%s\"\n", status.toString8().c_str()); return 1; } else { return 0; Loading
cmds/incident_helper/src/TextParserBase.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ status_t NoopParser::Parse(const int in, const int out) const { string content; if (!ReadFdToString(in, &content)) { fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.c_str()); return -1; } if (!WriteStringToFd(content, out)) { fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.c_str()); return -1; } return NO_ERROR; Loading @@ -42,13 +42,13 @@ status_t ReverseParser::Parse(const int in, const int out) const { string content; if (!ReadFdToString(in, &content)) { fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to read data from incidentd\n", this->name.c_str()); return -1; } // reverse the content reverse(content.begin(), content.end()); if (!WriteStringToFd(content, out)) { fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.string()); fprintf(stderr, "[%s]Failed to write data to incidentd\n", this->name.c_str()); return -1; } return NO_ERROR; Loading
cmds/incident_helper/src/main.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ int main(int argc, char** argv) { fprintf(stderr, "Pasring section %d...\n", sectionID); TextParserBase* parser = selectParser(sectionID); if (parser != nullptr) { fprintf(stderr, "Running parser: %s\n", parser->name.string()); fprintf(stderr, "Running parser: %s\n", parser->name.c_str()); status_t err = parser->Parse(STDIN_FILENO, STDOUT_FILENO); if (err != NO_ERROR) { fprintf(stderr, "Parse error in section %d: %s\n", sectionID, strerror(-err)); Loading