BugreportCallback
abstract class BugreportCallback
kotlin.Any | |
↳ | android.os.BugreportManager.BugreportCallback |
An interface describing the callback for bugreport progress and status.
Callers will receive onProgress
calls as the bugreport progresses, followed by a terminal call to either onFinished
oder onError
.
If an issue is encountered while starting the bugreport asynchronously, callers will receive an onError
call without any onProgress
callbacks.
Summary
Constants | |
---|---|
static Int |
There is currently a bugreport running. |
static Int |
The input options were invalid. |
static Int |
There is no bugreport to retrieve for the caller. |
static Int |
A runtime error occurred. |
static Int |
The request to get user consent timed out. |
static Int |
User denied consent to share the bugreport. |
Public constructors | |
---|---|
Public methods | |
---|---|
open Unit |
Called when it is ready for calling app to show UI, showing any extra UI before this callback can interfere with bugreport generation. |
open Unit |
Called when taking bugreport resulted in an error. |
open Unit |
Called when taking bugreport finishes successfully. |
open Unit |
onProgress(progress: Float) Called when there is a progress update. |
Constants
BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS
static val BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS: Int
There is currently a bugreport running. The caller should try again later.
Value: 5
BUGREPORT_ERROR_INVALID_INPUT
static val BUGREPORT_ERROR_INVALID_INPUT: Int
The input options were invalid. For example, the destination file the app provided could not be written by the system.
Value: 1
BUGREPORT_ERROR_NO_BUGREPORT_TO_RETRIEVE
static val BUGREPORT_ERROR_NO_BUGREPORT_TO_RETRIEVE: Int
There is no bugreport to retrieve for the caller.
Value: 6
BUGREPORT_ERROR_RUNTIME
static val BUGREPORT_ERROR_RUNTIME: Int
A runtime error occurred.
Value: 2
BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT
static val BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT: Int
The request to get user consent timed out.
Value: 4
BUGREPORT_ERROR_USER_DENIED_CONSENT
static val BUGREPORT_ERROR_USER_DENIED_CONSENT: Int
User denied consent to share the bugreport.
Value: 3
Public constructors
BugreportCallback
BugreportCallback()
Public methods
onEarlyReportFinished
open fun onEarlyReportFinished(): Unit
Called when it is ready for calling app to show UI, showing any extra UI before this callback can interfere with bugreport generation.
onError
open fun onError(errorCode: Int): Unit
Called when taking bugreport resulted in an error.
If BUGREPORT_ERROR_USER_DENIED_CONSENT
is passed, then the user did not consent to sharing the bugreport with the calling app.
If BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT
is passed, then the consent timed out, but the bugreport could be available in the internal directory of dumpstate for manual retrieval.
If BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS
is passed, then the caller should try later, as only one bugreport can be in progress at a time.
onFinished
open fun onFinished(): Unit
Called when taking bugreport finishes successfully.
This callback will be invoked if the BugreportParams#BUGREPORT_FLAG_DEFER_CONSENT
flag is not set.
onProgress
open fun onProgress(progress: Float): Unit
Called when there is a progress update.
Parameters | |
---|---|
progress |
Float: the progress in [0.0, 100.0] Value is between 0f and 100f inclusive |