diff options
| -rw-r--r-- | cmds/dumpsys/dumpsys.cpp | 35 | ||||
| -rw-r--r-- | cmds/dumpsys/main.cpp | 5 | ||||
| -rw-r--r-- | libs/binder/IPCThreadState.cpp | 5 | ||||
| -rw-r--r-- | libs/binder/tests/Android.bp | 6 |
4 files changed, 28 insertions, 23 deletions
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp index 5597bcd915..a427c8dd68 100644 --- a/cmds/dumpsys/dumpsys.cpp +++ b/cmds/dumpsys/dumpsys.cpp @@ -29,6 +29,7 @@ #include <utils/Log.h> #include <utils/Vector.h> +#include <iostream> #include <fcntl.h> #include <getopt.h> #include <stdio.h> @@ -231,14 +232,14 @@ int Dumpsys::main(int argc, char* const argv[]) { const size_t N = services.size(); if (N > 1) { // first print a list of the current services - aout << "Currently running services:" << endl; + std::cout << "Currently running services:" << std::endl; for (size_t i=0; i<N; i++) { sp<IBinder> service = sm_->checkService(services[i]); if (service != nullptr) { bool skipped = IsSkipped(skippedServices, services[i]); - aout << " " << services[i] << (skipped ? " (skipped)" : "") << endl; + std::cout << " " << services[i] << (skipped ? " (skipped)" : "") << std::endl; } } } @@ -263,10 +264,10 @@ int Dumpsys::main(int argc, char* const argv[]) { asProto, elapsedDuration, bytesWritten); if (status == TIMED_OUT) { - aout << endl + std::cout << std::endl << "*** SERVICE '" << serviceName << "' DUMP TIMEOUT (" << timeoutArgMs - << "ms) EXPIRED ***" << endl - << endl; + << "ms) EXPIRED ***" << std::endl + << std::endl; } if (addSeparator) { @@ -332,14 +333,14 @@ status_t Dumpsys::startDumpThread(Type type, const String16& serviceName, const Vector<String16>& args) { sp<IBinder> service = sm_->checkService(serviceName); if (service == nullptr) { - aerr << "Can't find service: " << serviceName << endl; + std::cerr << "Can't find service: " << serviceName << std::endl; return NAME_NOT_FOUND; } int sfd[2]; if (pipe(sfd) != 0) { - aerr << "Failed to create pipe to dump service info for " << serviceName << ": " - << strerror(errno) << endl; + std::cerr << "Failed to create pipe to dump service info for " << serviceName << ": " + << strerror(errno) << std::endl; return -errno; } @@ -359,13 +360,13 @@ status_t Dumpsys::startDumpThread(Type type, const String16& serviceName, err = dumpPidToFd(service, remote_end); break; default: - aerr << "Unknown dump type" << static_cast<int>(type) << endl; + std::cerr << "Unknown dump type" << static_cast<int>(type) << std::endl; return; } if (err != OK) { - aerr << "Error dumping service info status_t: " << statusToString(err) << " " - << serviceName << endl; + std::cerr << "Error dumping service info status_t: " << statusToString(err) << " " + << serviceName << std::endl; } }); return OK; @@ -422,8 +423,8 @@ status_t Dumpsys::writeDump(int fd, const String16& serviceName, std::chrono::mi int rc = TEMP_FAILURE_RETRY(poll(&pfd, 1, time_left_ms())); if (rc < 0) { - aerr << "Error in poll while dumping service " << serviceName << " : " - << strerror(errno) << endl; + std::cerr << "Error in poll while dumping service " << serviceName << " : " + << strerror(errno) << std::endl; status = -errno; break; } else if (rc == 0) { @@ -434,8 +435,8 @@ status_t Dumpsys::writeDump(int fd, const String16& serviceName, std::chrono::mi char buf[4096]; rc = TEMP_FAILURE_RETRY(read(redirectFd_.get(), buf, sizeof(buf))); if (rc < 0) { - aerr << "Failed to read while dumping service " << serviceName << ": " - << strerror(errno) << endl; + std::cerr << "Failed to read while dumping service " << serviceName << ": " + << strerror(errno) << std::endl; status = -errno; break; } else if (rc == 0) { @@ -444,8 +445,8 @@ status_t Dumpsys::writeDump(int fd, const String16& serviceName, std::chrono::mi } if (!WriteFully(fd, buf, rc)) { - aerr << "Failed to write while dumping service " << serviceName << ": " - << strerror(errno) << endl; + std::cerr << "Failed to write while dumping service " << serviceName << ": " + << strerror(errno) << std::endl; status = -errno; break; } diff --git a/cmds/dumpsys/main.cpp b/cmds/dumpsys/main.cpp index 8ba0eba0fa..fa4cc97b91 100644 --- a/cmds/dumpsys/main.cpp +++ b/cmds/dumpsys/main.cpp @@ -21,10 +21,9 @@ #include "dumpsys.h" #include <binder/IServiceManager.h> -#include <binder/TextOutput.h> +#include <iostream> #include <signal.h> -#include <stdio.h> using namespace android; @@ -34,7 +33,7 @@ int main(int argc, char* const argv[]) { fflush(stdout); if (sm == nullptr) { ALOGE("Unable to get default service manager!"); - aerr << "dumpsys: Unable to get default service manager!" << endl; + std::cerr << "dumpsys: Unable to get default service manager!" << std::endl; return 20; } diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 4dcd07a776..9e89c57da3 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -1230,6 +1230,11 @@ status_t IPCThreadState::executeCommand(int32_t cmd) if (error < NO_ERROR) reply.setError(error); sendReply(reply, 0); } else { + if (error != OK || reply.dataSize() != 0) { + alog << "oneway function results will be dropped but finished with status " + << statusToString(error) + << " and parcel size " << reply.dataSize() << endl; + } LOG_ONEWAY("NOT sending reply to %d!", mCallingPid); } diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp index 5a7f9a97fa..3ee818734a 100644 --- a/libs/binder/tests/Android.bp +++ b/libs/binder/tests/Android.bp @@ -40,7 +40,7 @@ cc_test { }, srcs: ["binderDriverInterfaceTest.cpp"], - test_suites: ["device-tests"], + test_suites: ["device-tests", "vts-core"], } cc_test { @@ -69,7 +69,7 @@ cc_test { "libbinder", "libutils", ], - test_suites: ["device-tests"], + test_suites: ["device-tests", "vts-core"], require_root: true, } @@ -131,7 +131,7 @@ cc_test { "liblog", "libutils", ], - test_suites: ["device-tests"], + test_suites: ["device-tests", "vts-core"], require_root: true, } |