diff options
author | Yi Jin <jinyithu@google.com> | 2017-09-05 13:44:22 -0700 |
---|---|---|
committer | Yi Jin <jinyithu@google.com> | 2017-09-07 10:53:51 -0700 |
commit | 0f0471623e91c202fb7381a050cc331572fb439f (patch) | |
tree | 6c5b30199c6eea59c9a65743ad4767bc8f761aa7 /libs/incident | |
parent | 99c248feb2d1f863b864bdfd1e3b37af17f18732 (diff) |
Implement Pii Stripper Part 3
The incident request args sets privacy spec. Strip action is optimized
to run once for each type of spec and ready for flush multiple times.
Incident command is updated to take -p option to specify privacy spec.
Bug: 64687253
Test: unit tests written, manually run incident command to test as well
Change-Id: I6753df117f76dc1a5f4d2152baa3fbbf56b490e4
Diffstat (limited to 'libs/incident')
-rw-r--r-- | libs/incident/include/android/os/IncidentReportArgs.h | 6 | ||||
-rw-r--r-- | libs/incident/src/IncidentReportArgs.cpp | 24 |
2 files changed, 26 insertions, 4 deletions
diff --git a/libs/incident/include/android/os/IncidentReportArgs.h b/libs/incident/include/android/os/IncidentReportArgs.h index 956ef6c39b99..da8098970962 100644 --- a/libs/incident/include/android/os/IncidentReportArgs.h +++ b/libs/incident/include/android/os/IncidentReportArgs.h @@ -39,12 +39,13 @@ public: virtual status_t readFromParcel(const Parcel* in); void setAll(bool all); + void setDest(int dest); void addSection(int section); void addHeader(const vector<int8_t>& header); - inline bool all() const { return mAll; }; + inline bool all() const { return mAll; } bool containsSection(int section) const; - + inline int dest() const { return mDest; } inline const set<int>& sections() const { return mSections; } inline const vector<vector<int8_t>>& headers() const { return mHeaders; } @@ -54,6 +55,7 @@ private: set<int> mSections; vector<vector<int8_t>> mHeaders; bool mAll; + int mDest; }; } diff --git a/libs/incident/src/IncidentReportArgs.cpp b/libs/incident/src/IncidentReportArgs.cpp index f60490911aed..e62872238387 100644 --- a/libs/incident/src/IncidentReportArgs.cpp +++ b/libs/incident/src/IncidentReportArgs.cpp @@ -25,14 +25,16 @@ namespace os { IncidentReportArgs::IncidentReportArgs() :mSections(), - mAll(false) + mAll(false), + mDest(-1) { } IncidentReportArgs::IncidentReportArgs(const IncidentReportArgs& that) :mSections(that.mSections), mHeaders(that.mHeaders), - mAll(that.mAll) + mAll(that.mAll), + mDest(that.mDest) { } @@ -74,6 +76,11 @@ IncidentReportArgs::writeToParcel(Parcel* out) const } } + err = out->writeInt32(mDest); + if (err != NO_ERROR) { + return err; + } + return NO_ERROR; } @@ -120,6 +127,13 @@ IncidentReportArgs::readFromParcel(const Parcel* in) } } + int32_t dest; + err = in->readInt32(&dest); + if (err != NO_ERROR) { + return err; + } + mDest = dest; + return OK; } @@ -133,6 +147,12 @@ IncidentReportArgs::setAll(bool all) } void +IncidentReportArgs::setDest(int dest) +{ + mDest = dest; +} + +void IncidentReportArgs::addSection(int section) { if (!mAll) { |