DataShareWriteAdapter
interface DataShareWriteAdapter
android.view.contentcapture.DataShareWriteAdapter |
Adapter class used by apps to share data with the Content Capture service.
Summary
Public methods | |
---|---|
open Unit |
Method invoked when an error occurred, for example sessions has not been started or terminated unsuccessfully. |
abstract Unit |
Data share sessions has been rejected by the Content Capture service. |
abstract Unit |
Method invoked when the data share session has been started and the app needs to start writing into the file used for sharing. |
Public methods
onError
open fun onError(: Int): Unit
Method invoked when an error occurred, for example sessions has not been started or terminated unsuccessfully.
Parameters | |
---|---|
errorCode |
Int: the error code corresponding to an ERROR_* value. Value is android.view.contentcapture.ContentCaptureManager#DATA_SHARE_ERROR_UNKNOWN , android.view.contentcapture.ContentCaptureManager#DATA_SHARE_ERROR_CONCURRENT_REQUEST , or android.view.contentcapture.ContentCaptureManager#DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED |
onRejected
abstract fun onRejected(): Unit
Data share sessions has been rejected by the Content Capture service.
onWrite
abstract fun onWrite(: ParcelFileDescriptor): Unit
Method invoked when the data share session has been started and the app needs to start writing into the file used for sharing.
App needs to handle explicitly cases when the file descriptor is closed and handle gracefully if IOExceptions happen.
Parameters | |
---|---|
destination |
ParcelFileDescriptor: file descriptor used to write data into. This value cannot be null . |