DownloadRequest.Builder


public static class DownloadRequest.Builder
extends Object

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


Summary

Public constructors

Builder(Uri sourceUri, Uri destinationUri)

Builds a new DownloadRequest.

Public methods

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

Constructs a Builder from a DownloadRequest

static DownloadRequest.Builder fromSerializedRequest(byte[] data)

This method constructs a new instance of 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

Builder

Added in API level 28
public 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 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
public DownloadRequest build ()

Returns
DownloadRequest

fromDownloadRequest

Added in API level 28
public static DownloadRequest.Builder fromDownloadRequest (DownloadRequest other)

Constructs a Builder from a DownloadRequest

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

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

fromSerializedRequest

Added in API level 28
public static DownloadRequest.Builder fromSerializedRequest (byte[] data)

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

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

Returns
DownloadRequest.Builder

setAppIntent

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

Added in API level 28
public DownloadRequest.Builder setServiceInfo (FileServiceInfo serviceInfo)

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

Returns
DownloadRequest.Builder

setSubscriptionId

Added in API level 28
public DownloadRequest.Builder setSubscriptionId (int subscriptionId)

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

Returns
DownloadRequest.Builder