1 /* 2 * Copyright (C) 2024 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.stats; 18 19 import com.android.adservices.service.stats.pas.EncodingFetchStats; 20 21 public interface FetchProcessLogger { 22 /** Invokes the logger to log {@link EncodingFetchStats}. */ logEncodingJsFetchStats( @dsRelevanceStatusUtils.EncodingFetchStatus int jsFetchStatus)23 default void logEncodingJsFetchStats( 24 @AdsRelevanceStatusUtils.EncodingFetchStatus int jsFetchStatus) { 25 // do nothing 26 } 27 28 /** Sets the AdTech's eTLD+1 ID. */ setAdTechId(String adTechId)29 default void setAdTechId(String adTechId) { 30 // do nothing 31 } 32 33 /** Sets the timestamp to start download the js. */ setJsDownloadStartTimestamp(long jsDownloadStartTimestamp)34 default void setJsDownloadStartTimestamp(long jsDownloadStartTimestamp) { 35 // do nothing 36 } 37 38 /** Invokes the logger to log {@link ServerAuctionKeyFetchCalledStats} for database. */ logServerAuctionKeyFetchCalledStatsFromDatabase()39 default void logServerAuctionKeyFetchCalledStatsFromDatabase() { 40 // do nothing 41 } 42 43 /** Invokes the logger to log {@link ServerAuctionKeyFetchCalledStats} for network call. */ logServerAuctionKeyFetchCalledStatsFromNetwork(int networkCode)44 default void logServerAuctionKeyFetchCalledStatsFromNetwork(int networkCode) { 45 // do nothing 46 } 47 48 /** Sets the timestamp to start network call. */ startNetworkCallTimestamp()49 default void startNetworkCallTimestamp() { 50 // do nothing 51 } 52 53 /** Sets the key fetch source */ setSource(@dsRelevanceStatusUtils.ServerAuctionKeyFetchSource int source)54 default void setSource(@AdsRelevanceStatusUtils.ServerAuctionKeyFetchSource int source) { 55 // do nothing 56 } 57 58 /** Sets the encryption key source */ setEncryptionKeySource( @dsRelevanceStatusUtils.ServerAuctionEncryptionKeySource int encryptionKeySource)59 default void setEncryptionKeySource( 60 @AdsRelevanceStatusUtils.ServerAuctionEncryptionKeySource int encryptionKeySource) { 61 // do nothing 62 } 63 64 /** Sets the coordinator source */ setCoordinatorSource( @dsRelevanceStatusUtils.ServerAuctionCoordinatorSource int coordinatorSource)65 default void setCoordinatorSource( 66 @AdsRelevanceStatusUtils.ServerAuctionCoordinatorSource int coordinatorSource) { 67 // do nothing 68 } 69 70 /** Sets the timestamp of the download script start. */ startDownloadScriptTimestamp()71 default void startDownloadScriptTimestamp() { 72 // do nothing 73 } 74 75 /** Sets the timestamp of the download script end and stores the result code. */ endDownloadScriptTimestamp(int resultCode)76 default void endDownloadScriptTimestamp(int resultCode) { 77 // do nothing 78 } 79 } 80