summaryrefslogtreecommitdiff
path: root/libs/binder/IProcessInfoService.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/IProcessInfoService.cpp')
-rw-r--r--libs/binder/IProcessInfoService.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/libs/binder/IProcessInfoService.cpp b/libs/binder/IProcessInfoService.cpp
index c37920d8c2..76508b88bf 100644
--- a/libs/binder/IProcessInfoService.cpp
+++ b/libs/binder/IProcessInfoService.cpp
@@ -88,72 +88,4 @@ IMPLEMENT_META_INTERFACE(ProcessInfoService, "android.os.IProcessInfoService");
// ----------------------------------------------------------------------
-status_t BnProcessInfoService::onTransact( uint32_t code, const Parcel& data, Parcel* reply,
- uint32_t flags) {
- switch(code) {
- case GET_PROCESS_STATES_FROM_PIDS: {
- CHECK_INTERFACE(IProcessInfoService, data, reply);
- int32_t arrayLen = data.readInt32();
- if (arrayLen <= 0) {
- reply->writeNoException();
- reply->writeInt32(0);
- reply->writeInt32(NOT_ENOUGH_DATA);
- return NO_ERROR;
- }
-
- size_t len = static_cast<size_t>(arrayLen);
- int32_t pids[len];
- status_t res = data.read(pids, len * sizeof(*pids));
-
- // Ignore output array length returned in the parcel here, as the states array must
- // always be the same length as the input PIDs array.
- int32_t states[len];
- for (size_t i = 0; i < len; i++) states[i] = -1;
- if (res == NO_ERROR) {
- res = getProcessStatesFromPids(len, /*in*/ pids, /*out*/ states);
- }
- reply->writeNoException();
- reply->writeInt32Array(len, states);
- reply->writeInt32(res);
- return NO_ERROR;
- } break;
- case GET_PROCESS_STATES_AND_OOM_SCORES_FROM_PIDS: {
- CHECK_INTERFACE(IProcessInfoService, data, reply);
- int32_t arrayLen = data.readInt32();
- if (arrayLen <= 0) {
- reply->writeNoException();
- reply->writeInt32(0);
- reply->writeInt32(NOT_ENOUGH_DATA);
- return NO_ERROR;
- }
-
- size_t len = static_cast<size_t>(arrayLen);
- int32_t pids[len];
- status_t res = data.read(pids, len * sizeof(*pids));
-
- // Ignore output array length returned in the parcel here, as the
- // states array must always be the same length as the input PIDs array.
- int32_t states[len];
- int32_t scores[len];
- for (size_t i = 0; i < len; i++) {
- states[i] = -1;
- scores[i] = -10000;
- }
- if (res == NO_ERROR) {
- res = getProcessStatesAndOomScoresFromPids(
- len, /*in*/ pids, /*out*/ states, /*out*/ scores);
- }
- reply->writeNoException();
- reply->writeInt32Array(len, states);
- reply->writeInt32Array(len, scores);
- reply->writeInt32(res);
- return NO_ERROR;
- } break;
- default:
- return BBinder::onTransact(code, data, reply, flags);
- }
-}
-
-// ----------------------------------------------------------------------
-
}; // namespace android