CompanionDeviceTracker
  public
  
  
  
  class
  CompanionDeviceTracker
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | com.android.tradefed.targetprep.companion.CompanionDeviceTracker | 
A class for allocating and freeing companion devices
Summary
| Public methods | |
|---|---|
| 
        
        
        
        
        
        ITestDevice | 
      allocateCompanionDevice(ITestDevice device, DeviceSelectionOptions opt)
      Allocate a companion device based on selection criteria. | 
| 
        
        
        
        
        
        void | 
      freeCompanionDevice(ITestDevice device)
      Free the companion device as identified by the primary device | 
| 
        
        
        
        
        
        ITestDevice | 
      getCompanionDevice(ITestDevice device)
      Retrieve the allocated companion device as identified by the primary device | 
| 
        
        
        static
        
        
        CompanionDeviceTracker | 
      getInstance()
      Retrieves singleton instance of the tracker | 
Public methods
allocateCompanionDevice
public ITestDevice allocateCompanionDevice (ITestDevice device, DeviceSelectionOptions opt)
Allocate a companion device based on selection criteria.
| Parameters | |
|---|---|
| device | ITestDevice: the primary device. used to identify the companion device | 
| opt | DeviceSelectionOptions: selection criteria | 
| Returns | |
|---|---|
| ITestDevice | the device allocated or nullif none available | 
freeCompanionDevice
public void freeCompanionDevice (ITestDevice device)
Free the companion device as identified by the primary device
| Parameters | |
|---|---|
| device | ITestDevice: the primary device whose corresponding companion device should be freed | 
| Throws | |
|---|---|
| IllegalStateException | if no companion devices | 
getCompanionDevice
public ITestDevice getCompanionDevice (ITestDevice device)
Retrieve the allocated companion device as identified by the primary device
| Parameters | |
|---|---|
| device | ITestDevice: the primary device that the companion device is allocated with | 
| Returns | |
|---|---|
| ITestDevice | the companion device or nullif not found | 
getInstance
public static CompanionDeviceTracker getInstance ()
Retrieves singleton instance of the tracker
| Returns | |
|---|---|
| CompanionDeviceTracker | |
