summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorYi Jin <jinyithu@google.com>2017-09-05 13:44:22 -0700
committerYi Jin <jinyithu@google.com>2017-09-07 10:53:51 -0700
commit0f0471623e91c202fb7381a050cc331572fb439f (patch)
tree6c5b30199c6eea59c9a65743ad4767bc8f761aa7 /core/java/android
parent99c248feb2d1f863b864bdfd1e3b37af17f18732 (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 'core/java/android')
-rw-r--r--core/java/android/os/IncidentReportArgs.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/os/IncidentReportArgs.java b/core/java/android/os/IncidentReportArgs.java
index abb316171309..fd0ebcfea080 100644
--- a/core/java/android/os/IncidentReportArgs.java
+++ b/core/java/android/os/IncidentReportArgs.java
@@ -35,6 +35,7 @@ public final class IncidentReportArgs implements Parcelable {
private final IntArray mSections = new IntArray();
private final ArrayList<byte[]> mHeaders = new ArrayList<byte[]>();
private boolean mAll;
+ private int mDest;
/**
* Construct an incident report args with no fields.
@@ -69,6 +70,8 @@ public final class IncidentReportArgs implements Parcelable {
for (int i=0; i<N; i++) {
out.writeByteArray(mHeaders.get(i));
}
+
+ out.writeInt(mDest);
}
public void readFromParcel(Parcel in) {
@@ -85,6 +88,8 @@ public final class IncidentReportArgs implements Parcelable {
for (int i=0; i<N; i++) {
mHeaders.add(in.createByteArray());
}
+
+ mDest = in.readInt();
}
public static final Parcelable.Creator<IncidentReportArgs> CREATOR
@@ -118,7 +123,8 @@ public final class IncidentReportArgs implements Parcelable {
}
sb.append(", ");
sb.append(mHeaders.size());
- sb.append(" headers)");
+ sb.append(" headers), ");
+ sb.append("Dest enum value: ").append(mDest);
return sb.toString();
}
@@ -133,6 +139,14 @@ public final class IncidentReportArgs implements Parcelable {
}
/**
+ * Set this incident report privacy policy spec.
+ * @hide
+ */
+ public void setPrivacyPolicy(int dest) {
+ mDest = dest;
+ }
+
+ /**
* Add this section to the incident report. Skip if the input is smaller than 2 since section
* id are only valid for positive integer as Protobuf field id. Here 1 is reserved for Header.
*/