Package org.robolectric.shadows
Class ShadowBugreportManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowBugreportManager
-
@Implements(value=android.os.BugreportManager.class, minSdk=29, isInAndroidSdk=false) public class ShadowBugreportManager extends Object
Implementation ofBugreportManager.This class is not available in the public Android SDK, but it is available for system apps.
-
-
Constructor Summary
Constructors Constructor Description ShadowBugreportManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcancelBugreport()Cancels bugreport in progress and executesBugreportManager.BugreportCallback.onError(int).voidexecuteOnError(int errorCode)ExecutesBugreportManager.BugreportCallback.onError(int)on the provided Executor.voidexecuteOnFinished()ExecutesBugreportManager.BugreportCallback.onFinished()on the provided Executor.voidexecuteOnProgress(float progress)ExecutesBugreportManager.BugreportCallback.onProgress(float)on the provided Executor.booleanisBugreportInProgress()protected voidrequestBugreport(BugreportParams params, CharSequence shareTitle, CharSequence shareDescription)Normally requests the platform/system to take a bugreport and make the final bugreport available to the user.voidsetHasPermission(boolean hasPermission)Simulates if the calling process has the required permissions to call BugreportManager methods.protected voidstartBugreport(ParcelFileDescriptor bugreportFd, ParcelFileDescriptor screenshotFd, BugreportParams params, Executor executor, BugreportManager.BugreportCallback callback)Starts a bugreport with which can execute callback methods on the provided executor.booleanwasBugreportRequested()Returns true ifrequestBugreport(android.os.BugreportParams, java.lang.CharSequence, java.lang.CharSequence)was called.
-
-
-
Method Detail
-
startBugreport
@Implementation protected void startBugreport(ParcelFileDescriptor bugreportFd, ParcelFileDescriptor screenshotFd, BugreportParams params, Executor executor, BugreportManager.BugreportCallback callback)
Starts a bugreport with which can execute callback methods on the provided executor.If bugreport already in progress,
BugreportManager.BugreportCallback.onError(int)will be executed.
-
requestBugreport
@Implementation(minSdk=30) protected void requestBugreport(BugreportParams params, CharSequence shareTitle, CharSequence shareDescription)
Normally requests the platform/system to take a bugreport and make the final bugreport available to the user.This implementation just sets a boolean recording that the method was invoked.
-
cancelBugreport
@Implementation protected void cancelBugreport()
Cancels bugreport in progress and executesBugreportManager.BugreportCallback.onError(int).
-
executeOnProgress
public void executeOnProgress(float progress)
ExecutesBugreportManager.BugreportCallback.onProgress(float)on the provided Executor.
-
executeOnError
public void executeOnError(int errorCode)
ExecutesBugreportManager.BugreportCallback.onError(int)on the provided Executor.
-
executeOnFinished
public void executeOnFinished()
ExecutesBugreportManager.BugreportCallback.onFinished()on the provided Executor.
-
isBugreportInProgress
public boolean isBugreportInProgress()
-
wasBugreportRequested
public boolean wasBugreportRequested()
Returns true ifrequestBugreport(android.os.BugreportParams, java.lang.CharSequence, java.lang.CharSequence)was called.
-
setHasPermission
public void setHasPermission(boolean hasPermission)
Simulates if the calling process has the required permissions to call BugreportManager methods.If
hasPermissionis false,startBugreport(android.os.ParcelFileDescriptor, android.os.ParcelFileDescriptor, android.os.BugreportParams, java.util.concurrent.Executor, android.os.BugreportManager.BugreportCallback)andcancelBugreport()will throwSecurityException.
-
-