diff options
Diffstat (limited to 'adservices/service-core/java/com/android/adservices/service/measurement/aggregation/AggregateReport.java')
-rw-r--r-- | adservices/service-core/java/com/android/adservices/service/measurement/aggregation/AggregateReport.java | 79 |
1 files changed, 67 insertions, 12 deletions
diff --git a/adservices/service-core/java/com/android/adservices/service/measurement/aggregation/AggregateReport.java b/adservices/service-core/java/com/android/adservices/service/measurement/aggregation/AggregateReport.java index b46de5be35..cc8417ded7 100644 --- a/adservices/service-core/java/com/android/adservices/service/measurement/aggregation/AggregateReport.java +++ b/adservices/service-core/java/com/android/adservices/service/measurement/aggregation/AggregateReport.java @@ -21,6 +21,8 @@ import android.net.Uri; import androidx.annotation.Nullable; +import com.android.adservices.service.measurement.util.UnsignedLong; + import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -43,18 +45,32 @@ public class AggregateReport { private String mDebugCleartextPayload; private AggregateAttributionData mAggregateAttributionData; private @Status int mStatus; + private @DebugReportStatus int mDebugReportStatus; private String mApiVersion; - @Nullable private Long mSourceDebugKey; - @Nullable private Long mTriggerDebugKey; + @Nullable private UnsignedLong mSourceDebugKey; + @Nullable private UnsignedLong mTriggerDebugKey; + private String mSourceId; + private String mTriggerId; - @IntDef(value = { - Status.PENDING, - Status.DELIVERED, - }) + @IntDef(value = {Status.PENDING, Status.DELIVERED, Status.MARKED_TO_DELETE}) @Retention(RetentionPolicy.SOURCE) public @interface Status { int PENDING = 0; int DELIVERED = 1; + int MARKED_TO_DELETE = 2; + } + + @IntDef( + value = { + DebugReportStatus.NONE, + DebugReportStatus.PENDING, + DebugReportStatus.DELIVERED, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface DebugReportStatus { + int NONE = 0; + int PENDING = 1; + int DELIVERED = 2; } private AggregateReport() { @@ -67,6 +83,7 @@ public class AggregateReport { mDebugCleartextPayload = null; mAggregateAttributionData = null; mStatus = AggregateReport.Status.PENDING; + mDebugReportStatus = AggregateReport.DebugReportStatus.NONE; mSourceDebugKey = null; mTriggerDebugKey = null; } @@ -86,9 +103,12 @@ public class AggregateReport { && Objects.equals( mAggregateAttributionData, aggregateReport.mAggregateAttributionData) && mStatus == aggregateReport.mStatus + && mDebugReportStatus == aggregateReport.mDebugReportStatus && Objects.equals(mApiVersion, aggregateReport.mApiVersion) && Objects.equals(mSourceDebugKey, aggregateReport.mSourceDebugKey) - && Objects.equals(mTriggerDebugKey, aggregateReport.mTriggerDebugKey); + && Objects.equals(mTriggerDebugKey, aggregateReport.mTriggerDebugKey) + && Objects.equals(mSourceId, aggregateReport.mSourceId) + && Objects.equals(mTriggerId, aggregateReport.mTriggerId); } @Override @@ -103,8 +123,11 @@ public class AggregateReport { mDebugCleartextPayload, mAggregateAttributionData, mStatus, + mDebugReportStatus, mSourceDebugKey, - mTriggerDebugKey); + mTriggerDebugKey, + mSourceId, + mTriggerId); } /** @@ -158,13 +181,13 @@ public class AggregateReport { /** Source Debug Key */ @Nullable - public Long getSourceDebugKey() { + public UnsignedLong getSourceDebugKey() { return mSourceDebugKey; } /** Trigger Debug Key */ @Nullable - public Long getTriggerDebugKey() { + public UnsignedLong getTriggerDebugKey() { return mTriggerDebugKey; } @@ -182,6 +205,11 @@ public class AggregateReport { return mStatus; } + /** Current {@link DebugReportStatus} of the report. */ + public @DebugReportStatus int getDebugReportStatus() { + return mDebugReportStatus; + } + /** * Api version when the report was issued. */ @@ -216,6 +244,16 @@ public class AggregateReport { return debugPayload.toString(); } + /** Source ID */ + public String getSourceId() { + return mSourceId; + } + + /** Trigger ID */ + public String getTriggerId() { + return mTriggerId; + } + /** * Builder for {@link AggregateReport}. */ @@ -298,6 +336,11 @@ public class AggregateReport { mAttributionReport.mStatus = status; return this; } + /** See {@link AggregateReport#getDebugReportStatus()} */ + public Builder setDebugReportStatus(@DebugReportStatus int debugReportStatus) { + mAttributionReport.mDebugReportStatus = debugReportStatus; + return this; + } /** * See {@link AggregateReport#getApiVersion()} @@ -308,17 +351,29 @@ public class AggregateReport { } /** See {@link AggregateReport#getSourceDebugKey()} ()} */ - public Builder setSourceDebugKey(Long sourceDebugKey) { + public Builder setSourceDebugKey(UnsignedLong sourceDebugKey) { mAttributionReport.mSourceDebugKey = sourceDebugKey; return this; } /** See {@link AggregateReport#getTriggerDebugKey()} ()} */ - public Builder setTriggerDebugKey(Long triggerDebugKey) { + public Builder setTriggerDebugKey(UnsignedLong triggerDebugKey) { mAttributionReport.mTriggerDebugKey = triggerDebugKey; return this; } + /** See {@link AggregateReport#getSourceId()} */ + public AggregateReport.Builder setSourceId(String sourceId) { + mAttributionReport.mSourceId = sourceId; + return this; + } + + /** See {@link AggregateReport#getTriggerId()} */ + public AggregateReport.Builder setTriggerId(String triggerId) { + mAttributionReport.mTriggerId = triggerId; + return this; + } + /** * Build the {@link AggregateReport}. */ |