public class RequestConfig
extends java.lang.Object
DownloadManager
in each request made.| Modifier and Type | Class and Description |
|---|---|
static interface |
RequestConfig.RequestVisibility
List of values that can take the method
setNotificationVisibility(int). |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_VIDEO_BITRATE |
static int |
VISIBILITY_HIDDEN |
static int |
VISIBILITY_VISIBLE |
static int |
VISIBILITY_VISIBLE_NOTIFY_COMPLETED |
static int |
VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION |
| Constructor and Description |
|---|
RequestConfig() |
| Modifier and Type | Method and Description |
|---|---|
RequestConfig |
copy()
Creates a shallow copy of the current config.
|
java.lang.String |
getDescription()
Gets the request description.
|
java.io.File |
getDownloadPath()
Gets the current base path that will be used to store the downloaded file(s).
|
int |
getNotificationVisibility()
Returns the notification visibility.
|
java.lang.String |
getTitle()
Gets the request title.
|
int |
getVideoBitrate()
Gets the video bitrate configured.
|
boolean |
isBluetoothDownloadAllowed()
Returns whether download over a bluetooth network is allowed.
|
boolean |
isMeteredDownloadAllowed()
Returns whether download over a metered network is allowed.
|
boolean |
isMobileDownloadAllowed()
Returns whether download over a mobile network is allowed.
|
boolean |
isRoamingDownloadAllowed()
Returns whether download over a mobile roaming network is allowed.
|
boolean |
isWifiDownloadAllowed()
Returns whether download over a WIFI network is allowed.
|
RequestConfig |
setBluetoothDownloadAllowed(boolean allowed)
Sets whether download over bluetooth network is allowed.
|
RequestConfig |
setDescription(java.lang.String description)
Sets the request description.
|
RequestConfig |
setDownloadPath(java.io.File downloadPath)
Sets the base path that must be used to the downloaded file(s).
|
RequestConfig |
setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
Sets whether download over metered is allowed.
|
RequestConfig |
setMobileDownloadAllowed(boolean allowed)
Sets whether download over mobile network is allowed.
|
RequestConfig |
setNotificationVisibility(int notificationVisibility)
Sets the notification visibility.
|
RequestConfig |
setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
Sets whether download over roaming is allowed.
|
RequestConfig |
setTitle(java.lang.String title)
Sets the request title.
|
RequestConfig |
setVideoBitrate(int videoBitrate)
Sets the video bitrate cap which will be used to determine what rendition will be downloaded.
|
RequestConfig |
setWifiDownloadAllowed(boolean allowed)
Sets whether download over WIFI network is allowed.
|
public static final int VISIBILITY_VISIBLE
DownloadManager.Request#VISIBILITY_VISIBLE},
Constant Field Valuespublic static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED
DownloadManager.Request#VISIBILITY_VISIBLE_NOTIFY_COMPLETED},
Constant Field Valuespublic static final int VISIBILITY_HIDDEN
DownloadManager.Request#VISIBILITY_HIDDEN},
Constant Field Valuespublic static final int VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION
DownloadManager.Request#VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION},
Constant Field Valuespublic static final int DEFAULT_VIDEO_BITRATE
@Nullable public java.io.File getDownloadPath()
public RequestConfig setDownloadPath(@NonNull java.io.File downloadPath)
Sets the base path that must be used to the downloaded file(s).
downloadPath - the download path.public java.lang.String getTitle()
#setTitle(String)}public java.lang.String getDescription()
#setDescription(String)}public boolean isMobileDownloadAllowed()
#setMobileDownloadAllowed(boolean)}public boolean isWifiDownloadAllowed()
#setWifiDownloadAllowed(boolean)}public boolean isBluetoothDownloadAllowed()
#setBluetoothDownloadAllowed(boolean)}public boolean isRoamingDownloadAllowed()
#setRoamingDownloadAllowed(boolean)}public boolean isMeteredDownloadAllowed()
#setMeteredDownloadAllowed(boolean)}public int getNotificationVisibility()
VISIBILITY_HIDDEN, VISIBILITY_VISIBLE,
VISIBILITY_VISIBLE_NOTIFY_COMPLETED and VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETIONpublic int getVideoBitrate()
public RequestConfig setTitle(java.lang.String title)
title - the titleDownloadManager.Request#setTitle(CharSequence)}public RequestConfig setDescription(java.lang.String description)
description - the descriptionDownloadManager.Request#setDescription(CharSequence)}public RequestConfig setMobileDownloadAllowed(boolean allowed)
allowed - whether mobile download network is allowedpublic RequestConfig setWifiDownloadAllowed(boolean allowed)
allowed - whether download WIFI network is allowedpublic RequestConfig setBluetoothDownloadAllowed(boolean allowed)
allowed - whether download bluetooth network is allowedpublic RequestConfig setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
roamingDownloadAllowed - whether roaming is allowedDownloadManager.Request#setAllowedOverRoaming(boolean)}public RequestConfig setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
meteredDownloadAllowed - whether metered is allowedDownloadManager.Request#setAllowedOverMetered(boolean)}public RequestConfig setVideoBitrate(int videoBitrate)
videoBitrate - the video bitratepublic RequestConfig setNotificationVisibility(int notificationVisibility)
notificationVisibility - the notification visibilityDownloadManager.Request#setNotificationVisibility(int)}public RequestConfig copy()