DownloadRequest.Builder

public static class DownloadRequest.Builder
extends Object

java.lang.Object
   ↳ android.telephony.mbms.DownloadRequest.Builder


Summary

Public constructors

DownloadRequest.Builder(Uri sourceUri, Uri destinationUri)

Builds a new DownloadRequest.

Public methods

DownloadRequest build()
static DownloadRequest.Builder fromDownloadRequest(DownloadRequest other)

Constructs a DownloadRequest.Builder from a DownloadRequest

static DownloadRequest.Builder fromSerializedRequest(byte[] data)

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

DownloadRequest.Builder setAppIntent(Intent intent)

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

DownloadRequest.Builder setServiceInfo(FileServiceInfo serviceInfo)

Sets the service from which the download request to be built will download from.

DownloadRequest.Builder setSubscriptionId(int subscriptionId)

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

Inherited methods

Public constructors

DownloadRequest.Builder

DownloadRequest.Builder (Uri sourceUri, 
                Uri destinationUri)

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 setTempFileRootDirectory(File). The provided path must be a directory that exists. An IllegalArgumentException will be thrown otherwise.

This value must never be null.

Public methods

fromDownloadRequest

DownloadRequest.Builder fromDownloadRequest (DownloadRequest other)

Constructs a DownloadRequest.Builder from a DownloadRequest

Parameters
other DownloadRequest: The DownloadRequest from which the data for the DownloadRequest.Builder should come.

Returns
DownloadRequest.Builder An instance of DownloadRequest.Builder pre-populated with data from the provided DownloadRequest.

fromSerializedRequest

DownloadRequest.Builder fromSerializedRequest (byte[] data)

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

Parameters
data byte: A byte array, the contents of which should have been originally obtained from toByteArray().

Returns
DownloadRequest.Builder

setAppIntent

DownloadRequest.Builder setAppIntent (Intent intent)

Set the Intent that should be sent when the download completes or fails. This should be an intent with a explicit ComponentName targeted to a BroadcastReceiver in the app's package. The middleware should not use this method.

Returns
DownloadRequest.Builder

setServiceInfo

DownloadRequest.Builder setServiceInfo (FileServiceInfo serviceInfo)

Sets the service from which the download request to be built will download from.

Returns
DownloadRequest.Builder

setSubscriptionId

DownloadRequest.Builder setSubscriptionId (int subscriptionId)

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

Returns
DownloadRequest.Builder