summaryrefslogtreecommitdiff
path: root/adservices/service-core/java/com/android/adservices/service/AdServicesConfig.java
blob: 63334cadc5e4007b0d93ca9f97bcb6b1dde3bdeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.adservices.service;

import java.util.concurrent.TimeUnit;

/**
 * Hard Coded Configs for AdServices.
 *
 * <p>For Feature Flags that are backed by PH, please see {@link PhFlags}
 */
public class AdServicesConfig {
    /** Job ID for idle maintenance job ({@link MaintenanceJobService}). */
    public static final int MAINTENANCE_JOB_ID = 1;

    /**
     * Job ID for Topics Epoch Computation Job ({@link
     * com.android.adservices.service.topics.EpochJobService})
     */
    public static final int TOPICS_EPOCH_JOB_ID = 2;

    /**
     * Job ID for Measurement Event Main Reporting Job ({@link
     * com.android.adservices.service.measurement.EventReportingJobService})
     */
    public static final int MEASUREMENT_EVENT_MAIN_REPORTING_JOB_ID = 3;

    public static long MEASUREMENT_EVENT_MAIN_REPORTING_JOB_PERIOD_MS = TimeUnit.HOURS.toMillis(4);

    public static long getMeasurementEventMainReportingJobPeriodMs() {
        return FlagsFactory.getFlags().getMeasurementEventMainReportingJobPeriodMs();
    }

    /**
     * Job ID for Measurement Delete Expired Records Job ({@link
     * com.android.adservices.service.measurement.DeleteExpiredJobService})
     */
    public static final int MEASUREMENT_DELETE_EXPIRED_JOB_ID = 4;

    public static long MEASUREMENT_DELETE_EXPIRED_JOB_PERIOD_MS = TimeUnit.HOURS.toMillis(24);
    public static long MEASUREMENT_DELETE_EXPIRED_WINDOW_MS = TimeUnit.DAYS.toMillis(30);

    /**
     * Returns the min time period (in millis) between each expired-record deletion maintenance job
     * run.
     */
    public static long getMeasurementDeleteExpiredJobPeriodMs() {
        return MEASUREMENT_DELETE_EXPIRED_JOB_PERIOD_MS;
    }

    /**
     * Job ID for Measurement Attribution Job ({@link
     * com.android.adservices.service.measurement.attribution.AttributionJobService}).
     */
    public static final int MEASUREMENT_ATTRIBUTION_JOB_ID = 5;

    /**
     * Job ID for Measurement Fallback Reporting Job ({@link
     * com.android.adservices.service.measurement.EventFallbackReportingJobService})
     */
    public static final int MEASUREMENT_EVENT_FALLBACK_REPORTING_JOB_ID = 6;

    public static long MEASUREMENT_EVENT_FALLBACK_REPORTING_JOB_PERIOD_MS =
            TimeUnit.HOURS.toMillis(24);

    /** Returns the min time period (in millis) between each event fallback reporting job run. */
    public static long getMeasurementEventFallbackReportingJobPeriodMs() {
        return FlagsFactory.getFlags().getMeasurementEventFallbackReportingJobPeriodMs();
    }

    /**
     * Returns the URL for fetching public encryption keys for aggregatable reports.
     */
    public static String getMeasurementAggregateEncryptionKeyCoordinatorUrl() {
        return FlagsFactory.getFlags().getMeasurementAggregateEncryptionKeyCoordinatorUrl();
    }

    /**
     * Job ID for Measurement Aggregate Main Reporting Job ({@link
     * com.android.adservices.service.measurement.AggregateReportingJobService})
     */
    public static final int MEASUREMENT_AGGREGATE_MAIN_REPORTING_JOB_ID = 7;

    /** Returns the min time period (in millis) between each aggregate main reporting job run. */
    public static long getMeasurementAggregateMainReportingJobPeriodMs() {
        return FlagsFactory.getFlags().getMeasurementAggregateMainReportingJobPeriodMs();
    }

    /**
     * Job ID for Measurement Aggregate Fallback Reporting Job ({@link
     * com.android.adservices.service.measurement.AggregateFallbackReportingJobService})
     */
    public static final int MEASUREMENT_AGGREGATE_FALLBACK_REPORTING_JOB_ID = 8;

    public static long MEASUREMENT_AGGREGATE_FALLBACK_REPORTING_JOB_PERIOD_MS =
            TimeUnit.HOURS.toMillis(24);

    /**
     * Returns the min time period (in millis) between each aggregate fallback reporting job run.
     */
    public static long getMeasurementAggregateFallbackReportingJobPeriodMs() {
        return FlagsFactory.getFlags().getMeasurementAggregateFallbackReportingJobPeriodMs();
    }

    /**
     * Job ID for FLEDGE Background Fetch Job ({@link
     * com.android.adservices.service.customaudience.BackgroundFetchJobService})
     */
    public static final int FLEDGE_BACKGROUND_FETCH_JOB_ID = 9;

    /** Job ID for Consent Notification Job. */
    public static final int CONSENT_NOTIFICATION_JOB_ID = 10;

    /** Job ID for Mdd Maintenance Task ({@link com.android.adservices.download.MddJobService}) */
    public static final int MDD_MAINTENANCE_PERIODIC_TASK_JOB_ID = 11;

    /**
     * Job ID for Mdd Charging Periodic Task ({@link com.android.adservices.download.MddJobService})
     */
    public static final int MDD_CHARGING_PERIODIC_TASK_JOB_ID = 12;

    /**
     * Job ID for Mdd Cellular Charging Task ({@link com.android.adservices.download.MddJobService})
     */
    public static final int MDD_CELLULAR_CHARGING_PERIODIC_TASK_JOB_ID = 13;

    /** Job ID for Mdd Wifi Charging Task ({@link com.android.adservices.download.MddJobService}) */
    public static final int MDD_WIFI_CHARGING_PERIODIC_TASK_JOB_ID = 14;
}