| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef ANDROID_OS_INCIDENT_REPORT_ARGS_H |
| 18 |
#define ANDROID_OS_INCIDENT_REPORT_ARGS_H |
| 19 |
|
| 20 |
#include <binder/IServiceManager.h> |
| 21 |
#include <binder/Parcel.h> |
| 22 |
#include <binder/Parcelable.h> |
| 23 |
#include <utils/String16.h> |
| 24 |
|
| 25 |
#include <set> |
| 26 |
#include <vector> |
| 27 |
|
| 28 |
namespace android { |
| 29 |
namespace os { |
| 30 |
|
| 31 |
using namespace std; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
const uint8_t PRIVACY_POLICY_LOCAL = 0; |
| 36 |
const uint8_t PRIVACY_POLICY_EXPLICIT = 100; |
| 37 |
const uint8_t PRIVACY_POLICY_AUTOMATIC = 200; |
| 38 |
const uint8_t PRIVACY_POLICY_UNSET = 255; |
| 39 |
|
| 40 |
|
| 41 |
class IncidentReportArgs : public Parcelable { |
| 42 |
public: |
| 43 |
IncidentReportArgs(); |
| 44 |
IncidentReportArgs(const IncidentReportArgs& that); |
| 45 |
virtual ~IncidentReportArgs(); |
| 46 |
|
| 47 |
virtual status_t writeToParcel(Parcel* out) const; |
| 48 |
virtual status_t readFromParcel(const Parcel* in); |
| 49 |
|
| 50 |
void setAll(bool all); |
| 51 |
void setPrivacyPolicy(int privacyPolicy); |
| 52 |
void addSection(int section); |
| 53 |
void setReceiverPkg(const string& pkg); |
| 54 |
void setReceiverCls(const string& cls); |
| 55 |
void addHeader(const vector<uint8_t>& headerProto); |
| 56 |
void setGzip(bool gzip); |
| 57 |
|
| 58 |
inline bool all() const { return mAll; } |
| 59 |
bool containsSection(int section, bool specific) const; |
| 60 |
inline int getPrivacyPolicy() const { return mPrivacyPolicy; } |
| 61 |
inline const set<int>& sections() const { return mSections; } |
| 62 |
inline const string& receiverPkg() const { return mReceiverPkg; } |
| 63 |
inline const string& receiverCls() const { return mReceiverCls; } |
| 64 |
inline const vector<vector<uint8_t>>& headers() const { return mHeaders; } |
| 65 |
inline bool gzip() const {return mGzip; } |
| 66 |
|
| 67 |
void merge(const IncidentReportArgs& that); |
| 68 |
|
| 69 |
private: |
| 70 |
set<int> mSections; |
| 71 |
vector<vector<uint8_t>> mHeaders; |
| 72 |
bool mAll; |
| 73 |
int mPrivacyPolicy; |
| 74 |
string mReceiverPkg; |
| 75 |
string mReceiverCls; |
| 76 |
bool mGzip; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
#endif |