1 /* 2 * Copyright (C) 2010 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.build; 18 19 import java.io.File; 20 21 /** 22 * A {@link IBuildInfo} that represents a complete Android device build and (optionally) its tests. 23 */ 24 public interface IDeviceBuildInfo extends IBuildInfo { 25 26 /** 27 * Returns the unique identifier of platform build under test. Should never be null. Defaults to 28 * {@link #UNKNOWN_BUILD_ID}. 29 */ getDeviceBuildId()30 public String getDeviceBuildId(); 31 32 /** 33 * Optional method to return the type of the platform build being tested. 34 */ getDeviceBuildFlavor()35 public String getDeviceBuildFlavor(); 36 37 /** 38 * Set the build-flavor for the device part of the build info if different from {@link 39 * #setBuildFlavor(String)}. 40 * 41 * @param deviceBuildFlavor Flavor of the device build 42 */ setDeviceBuildFlavor(String deviceBuildFlavor)43 public default void setDeviceBuildFlavor(String deviceBuildFlavor) {} 44 45 /** 46 * Get the local device image zip file. 47 */ getDeviceImageFile()48 public File getDeviceImageFile(); 49 50 /** 51 * Get the local device image zip version. 52 */ getDeviceImageVersion()53 public String getDeviceImageVersion(); 54 55 /** 56 * Set the device system image file to use. 57 * 58 * @param deviceImageFile 59 */ setDeviceImageFile(File deviceImageFile, String version)60 public void setDeviceImageFile(File deviceImageFile, String version); 61 62 /** 63 * Get the local test userdata image file. 64 */ getUserDataImageFile()65 public File getUserDataImageFile(); 66 67 /** 68 * Get the local test userdata image version. 69 */ getUserDataImageVersion()70 public String getUserDataImageVersion(); 71 72 /** 73 * Set the user data image file to use. 74 * 75 * @param userDataFile 76 */ setUserDataImageFile(File userDataFile, String version)77 public void setUserDataImageFile(File userDataFile, String version); 78 79 /** 80 * Get the local path to the extracted tests.zip file contents. 81 */ getTestsDir()82 public File getTestsDir(); 83 84 /** 85 * Get the extracted tests.zip version. 86 */ getTestsDirVersion()87 public String getTestsDirVersion(); 88 89 /** 90 * Returns the dir containing some of the downloaded resources. (Resources are usually 91 * associated with a isFake=true device definition). Returns null if no resource dir available. 92 */ getResourcesDir()93 public default File getResourcesDir() { 94 return null; 95 } 96 97 /** 98 * Sets the resources directory {@link File}. 99 * 100 * @param resourcesDir The directory containing the shared resources. 101 * @param version The version of the directory file. 102 */ setResourcesDir(File resourcesDir, String version)103 public default void setResourcesDir(File resourcesDir, String version) {} 104 105 /** 106 * Set local path to the extracted tests.zip file contents. 107 * 108 * @param testsZipFile 109 */ setTestsDir(File testsZipFile, String version)110 public void setTestsDir(File testsZipFile, String version); 111 112 /** 113 * Get the local baseband image file. 114 */ getBasebandImageFile()115 public File getBasebandImageFile(); 116 117 /** 118 * Get the baseband version. 119 */ getBasebandVersion()120 public String getBasebandVersion(); 121 122 /** 123 * Set the baseband image for the device build. 124 * 125 * @param basebandFile the baseband image {@link File} 126 * @param version the version of the baseband 127 */ setBasebandImage(File basebandFile, String version)128 public void setBasebandImage(File basebandFile, String version); 129 130 /** 131 * Get the local bootloader image file. 132 */ getBootloaderImageFile()133 public File getBootloaderImageFile(); 134 135 /** 136 * Get the bootloader version. 137 */ getBootloaderVersion()138 public String getBootloaderVersion(); 139 140 /** 141 * Set the bootloader image for the device build. 142 * 143 * @param bootloaderImgFile the bootloader image {@link File} 144 * @param version the version of the bootloader 145 */ setBootloaderImageFile(File bootloaderImgFile, String version)146 public void setBootloaderImageFile(File bootloaderImgFile, String version); 147 148 /** 149 * Get the device OTA package zip file. 150 */ getOtaPackageFile()151 public File getOtaPackageFile(); 152 153 /** 154 * Get the device OTA package zip version. 155 */ getOtaPackageVersion()156 public String getOtaPackageVersion(); 157 158 /** 159 * Set the device OTA package zip file. 160 */ setOtaPackageFile(File otaFile, String version)161 public void setOtaPackageFile(File otaFile, String version); 162 163 /** 164 * Gets the mkbootimg file used to create the kernel image. 165 */ getMkbootimgFile()166 public File getMkbootimgFile(); 167 168 /** 169 * Gets the mkbootimg version. 170 */ getMkbootimgVersion()171 public String getMkbootimgVersion(); 172 173 /** 174 * Sets the mkbootimg file used to create the kernel image. 175 */ setMkbootimgFile(File mkbootimg, String version)176 public void setMkbootimgFile(File mkbootimg, String version); 177 178 /** 179 * Gets the ramdisk file used to create the kernel image. 180 */ getRamdiskFile()181 public File getRamdiskFile(); 182 183 /** 184 * Gets the ramdisk version. 185 */ getRamdiskVersion()186 public String getRamdiskVersion(); 187 188 /** 189 * Gets the ramdisk file used to create the kernel image. 190 */ setRamdiskFile(File ramdisk, String version)191 public void setRamdiskFile(File ramdisk, String version); 192 193 /** 194 * Removes all temporary files. 195 */ 196 @Override cleanUp()197 public void cleanUp(); 198 199 } 200