Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
         
       
     
  
  
  
  
  
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  
StreamProtoReceiver
  public
  
  
  
  class
  StreamProtoReceiver
  
    extends Object
  
  
  
  
  
  
  
    
    | java.lang.Object | 
  
  
    
      | ↳ | com.android.tradefed.result.proto.StreamProtoReceiver | 
  
  
    
  A receiver that translates proto TestRecord received into Tradefed events.
Summary
| Fields | 
|---|
  
    | 
    protected
    
    
    AtomicBoolean | mStopParsingStop parsing events when this is set.
      
    
 | 
  
| Public constructors | 
|---|
  
  
  
    | 
      StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation)
      Ctor.
        
    
 | 
  
  
  
  
    | 
      StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing)
      Ctor.
        
    
 | 
  
  
  
  
    | 
      StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, boolean reportLogs, String logNamePrefix)
       | 
  
  
  
  
    | 
      StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, boolean reportLogs, String logNamePrefix, boolean mergeInvocationMetrics)
      Ctor.
        
    
 | 
  
  
  
  
    | 
      StreamProtoReceiver(ITestInvocationListener listener, IInvocationContext mainContext, boolean reportInvocation, boolean quietParsing, String logNamePrefix)
      Ctor.
        
    
 | 
  
Fields
    mStopParsing
    
      
  
      
  
    
protected AtomicBoolean mStopParsing
    
    
    
  Stop parsing events when this is set. This allows to avoid a thread parsing the events when
 we don't expect them anymore.
    
 
Public constructors
    StreamProtoReceiver
    
public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation)
    
    
    
  Ctor.
    
    | Parameters | 
|---|
      
        | listener | ITestInvocationListener: theITestInvocationListenerwhere to report the results. | 
      
        | mainContext | IInvocationContext | 
      
        | reportInvocation | boolean: Whether or not to report the invocation level events. | 
    
      
  
 
    StreamProtoReceiver
    
public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing)
    
    
    
  Ctor.
    
    | Parameters | 
|---|
      
        | listener | ITestInvocationListener: theITestInvocationListenerwhere to report the results. | 
      
        | mainContext | IInvocationContext | 
      
        | reportInvocation | boolean: Whether or not to report the invocation level events. | 
      
        | quietParsing | boolean: Whether or not to let the parser log debug information. | 
    
      
  
 
    StreamProtoReceiver
    
public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                boolean reportLogs, 
                String logNamePrefix)
    
    
    
  
    
    | Parameters | 
|---|
      
        | listener | ITestInvocationListener | 
      
        | mainContext | IInvocationContext | 
      
        | reportInvocation | boolean | 
      
        | quietParsing | boolean | 
      
        | reportLogs | boolean | 
      
        | logNamePrefix | String | 
    
 
    StreamProtoReceiver
    
public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                boolean reportLogs, 
                String logNamePrefix, 
                boolean mergeInvocationMetrics)
    
    
    
  Ctor.
    
    | Parameters | 
|---|
      
        | listener | ITestInvocationListener: theITestInvocationListenerwhere to report the results. | 
      
        | mainContext | IInvocationContext | 
      
        | reportInvocation | boolean: Whether or not to report the invocation level events. | 
      
        | quietParsing | boolean: Whether or not to let the parser log debug information. | 
      
        | reportLogs | boolean: Whether or not to report the logs | 
      
        | logNamePrefix | String: The prefix for file logged through the parser. | 
      
        | mergeInvocationMetrics | boolean | 
    
      
  
 
    StreamProtoReceiver
    
public StreamProtoReceiver (ITestInvocationListener listener, 
                IInvocationContext mainContext, 
                boolean reportInvocation, 
                boolean quietParsing, 
                String logNamePrefix)
    
    
    
  Ctor.
    
    | Parameters | 
|---|
      
        | listener | ITestInvocationListener: theITestInvocationListenerwhere to report the results. | 
      
        | mainContext | IInvocationContext | 
      
        | reportInvocation | boolean: Whether or not to report the invocation level events. | 
      
        | quietParsing | boolean: Whether or not to let the parser log debug information. | 
      
        | logNamePrefix | String: The prefix for file logged through the parser. | 
    
      
  
 
Public methods
    close
    
public void close ()
    
    
    
  
 
    completeModuleEvents
    
public void completeModuleEvents ()
    
    
    
  If needed to ensure consistent reporting, complete the events of the module.
 
    getError
    
public Throwable getError ()
    
    
    
  Returns the error caugh in the receiver thread. If none it will return null.
    
 
    getSocketServerPort
    
public int getSocketServerPort ()
    
    
    
  Returns the socket receiver that was open. -1 if none.
    
 
    hasInvocationFailed
    
public boolean hasInvocationFailed ()
    
    
    
  Returns whether or not the invocation failed has been reported.
    
 
    joinReceiver
    
public boolean joinReceiver (long millis)
    
    
    
  
    
    
 
Protected methods
    getJoinTimeout
    
protected long getJoinTimeout (long millis)
    
    
    
  
    
    
 
 
 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  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-12-09 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-09 UTC."],[],[]]