1 /* 2 * Copyright (C) 2016 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.tradefed.host; 18 19 import com.android.tradefed.build.IBuildProvider; 20 import com.android.tradefed.config.ConfigurationException; 21 import com.android.tradefed.targetprep.DeviceFlashPreparer; 22 23 import java.io.File; 24 import java.util.List; 25 import java.util.Map; 26 import java.util.Set; 27 28 /** 29 * Host options holder interface. 30 * This interface is used to access host-wide options. 31 */ 32 public interface IHostOptions { 33 34 /** 35 * Returns the max number of concurrent flashing to allow. Used by {@link DeviceFlashPreparer}. 36 * 37 * @return the concurrent flasher limit. 38 */ getConcurrentFlasherLimit()39 Integer getConcurrentFlasherLimit(); 40 41 /** 42 * Returns the max number of concurrent downloads allowed. Used by {@link IBuildProvider} that 43 * downloads remote builds. 44 */ getConcurrentDownloadLimit()45 Integer getConcurrentDownloadLimit(); 46 47 /** Returns the path that fastboot should use as temporary folder. */ getFastbootTmpDir()48 File getFastbootTmpDir(); 49 50 /** Returns whether or not fastbootd mode support is enabled. */ isFastbootdEnable()51 boolean isFastbootdEnable(); 52 53 /** Returns the path used for storing downloaded artifacts. */ getDownloadCacheDir()54 File getDownloadCacheDir(); 55 56 /** Check if it should use the SingleSignOn client or not. */ shouldUseSsoClient()57 Boolean shouldUseSsoClient(); 58 59 /** Returns a Map of service account json key files. */ getServiceAccountJsonKeyFiles()60 Map<String, File> getServiceAccountJsonKeyFiles(); 61 62 /** Validate that the options set on {@link IHostOptions} are valid. */ validateOptions()63 void validateOptions() throws ConfigurationException; 64 65 /** Get labels for the host. */ getLabels()66 public List<String> getLabels(); 67 68 /** Known tcp-device associated with a specific IP. */ getKnownTcpDeviceIpPool()69 Set<String> getKnownTcpDeviceIpPool(); 70 71 /** Known gce-device associated with a specific IP. */ getKnownGceDeviceIpPool()72 Set<String> getKnownGceDeviceIpPool(); 73 74 /** Check if it should use the zip64 format in partial download or not. */ getUseZip64InPartialDownload()75 boolean getUseZip64InPartialDownload(); 76 } 77