InstallReceiver
public
class
InstallReceiver
extends MultiLineReceiver
| java.lang.Object | ||
| ↳ | com.android.ddmlib.MultiLineReceiver | |
| ↳ | com.android.ddmlib.InstallReceiver | |
Output receiver for "pm install package.apk" command line.
Use a combination of isSuccessfullyCompleted() and getErrorMessage() to
decide if the installation was successful and what was the error.
Summary
Public constructors | |
|---|---|
InstallReceiver()
|
|
Public methods | |
|---|---|
void
|
done()
Terminates the process. |
String
|
getErrorCode()
|
String
|
getErrorMessage()
Returns the error message from the installation. |
String
|
getSuccessMessage()
Returns the success message from the installation. |
boolean
|
isCancelled()
|
boolean
|
isSuccessfullyCompleted()
Returns true if the installation was fully successful. |
void
|
processNewLines(String[] lines)
Called when new lines are being received by the remote process. |
Public constructors
InstallReceiver
public InstallReceiver ()
Public methods
done
public void done ()
Terminates the process. This is called after the last lines have been through processNewLines(String[]).
getErrorCode
public String getErrorCode ()
| Returns | |
|---|---|
String |
The ERROR_CODE part of a message like: "Failure [ERROR_CODE: description]" |
getErrorMessage
public String getErrorMessage ()
Returns the error message from the installation. Returns null if it was successful or if a timeout occurred.
| Returns | |
|---|---|
String |
|
getSuccessMessage
public String getSuccessMessage ()
Returns the success message from the installation. Returns null if failure is seen.
| Returns | |
|---|---|
String |
|
isCancelled
public boolean isCancelled ()
| Returns | |
|---|---|
boolean |
|
isSuccessfullyCompleted
public boolean isSuccessfullyCompleted ()
Returns true if the installation was fully successful. If getErrorMessage() returns
null and isSuccessfullyCompleted() returns false, a timeout on device side was most
likely encountered.
| Returns | |
|---|---|
boolean |
|
processNewLines
public void processNewLines (String[] lines)
Called when new lines are being received by the remote process.
It is guaranteed that the lines are complete when they are given to this method.
| Parameters | |
|---|---|
lines |
String: The array containing the new lines. |