diff options
author | Chenjie Yu <cjyu@google.com> | 2018-11-28 21:29:44 +0000 |
---|---|---|
committer | Chenjie Yu <cjyu@google.com> | 2018-11-28 15:53:09 -0800 |
commit | d7e3a228be89cbcc233001a3e251e49a0014fb15 (patch) | |
tree | 96b1edb978690fc482e03c0b3de9dda614d8f581 /libs/services/src | |
parent | 01ce898135ece1e3dd2f68f6e25534b8244ad439 (diff) |
Revert "Revert "support work chain in pulled atoms""
This reverts commit 9c7b1319962673658ee28a7845fc0a7cf840c61e.
Reason for revert: Fixed build failures due to merge
Change-Id: I7d7bfed3a3234b966f3fe3fd6e0cbc63d2bedf83
Test: unit test
Diffstat (limited to 'libs/services/src')
-rw-r--r-- | libs/services/src/os/StatsLogEventWrapper.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/services/src/os/StatsLogEventWrapper.cpp b/libs/services/src/os/StatsLogEventWrapper.cpp index 04c4629b5432..f6dfdef16e19 100644 --- a/libs/services/src/os/StatsLogEventWrapper.cpp +++ b/libs/services/src/os/StatsLogEventWrapper.cpp @@ -58,6 +58,31 @@ status_t StatsLogEventWrapper::readFromParcel(const Parcel* in) { ALOGE("statsd could not read wall clock time from parcel"); return res; } + int numWorkChain = 0; + if ((res = in->readInt32(&numWorkChain)) != OK) { + ALOGE("statsd could not read number of work chains from parcel"); + return res; + } + if (numWorkChain > 0) { + for (int i = 0; i < numWorkChain; i++) { + int numNodes = 0; + if ((res = in->readInt32(&numNodes)) != OK) { + ALOGE( + "statsd could not read number of nodes in work chain from parcel"); + return res; + } + if (numNodes == 0) { + ALOGE("empty work chain"); + return BAD_VALUE; + } + WorkChain wc; + for (int j = 0; j < numNodes; j++) { + wc.uids.push_back(in->readInt32()); + wc.tags.push_back(std::string(String8(in->readString16()).string())); + } + mWorkChains.push_back(wc); + } + } int dataSize = 0; if ((res = in->readInt32(&dataSize)) != OK) { ALOGE("statsd could not read data size from parcel"); |