Added in API level 37

FileOperationResult


class FileOperationResult : Parcelable
kotlin.Any
   ↳ android.os.storage.operations.FileOperationResult

Represents the result of a file operation.

Summary

Constants
static Int

The system is too busy to handle the request.

static Int

The operation failed because the disk is full.

static Int

The system cannot fulfill the request as configured.

static Int

Successful operation.

static Int

The operation failed due to missing permissions.

static Int

An unknown error.

static Int

The source of the operation is unsupported or invalid.

static Int

The target of the operation is unsupported or invalid.

static Int

The operation failed.

static Int

The operation finished successfully.

static Int

The operation is currently running.

static Int

The operation is queued and waiting to start.

static Int

Unknown status.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Int

Returns the error code if the operation failed.

String?

Returns the error message if the operation failed.

MutableList<String!>

Returns the list of failures.

String

Returns the unique ID of the request.

OperationSource

Returns the OperationSource that was configured in the original FileOperationRequest.

Int

Returns the current status of the operation.

OperationTarget?

Returns the target of the file operation.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<FileOperationResult!>

Constants

ERROR_BUSY

Added in API level 37
static val ERROR_BUSY: Int

The system is too busy to handle the request.

This error is transient. Applications should consider retrying the operation after a short delay, potentially using an exponential backoff strategy.

Value: 1

ERROR_DISK_FULL

Added in API level 37
static val ERROR_DISK_FULL: Int

The operation failed because the disk is full.

This error is potentially transient if the user clears enough space on the storage device.

Value: 6

ERROR_INVALID_REQUEST

Added in API level 37
static val ERROR_INVALID_REQUEST: Int

The system cannot fulfill the request as configured.

This error is permanent as it indicates a malformed or invalid request.

Value: 2

ERROR_NONE

Added in API level 37
static val ERROR_NONE: Int

Successful operation.

Value: -1

ERROR_PERMISSION_DENIED

Added in API level 37
static val ERROR_PERMISSION_DENIED: Int

The operation failed due to missing permissions.

This error is permanent unless the user manually grants the required permissions.

Value: 5

ERROR_UNKNOWN

Added in API level 37
static val ERROR_UNKNOWN: Int

An unknown error.

Value: 0

ERROR_UNSUPPORTED_SOURCE

Added in API level 37
static val ERROR_UNSUPPORTED_SOURCE: Int

The source of the operation is unsupported or invalid.

This error is permanent as it indicates an issue with the request.

Value: 3

ERROR_UNSUPPORTED_TARGET

Added in API level 37
static val ERROR_UNSUPPORTED_TARGET: Int

The target of the operation is unsupported or invalid.

This error is permanent as it indicates an issue with the request.

Value: 4

STATUS_FAILED

Added in API level 37
static val STATUS_FAILED: Int

The operation failed.

Value: 4

STATUS_FINISHED

Added in API level 37
static val STATUS_FINISHED: Int

The operation finished successfully.

Value: 3

STATUS_IN_PROGRESS

Added in API level 37
static val STATUS_IN_PROGRESS: Int

The operation is currently running.

Value: 2

STATUS_QUEUED

Added in API level 37
static val STATUS_QUEUED: Int

The operation is queued and waiting to start.

Value: 1

STATUS_UNKNOWN

Added in API level 37
static val STATUS_UNKNOWN: Int

Unknown status.

Value: 0

Public methods

describeContents

Added in API level 37
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getErrorCode

Added in API level 37
fun getErrorCode(): Int

Returns the error code if the operation failed.

Return
Int Value is one of the following:

getErrorMessage

Added in API level 37
fun getErrorMessage(): String?

Returns the error message if the operation failed.

Return
String? This value may be null.

getFailedPaths

Added in API level 37
fun getFailedPaths(): MutableList<String!>

Returns the list of failures.

This list is only populated when the operation reaches a terminal state (STATUS_FINISHED or STATUS_FAILED).

Note: Due to binder transaction limits, this list can truncate the total number of reported failures. If failures occurred, only the first android.os.storage.FileManager#getMaxReportedFailures are reported.

Return
MutableList<String!> This value cannot be null.

getRequestId

Added in API level 37
fun getRequestId(): String

Returns the unique ID of the request.

Return
String This value cannot be null.

getSource

Added in API level 37
fun getSource(): OperationSource

Returns the OperationSource that was configured in the original FileOperationRequest.

For example, if an operation was created using a AppDataFileSource that object would be returned here.

Return
OperationSource This value cannot be null.

getStatus

Added in API level 37
fun getStatus(): Int

Returns the current status of the operation.

Return
Int Value is one of the following:

getTarget

Added in API level 37
fun getTarget(): OperationTarget?

Returns the target of the file operation.

Return
OperationTarget? This value may be null.

writeToParcel

Added in API level 37
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 37
static val CREATOR: Parcelable.Creator<FileOperationResult!>