summaryrefslogtreecommitdiff
path: root/libs/incident
diff options
context:
space:
mode:
Diffstat (limited to 'libs/incident')
-rw-r--r--libs/incident/include/android/os/IncidentReportArgs.h6
-rw-r--r--libs/incident/src/IncidentReportArgs.cpp25
2 files changed, 31 insertions, 0 deletions
diff --git a/libs/incident/include/android/os/IncidentReportArgs.h b/libs/incident/include/android/os/IncidentReportArgs.h
index 5e8eac1833ce..f056d3b6c9e8 100644
--- a/libs/incident/include/android/os/IncidentReportArgs.h
+++ b/libs/incident/include/android/os/IncidentReportArgs.h
@@ -47,12 +47,16 @@ public:
void setAll(bool all);
void setDest(int dest);
void addSection(int section);
+ void setReceiverPkg(const string& pkg);
+ void setReceiverCls(const string& cls);
void addHeader(const vector<uint8_t>& headerProto);
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 String16& receiverPkg() const { return mReceiverPkg; }
+ inline const String16& receiverCls() const { return mReceiverCls; }
inline const vector<vector<uint8_t>>& headers() const { return mHeaders; }
void merge(const IncidentReportArgs& that);
@@ -62,6 +66,8 @@ private:
vector<vector<uint8_t>> mHeaders;
bool mAll;
int mDest;
+ String16 mReceiverPkg;
+ String16 mReceiverCls;
};
}
diff --git a/libs/incident/src/IncidentReportArgs.cpp b/libs/incident/src/IncidentReportArgs.cpp
index 06b7a5b682b1..46c8dcf967d7 100644
--- a/libs/incident/src/IncidentReportArgs.cpp
+++ b/libs/incident/src/IncidentReportArgs.cpp
@@ -81,6 +81,16 @@ IncidentReportArgs::writeToParcel(Parcel* out) const
return err;
}
+ err = out->writeString16(mReceiverPkg);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
+ err = out->writeString16(mReceiverCls);
+ if (err != NO_ERROR) {
+ return err;
+ }
+
return NO_ERROR;
}
@@ -134,6 +144,9 @@ IncidentReportArgs::readFromParcel(const Parcel* in)
}
mDest = dest;
+ mReceiverPkg = in->readString16();
+ mReceiverCls = in->readString16();
+
return OK;
}
@@ -161,6 +174,18 @@ IncidentReportArgs::addSection(int section)
}
void
+IncidentReportArgs::setReceiverPkg(const string& pkg)
+{
+ mReceiverPkg = String16(pkg.c_str());
+}
+
+void
+IncidentReportArgs::setReceiverCls(const string& cls)
+{
+ mReceiverCls = String16(cls.c_str());
+}
+
+void
IncidentReportArgs::addHeader(const vector<uint8_t>& headerProto)
{
mHeaders.push_back(headerProto);