1 /* 2 * Copyright (C) 2023 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.adselection; 18 19 import android.adservices.adselection.ContextualAds; 20 21 import com.android.adservices.data.customaudience.DBCustomAudience; 22 23 import java.util.List; 24 25 /** Interface for filtering ads out of an ad selection auction. */ 26 public interface AdFilterer { 27 /** 28 * Takes a list of CAs and returns an identical list with any ads that should be filtered 29 * removed. 30 * 31 * <p>Note that some of the copying to the new list is shallow, so the original list should not 32 * be re-used after the method is called. 33 * 34 * @param cas A list of CAs to filter ads for. 35 * @return A list of cas identical to the cas input, but with any ads that should be filtered 36 * removed. 37 */ filterCustomAudiences(List<DBCustomAudience> cas)38 List<DBCustomAudience> filterCustomAudiences(List<DBCustomAudience> cas); 39 /** 40 * Takes in a {@link ContextualAds} object and filters out ads from it that should not be in the 41 * auction 42 * 43 * @param contextualAds An object containing contextual ads corresponding to a buyer 44 * @return A list of object identical to the input, but without any ads that should be filtered 45 */ filterContextualAds(ContextualAds contextualAds)46 ContextualAds filterContextualAds(ContextualAds contextualAds); 47 } 48