1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.adservices.service.measurement; 18 19 import com.android.adservices.service.FlagsFactory; 20 21 import java.util.concurrent.TimeUnit; 22 23 /** 24 * Class for holding system health related parameters. All values in this class are temporary and 25 * subject to change based on feedback and testing. 26 */ 27 public class SystemHealthParams { 28 SystemHealthParams()29 private SystemHealthParams() {} 30 31 /** Max number of triggers a destination can register. */ getMaxTriggersPerDestination()32 public static int getMaxTriggersPerDestination() { 33 return FlagsFactory.getFlags().getMeasurementMaxTriggersPerDestination(); 34 } 35 36 /** Max number of sources per publisher. */ getMaxSourcesPerPublisher()37 public static int getMaxSourcesPerPublisher() { 38 return FlagsFactory.getFlags().getMeasurementMaxSourcesPerPublisher(); 39 } 40 41 /** Max number of aggregate reports in storage per destination */ getMaxAggregateReportsPerDestination()42 public static int getMaxAggregateReportsPerDestination() { 43 return FlagsFactory.getFlags().getMeasurementMaxAggregateReportsPerDestination(); 44 } 45 46 /** Max number of event reports in storage per destination */ getMaxEventReportsPerDestination()47 public static int getMaxEventReportsPerDestination() { 48 return FlagsFactory.getFlags().getMeasurementMaxEventReportsPerDestination(); 49 } 50 51 /** Delay for attribution job triggering. */ 52 public static final long ATTRIBUTION_JOB_TRIGGERING_DELAY_MS = TimeUnit.MINUTES.toMillis(2); 53 54 /** Delay for async registration job triggering. */ 55 public static final long ASYNC_REGISTRATION_JOB_TRIGGERING_DELAY_MS = 56 TimeUnit.MINUTES.toMillis(2); 57 /** Max for async registration job triggering. */ 58 public static final long ASYNC_REGISTRATION_JOB_TRIGGERING_MAX_DELAY_MS = 59 TimeUnit.MINUTES.toMillis(5); 60 61 /** Max number of {@link Trigger} to process per job for {@link AttributionJobService} */ 62 public static final int MAX_ATTRIBUTIONS_PER_INVOCATION = 100; 63 64 /** Maximum event report upload retry window. */ 65 public static final long MAX_EVENT_REPORT_UPLOAD_RETRY_WINDOW_MS = TimeUnit.DAYS.toMillis(28); 66 67 /** Maximum aggregate report upload retry window. */ 68 public static final long MAX_AGGREGATE_REPORT_UPLOAD_RETRY_WINDOW_MS = 69 TimeUnit.DAYS.toMillis(28); 70 71 /** Maximum number of bytes allowed in an attribution filter string. */ 72 public static final int MAX_BYTES_PER_ATTRIBUTION_FILTER_STRING = 25; 73 74 /** Maximum number of filter maps allowed in an attribution filter set. */ 75 public static final int MAX_FILTER_MAPS_PER_FILTER_SET = 5; 76 77 /** Maximum number of values allowed in an attribution filter. */ 78 public static final int MAX_VALUES_PER_ATTRIBUTION_FILTER = 50; 79 80 /** Maximum number of attribution filters allowed for a source. */ 81 public static final int MAX_ATTRIBUTION_FILTERS = 50; 82 83 /** Maximum number of bytes allowed in an aggregate key ID. */ 84 public static final int MAX_BYTES_PER_ATTRIBUTION_AGGREGATE_KEY_ID = 25; 85 86 /** Maximum number of aggregation keys allowed during source or trigger registration. */ 87 public static final int MAX_AGGREGATE_KEYS_PER_REGISTRATION = 50; 88 89 /** Maximum number of aggregate deduplication keys allowed during trigger registration. */ 90 public static final int MAX_AGGREGATE_DEDUPLICATION_KEYS_PER_REGISTRATION = 50; 91 92 /** Maximum number of aggregatable trigger data allowed in a trigger registration. */ 93 public static final int MAX_AGGREGATABLE_TRIGGER_DATA = 50; 94 95 /** Maximum number of event trigger data allowed in a trigger registration. */ 96 public static final int MAX_ATTRIBUTION_EVENT_TRIGGER_DATA = 10; 97 98 /** Maximum window for a delayed source to be considered valid instead of missed. */ 99 public static final long MAX_DELAYED_SOURCE_REGISTRATION_WINDOW = TimeUnit.MINUTES.toMillis(2); 100 } 101