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.targetprep;
18 
19 import java.util.Collection;
20 
21 /**
22  * Interface for providing required versions of auxiliary image files needed to flash a
23  * device.
24  * (e.g. bootloader, baseband, etc)
25  */
26 public interface IFlashingResourcesParser {
27 
28     /**
29      * Gets the required bootloader version specified in the device image zip.
30      * @return the bootloader version or <code>null</code> if not specified
31      */
getRequiredBootloaderVersion()32     public String getRequiredBootloaderVersion();
33 
34     /**
35      * Gets the required baseband version specified in the device image zip.
36      * @return the baseband version or <code>null</code> if not specified
37      */
getRequiredBasebandVersion()38     public String getRequiredBasebandVersion();
39 
40     /**
41      * Gets the required custom image version specified in the device image zip
42      *
43      * @param versionKey the expected identifier of the image's version information
44      * @return the required version for given image or <code>null</code> if not specified
45      */
getRequiredImageVersion(String versionKey)46     public String getRequiredImageVersion(String versionKey);
47 
48     /**
49      * Gets the required custom image version specified in the device image zip.  If
50      * {@code productName} is non-{@code null}, this method will check for (and return if present)
51      * image requirements specified for that particular product.  If no product-specific requirement
52      * exists, it will fall back to returning the global requirement, or {@code null} if no
53      * requirement of any sort exists for that particular {@code versionKey}.
54      *
55      * @param versionKey the expected identifier of the image's version information
56      * @param productName A specific product name to check
57      * @return the required version for given image or <code>null</code> if not specified
58      */
getRequiredImageVersion(String versionKey, String productName)59     public String getRequiredImageVersion(String versionKey, String productName);
60 
61     /**
62      * Gets the required board type(s) specified in the device image zip.
63      * @return the board types or <code>null</code> if not specified
64      */
getRequiredBoards()65     public Collection<String> getRequiredBoards();
66 
67 }
68