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; 18 19 import java.util.concurrent.TimeUnit; 20 21 /** 22 * Hard Coded Configs for AdServices. 23 * 24 * <p>For Feature Flags that are backed by PH, please see {@link PhFlags} 25 */ 26 public class AdServicesConfig { 27 getMeasurementEventMainReportingJobPeriodMs()28 public static long getMeasurementEventMainReportingJobPeriodMs() { 29 return FlagsFactory.getFlags().getMeasurementEventMainReportingJobPeriodMs(); 30 } 31 32 public static long MEASUREMENT_DELETE_EXPIRED_JOB_PERIOD_MS = TimeUnit.HOURS.toMillis(24); 33 34 /** 35 * Returns the min time period (in millis) between each expired-record deletion maintenance job 36 * run. 37 */ getMeasurementDeleteExpiredJobPeriodMs()38 public static long getMeasurementDeleteExpiredJobPeriodMs() { 39 return MEASUREMENT_DELETE_EXPIRED_JOB_PERIOD_MS; 40 } 41 42 /** Returns the min time period (in millis) between each event fallback reporting job run. */ getMeasurementEventFallbackReportingJobPeriodMs()43 public static long getMeasurementEventFallbackReportingJobPeriodMs() { 44 return FlagsFactory.getFlags().getMeasurementEventFallbackReportingJobPeriodMs(); 45 } 46 47 /** Returns the URL for fetching public encryption keys for aggregatable reports. */ getMeasurementAggregateEncryptionKeyCoordinatorUrl()48 public static String getMeasurementAggregateEncryptionKeyCoordinatorUrl() { 49 return FlagsFactory.getFlags().getMeasurementAggregateEncryptionKeyCoordinatorUrl(); 50 } 51 52 /** Returns the min time period (in millis) between each aggregate main reporting job run. */ getMeasurementAggregateMainReportingJobPeriodMs()53 public static long getMeasurementAggregateMainReportingJobPeriodMs() { 54 return FlagsFactory.getFlags().getMeasurementAggregateMainReportingJobPeriodMs(); 55 } 56 57 /** 58 * Returns the min time period (in millis) between each aggregate fallback reporting job run. 59 */ getMeasurementAggregateFallbackReportingJobPeriodMs()60 public static long getMeasurementAggregateFallbackReportingJobPeriodMs() { 61 return FlagsFactory.getFlags().getMeasurementAggregateFallbackReportingJobPeriodMs(); 62 } 63 64 /** 65 * Returns the min time period (in millis) between each uninstalled-record deletion maintenance 66 * job run. 67 */ getMeasurementDeleteUninstalledJobPeriodMs()68 public static long getMeasurementDeleteUninstalledJobPeriodMs() { 69 return MEASUREMENT_DELETE_UNINSTALLED_JOB_PERIOD_MS; 70 } 71 72 public static long MEASUREMENT_DELETE_UNINSTALLED_JOB_PERIOD_MS = TimeUnit.HOURS.toMillis(24); 73 } 74