Added in API level 28

Builder

class Builder
kotlin.Any
   ↳ android.telephony.mbms.DownloadRequest.Builder

Summary

Public constructors
Builder(sourceUri: Uri, destinationUri: Uri)

Builds a new DownloadRequest.

Public methods
open DownloadRequest!

open static DownloadRequest.Builder!

Constructs a Builder from a DownloadRequest

open static DownloadRequest.Builder!

This method constructs a new instance of Builder based on the serialized data passed in.

open DownloadRequest.Builder!
setAppIntent(intent: Intent!)

Set the Intent that should be sent when the download completes or fails.

open DownloadRequest.Builder!

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

Added in API level 28
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

build

Added in API level 28
open fun build(): DownloadRequest!

fromDownloadRequest

Added in API level 28
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

Added in API level 28
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

Added in API level 28
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

Added in API level 28
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

Added in API level 28
open fun setSubscriptionId(subscriptionId: Int): DownloadRequest.Builder!

Set the subscription ID on which the file(s) should be downloaded.

Parameters
subscriptionId Int: