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 * Get the local device image zip file. 39 */ getDeviceImageFile()40 public File getDeviceImageFile(); 41 42 /** 43 * Get the local device image zip version. 44 */ getDeviceImageVersion()45 public String getDeviceImageVersion(); 46 47 /** 48 * Set the device system image file to use. 49 * 50 * @param deviceImageFile 51 */ setDeviceImageFile(File deviceImageFile, String version)52 public void setDeviceImageFile(File deviceImageFile, String version); 53 54 /** 55 * Get the local test userdata image file. 56 */ getUserDataImageFile()57 public File getUserDataImageFile(); 58 59 /** 60 * Get the local test userdata image version. 61 */ getUserDataImageVersion()62 public String getUserDataImageVersion(); 63 64 /** 65 * Set the user data image file to use. 66 * 67 * @param userDataFile 68 */ setUserDataImageFile(File userDataFile, String version)69 public void setUserDataImageFile(File userDataFile, String version); 70 71 /** 72 * Get the local path to the extracted tests.zip file contents. 73 */ getTestsDir()74 public File getTestsDir(); 75 76 /** 77 * Get the extracted tests.zip version. 78 */ getTestsDirVersion()79 public String getTestsDirVersion(); 80 81 /** 82 * Returns the dir containing some of the downloaded resources. (Resources are usually 83 * associated with a isFake=true device definition). Returns null if no resource dir available. 84 */ getResourcesDir()85 public default File getResourcesDir() { 86 return null; 87 } 88 89 /** 90 * Sets the resources directory {@link File}. 91 * 92 * @param resourcesDir The directory containing the shared resources. 93 * @param version The version of the directory file. 94 */ setResourcesDir(File resourcesDir, String version)95 public default void setResourcesDir(File resourcesDir, String version) {} 96 97 /** 98 * Set local path to the extracted tests.zip file contents. 99 * 100 * @param testsZipFile 101 */ setTestsDir(File testsZipFile, String version)102 public void setTestsDir(File testsZipFile, String version); 103 104 /** 105 * Get the local baseband image file. 106 */ getBasebandImageFile()107 public File getBasebandImageFile(); 108 109 /** 110 * Get the baseband version. 111 */ getBasebandVersion()112 public String getBasebandVersion(); 113 114 /** 115 * Set the baseband image for the device build. 116 * 117 * @param basebandFile the baseband image {@link File} 118 * @param version the version of the baseband 119 */ setBasebandImage(File basebandFile, String version)120 public void setBasebandImage(File basebandFile, String version); 121 122 /** 123 * Get the local bootloader image file. 124 */ getBootloaderImageFile()125 public File getBootloaderImageFile(); 126 127 /** 128 * Get the bootloader version. 129 */ getBootloaderVersion()130 public String getBootloaderVersion(); 131 132 /** 133 * Set the bootloader image for the device build. 134 * 135 * @param bootloaderImgFile the bootloader image {@link File} 136 * @param version the version of the bootloader 137 */ setBootloaderImageFile(File bootloaderImgFile, String version)138 public void setBootloaderImageFile(File bootloaderImgFile, String version); 139 140 /** 141 * Get the device OTA package zip file. 142 */ getOtaPackageFile()143 public File getOtaPackageFile(); 144 145 /** 146 * Get the device OTA package zip version. 147 */ getOtaPackageVersion()148 public String getOtaPackageVersion(); 149 150 /** 151 * Set the device OTA package zip file. 152 */ setOtaPackageFile(File otaFile, String version)153 public void setOtaPackageFile(File otaFile, String version); 154 155 /** 156 * Gets the mkbootimg file used to create the kernel image. 157 */ getMkbootimgFile()158 public File getMkbootimgFile(); 159 160 /** 161 * Gets the mkbootimg version. 162 */ getMkbootimgVersion()163 public String getMkbootimgVersion(); 164 165 /** 166 * Sets the mkbootimg file used to create the kernel image. 167 */ setMkbootimgFile(File mkbootimg, String version)168 public void setMkbootimgFile(File mkbootimg, String version); 169 170 /** 171 * Gets the ramdisk file used to create the kernel image. 172 */ getRamdiskFile()173 public File getRamdiskFile(); 174 175 /** 176 * Gets the ramdisk version. 177 */ getRamdiskVersion()178 public String getRamdiskVersion(); 179 180 /** 181 * Gets the ramdisk file used to create the kernel image. 182 */ setRamdiskFile(File ramdisk, String version)183 public void setRamdiskFile(File ramdisk, String version); 184 185 /** 186 * Removes all temporary files. 187 */ 188 @Override cleanUp()189 public void cleanUp(); 190 191 } 192