• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.experimentation;
17 
18 import static com.google.common.util.concurrent.Futures.immediateVoidFuture;
19 
20 import com.google.common.util.concurrent.ListenableFuture;
21 import com.google.errorprone.annotations.CheckReturnValue;
22 import com.google.mobiledatadownload.internal.MetadataProto.DataFileGroupInternal;
23 import java.util.Collection;
24 
25 /** Implementation of DownloadStageManager that does nothing. */
26 @CheckReturnValue
27 public final class NoOpDownloadStageManager implements DownloadStageManager {
28 
29   /** Clear all set experiment ids from phenotype. */
30   @Override
clearAll()31   public ListenableFuture<Void> clearAll() {
32     return immediateVoidFuture();
33   }
34 
35   @Override
clearExperimentIdsForBuildsIfNoneActive( Collection<DataFileGroupInternal> fileGroupsToClear)36   public ListenableFuture<Void> clearExperimentIdsForBuildsIfNoneActive(
37       Collection<DataFileGroupInternal> fileGroupsToClear) {
38     return immediateVoidFuture();
39   }
40 
41   /**
42    * Propagates the experiment ids for {@code groupName} to phenotype. If there are multiple active
43    * builds with the given name, all experiment ids will be propagated.
44    *
45    * <p>Any failures encountered will be propagated to the returned future.
46    */
47   @Override
updateExperimentIds(String groupName)48   public ListenableFuture<Void> updateExperimentIds(String groupName) {
49     return immediateVoidFuture();
50   }
51 }
52