1 /* 2 * Copyright 2022 Google LLC 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 package com.google.android.libraries.mobiledatadownload.internal.logging; 17 18 import static com.google.common.util.concurrent.Futures.immediateVoidFuture; 19 20 import com.google.common.util.concurrent.AsyncCallable; 21 import com.google.common.util.concurrent.ListenableFuture; 22 import com.google.mobiledatadownload.LogEnumsProto.MddClientEvent; 23 import com.google.mobiledatadownload.LogEnumsProto.MddDownloadResult; 24 import com.google.mobiledatadownload.LogProto.DataDownloadFileGroupStats; 25 import com.google.mobiledatadownload.LogProto.MddDownloadLatency; 26 import com.google.mobiledatadownload.LogProto.MddLibApiResultLog; 27 import com.google.mobiledatadownload.LogProto.MddNetworkStats; 28 import com.google.mobiledatadownload.LogProto.MddStorageStats; 29 30 import java.util.List; 31 32 /** No-Op EventLogger implementation. */ 33 public final class NoOpEventLogger implements EventLogger { 34 35 @Override logEventSampled(MddClientEvent.Code eventCode)36 public void logEventSampled(MddClientEvent.Code eventCode) { 37 } 38 39 @Override logEventSampled( MddClientEvent.Code eventCode, String fileGroupName, int fileGroupVersionNumber, long buildId, String variantId)40 public void logEventSampled( 41 MddClientEvent.Code eventCode, 42 String fileGroupName, 43 int fileGroupVersionNumber, 44 long buildId, 45 String variantId) { 46 } 47 48 @Override logEventAfterSample(MddClientEvent.Code eventCode, int sampleInterval)49 public void logEventAfterSample(MddClientEvent.Code eventCode, int sampleInterval) { 50 } 51 52 @Override logMddFileGroupStats( AsyncCallable<List<EventLogger.FileGroupStatusWithDetails>> buildFileGroupStats)53 public ListenableFuture<Void> logMddFileGroupStats( 54 AsyncCallable<List<EventLogger.FileGroupStatusWithDetails>> buildFileGroupStats) { 55 return immediateVoidFuture(); 56 } 57 58 @Override logMddApiCallStats(DataDownloadFileGroupStats fileGroupDetails, Void apiCallStats)59 public void logMddApiCallStats(DataDownloadFileGroupStats fileGroupDetails, Void apiCallStats) { 60 } 61 62 @Override logMddLibApiResultLog(MddLibApiResultLog mddLibApiResultLog)63 public void logMddLibApiResultLog(MddLibApiResultLog mddLibApiResultLog) { 64 } 65 66 @Override logMddStorageStats( AsyncCallable<MddStorageStats> buildMddStorageStats)67 public ListenableFuture<Void> logMddStorageStats( 68 AsyncCallable<MddStorageStats> buildMddStorageStats) { 69 return immediateVoidFuture(); 70 } 71 72 @Override logMddNetworkStats( AsyncCallable<MddNetworkStats> buildMddNetworkStats)73 public ListenableFuture<Void> logMddNetworkStats( 74 AsyncCallable<MddNetworkStats> buildMddNetworkStats) { 75 return immediateVoidFuture(); 76 } 77 78 @Override logMddDataDownloadFileExpirationEvent(int eventCode, int count)79 public void logMddDataDownloadFileExpirationEvent(int eventCode, int count) { 80 } 81 82 @Override logMddNetworkSavings( DataDownloadFileGroupStats fileGroupDetails, int code, long fullFileSize, long downloadedFileSize, String fileId, int deltaIndex)83 public void logMddNetworkSavings( 84 DataDownloadFileGroupStats fileGroupDetails, 85 int code, 86 long fullFileSize, 87 long downloadedFileSize, 88 String fileId, 89 int deltaIndex) { 90 } 91 92 @Override logMddDownloadResult( MddDownloadResult.Code code, DataDownloadFileGroupStats fileGroupDetails)93 public void logMddDownloadResult( 94 MddDownloadResult.Code code, DataDownloadFileGroupStats fileGroupDetails) { 95 } 96 97 @Override logMddQueryStats(DataDownloadFileGroupStats fileGroupDetails)98 public void logMddQueryStats(DataDownloadFileGroupStats fileGroupDetails) { 99 } 100 101 @Override logMddAndroidSharingLog(Void event)102 public void logMddAndroidSharingLog(Void event) { 103 } 104 105 @Override logMddDownloadLatency( DataDownloadFileGroupStats fileGroupStats, MddDownloadLatency downloadLatency)106 public void logMddDownloadLatency( 107 DataDownloadFileGroupStats fileGroupStats, MddDownloadLatency downloadLatency) { 108 } 109 110 @Override logMddUsageEvent(DataDownloadFileGroupStats fileGroupDetails, Void usageEventLog)111 public void logMddUsageEvent(DataDownloadFileGroupStats fileGroupDetails, Void usageEventLog) { 112 } 113 114 @Override logNewConfigReceived( DataDownloadFileGroupStats fileGroupDetails, Void newConfigReceivedInfo)115 public void logNewConfigReceived( 116 DataDownloadFileGroupStats fileGroupDetails, Void newConfigReceivedInfo) { 117 } 118 } 119