summaryrefslogtreecommitdiff
path: root/libs/incident
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2019-04-12 18:11:30 -0700
committerJoe Onorato <joeo@google.com>2019-04-26 16:00:05 -0700
commit7a406b47ebd2ec9dc37e203863df8806e55dfc00 (patch)
treefc8d23774c9b6bd4d6714da9affa05fead25136e /libs/incident
parent68fa9376b3482b04f9749e103f9be35b0fb249a2 (diff)
Don't include restricted images in incident reports unless they're specifically mentioned in the IncidentReportArgs
Test: adb shell incident -p EXPLICIT -s com.google.android.incident.gts/.ReportReadyReceiver 3025 Test: adb shell incident -p EXPLICIT -s com.google.android.incident.gts/.ReportReadyReceiver Bug: 123543706 Change-Id: I2c55831b73338f68196838ee529e595f566e657f
Diffstat (limited to 'libs/incident')
-rw-r--r--libs/incident/include/android/os/IncidentReportArgs.h2
-rw-r--r--libs/incident/src/IncidentReportArgs.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/libs/incident/include/android/os/IncidentReportArgs.h b/libs/incident/include/android/os/IncidentReportArgs.h
index 4391a9b12b76..94b4ad6eae31 100644
--- a/libs/incident/include/android/os/IncidentReportArgs.h
+++ b/libs/incident/include/android/os/IncidentReportArgs.h
@@ -53,7 +53,7 @@ public:
void addHeader(const vector<uint8_t>& headerProto);
inline bool all() const { return mAll; }
- bool containsSection(int section) const;
+ bool containsSection(int section, bool specific) const;
inline int getPrivacyPolicy() const { return mPrivacyPolicy; }
inline const set<int>& sections() const { return mSections; }
inline const string& receiverPkg() const { return mReceiverPkg; }
diff --git a/libs/incident/src/IncidentReportArgs.cpp b/libs/incident/src/IncidentReportArgs.cpp
index 4268638f62cd..9d8a98338ef0 100644
--- a/libs/incident/src/IncidentReportArgs.cpp
+++ b/libs/incident/src/IncidentReportArgs.cpp
@@ -194,9 +194,13 @@ IncidentReportArgs::addHeader(const vector<uint8_t>& headerProto)
}
bool
-IncidentReportArgs::containsSection(int section) const
+IncidentReportArgs::containsSection(int section, bool specific) const
{
- return mAll || mSections.find(section) != mSections.end();
+ if (specific) {
+ return mSections.find(section) != mSections.end();
+ } else {
+ return mAll || mSections.find(section) != mSections.end();
+ }
}
void