Builder
class Builder
kotlin.Any | |
↳ | android.telephony.mbms.DownloadRequest.Builder |
Summary
Public constructors | |
---|---|
Builds a new DownloadRequest. |
Public methods | |
---|---|
open DownloadRequest! |
build() |
open static DownloadRequest.Builder! |
fromDownloadRequest(other: DownloadRequest!) Constructs a |
open static DownloadRequest.Builder! |
fromSerializedRequest(data: ByteArray!) This method constructs a new instance of |
open DownloadRequest.Builder! |
setAppIntent(intent: Intent!) Set the |
open DownloadRequest.Builder! |
setServiceInfo(serviceInfo: FileServiceInfo!) Sets the service from which the download request to be built will download from. |
open DownloadRequest.Builder! |
setSubscriptionId(subscriptionId: Int) Set the subscription ID on which the file(s) should be downloaded. |
Public constructors
Builder
Builder(
sourceUri: Uri,
destinationUri: Uri)
Builds a new DownloadRequest.
Parameters | |
---|---|
sourceUri |
Uri: the source URI for the DownloadRequest to be built. This URI should never be null. |
destinationUri |
Uri: The final location for the file(s) that are to be downloaded. It must be on the same filesystem as the temp file directory set via android.telephony.MbmsDownloadSession#setTempFileRootDirectory(File) . The provided path must be a directory that exists. An IllegalArgumentException will be thrown otherwise. This value cannot be null . |
Public methods
fromDownloadRequest
open static fun fromDownloadRequest(other: DownloadRequest!): DownloadRequest.Builder!
Constructs a Builder
from a DownloadRequest
Parameters | |
---|---|
other |
DownloadRequest!: The DownloadRequest from which the data for the Builder should come. |
Return | |
---|---|
DownloadRequest.Builder! |
An instance of Builder pre-populated with data from the provided DownloadRequest . |
fromSerializedRequest
open static fun fromSerializedRequest(data: ByteArray!): DownloadRequest.Builder!
This method constructs a new instance of Builder
based on the serialized data passed in.
Parameters | |
---|---|
data |
ByteArray!: A byte array, the contents of which should have been originally obtained from DownloadRequest#toByteArray() . |
setAppIntent
open fun setAppIntent(intent: Intent!): DownloadRequest.Builder!
Set the Intent
that should be sent when the download completes or fails. This should be an intent with a explicit android.content.ComponentName
targeted to a android.content.BroadcastReceiver
in the app's package. The middleware should not use this method.
Parameters | |
---|---|
intent |
Intent!: |
setServiceInfo
open fun setServiceInfo(serviceInfo: FileServiceInfo!): DownloadRequest.Builder!
Sets the service from which the download request to be built will download from.
Parameters | |
---|---|
serviceInfo |
FileServiceInfo!: |
Return | |
---|---|
DownloadRequest.Builder! |
setSubscriptionId
open fun setSubscriptionId(subscriptionId: Int): DownloadRequest.Builder!
Set the subscription ID on which the file(s) should be downloaded.
Parameters | |
---|---|
subscriptionId |
Int: |