FlashingResourcesParser
  public
  
  
  
  class
  FlashingResourcesParser
  
    extends Object
  
  
  
  
  
      implements
      
        IFlashingResourcesParser
      
  
  
| java.lang.Object | |
| ↳ | com.android.tradefed.targetprep.FlashingResourcesParser | 
A class that parses out required versions of auxiliary image files needed to flash a device. (e.g. bootloader, baseband, etc)
Summary
| Nested classes | |
|---|---|
| 
        
        
        
        
        class | FlashingResourcesParser.AndroidInfoA typedef for  | 
| 
        
        
        
        
        interface | FlashingResourcesParser.ConstraintA filtering interface, intended to allow  | 
| Fields | |
|---|---|
| 
    public
    static
    final
    String | BASEBAND_VERSION_KEY
 | 
| 
    public
    static
    final
    String | BOARD_KEY
 | 
| 
    public
    static
    final
    String | BOOTLOADER_VERSION_KEY
 | 
| 
    public
    static
    final
    String | PRODUCT_KEY
 | 
| Public constructors | |
|---|---|
| 
      FlashingResourcesParser(BufferedReader infoReader)
      Constructs a FlashingResourcesParser with the supplied AndroidInfo ReaderExposed for unit testing | |
| 
      FlashingResourcesParser(BufferedReader infoReader, Constructs a FlashingResourcesParser with the supplied AndroidInfo ReaderExposed for unit testing | |
| 
      FlashingResourcesParser(File deviceImgZipFile)
      Create a  | |
| 
      FlashingResourcesParser(File deviceImgZipFile, Create a  | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        String | 
      getRequiredBasebandVersion()
      Gets the required baseband version specified in the device image zip.If multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically. | 
| 
        
        
        
        
        
         | 
      getRequiredBoards()
      Gets the required board type(s) specified in the device image zip. | 
| 
        
        
        
        
        
        String | 
      getRequiredBootloaderVersion()
      Gets the required bootloader version specified in the device image zip.If multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically. | 
| 
        
        
        
        
        
        String | 
      getRequiredImageVersion(String imageVersionKey)
      Gets the required custom image version specified in the device image zipIf multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically. | 
| 
        
        
        
        
        
        String | 
      getRequiredImageVersion(String imageVersionKey, String productName)
      Gets the required custom image version specified in the device image zip.If multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically. | 
Fields
BASEBAND_VERSION_KEY
public static final String BASEBAND_VERSION_KEY
BOARD_KEY
public static final String BOARD_KEY
BOOTLOADER_VERSION_KEY
public static final String BOOTLOADER_VERSION_KEY
PRODUCT_KEY
public static final String PRODUCT_KEY
Public constructors
FlashingResourcesParser
public FlashingResourcesParser (BufferedReader infoReader)
Constructs a FlashingResourcesParser with the supplied AndroidInfo Reader
Exposed for unit testing| Parameters | |
|---|---|
| infoReader | BufferedReader: aERROR(/BufferedReader)containing the equivalent of android-info.txt to
        parse | 
FlashingResourcesParser
public FlashingResourcesParser (BufferedReader infoReader, 
                 c) Constructs a FlashingResourcesParser with the supplied AndroidInfo Reader
Exposed for unit testing| Parameters | |
|---|---|
| infoReader | BufferedReader: aERROR(/BufferedReader)containing the equivalent of android-info.txt to
        parse | 
| c | : A map from key name toConstraint.  Image names will be checked against
        the appropriate constraint (if any) as a prereq for being added.  May be null to
        disable filtering. | 
FlashingResourcesParser
public FlashingResourcesParser (File deviceImgZipFile)
Create a FlashingResourcesParser and have it parse the specified device image for
 flashing requirements.
| Parameters | |
|---|---|
| deviceImgZipFile | File: Theupdater.zipfile to be flashed | 
| Throws | |
|---|---|
| TargetSetupError | |
FlashingResourcesParser
public FlashingResourcesParser (File deviceImgZipFile, 
                 c) Create a FlashingResourcesParser and have it parse the specified device image for
 flashing requirements.  Flashing requirements must pass the appropriate constraint (if one
 exists) before being added.  Rejected requirements will be dropped silently.
| Parameters | |
|---|---|
| deviceImgZipFile | File: Theupdater.zipfile to be flashed | 
| c | : A map from key name toConstraint.  Image names will be checked against
        the appropriate constraint (if any) as a prereq for being added.  May be null to
        disable filtering. | 
| Throws | |
|---|---|
| TargetSetupError | |
Public methods
getRequiredBasebandVersion
public String getRequiredBasebandVersion ()
Gets the required baseband version specified in the device image zip.
If multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically.| Returns | |
|---|---|
| String | the baseband version or nullif not specified | 
getRequiredBoards
publicgetRequiredBoards () 
Gets the required board type(s) specified in the device image zip.
| Returns | |
|---|---|
|  | the board types or nullif not specified | 
getRequiredBootloaderVersion
public String getRequiredBootloaderVersion ()
Gets the required bootloader version specified in the device image zip.
If multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically.| Returns | |
|---|---|
| String | the bootloader version or nullif not specified | 
getRequiredImageVersion
public String getRequiredImageVersion (String imageVersionKey)
Gets the required custom image version specified in the device image zip
If multiple versions are listed, get the latest with the assumption that versions sort from oldest to newest alphabetically.| Parameters | |
|---|---|
| imageVersionKey | String: the expected identifier of the image's version information | 
| Returns | |
|---|---|
| String | the required version for given image or nullif not specified | 
getRequiredImageVersion
public String getRequiredImageVersion (String imageVersionKey, 
                String productName)Gets the required custom image version specified in the device image zip.  If
 productName is non-null, this method will check for (and return if present)
 image requirements specified for that particular product.  If no product-specific requirement
 exists, it will fall back to returning the global requirement, or null if no
 requirement of any sort exists for that particular versionKey.
 
| Parameters | |
|---|---|
| imageVersionKey | String: the expected identifier of the image's version information | 
| productName | String: A specific product name to check | 
| Returns | |
|---|---|
| String | the required version for given image or nullif not specified | 
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-10-08 UTC.
