TransferPreferences
Stay organized with collections
Save and categorize content based on your preferences.
Transfer preferences interface. Defines preference types and methods to retrieve
preferences information.
Nested Class Summary
@interface
Battery usage preference values.
@interface
Network type preference values.
Public Method Summary
abstract int |
|
abstract int |
|
abstract boolean |
|
Constants
public static final int
BATTERY_USAGE_CHARGING_ONLY
Transfer allowed only in charging state.
Constant Value:
257
public static final int
BATTERY_USAGE_UNKNOWN
Battery usage preference is unknown.
Constant Value:
0
public static final int
BATTERY_USAGE_UNRESTRICTED
Battery usage is unrestricted.
Constant Value:
256
public static final int
NETWORK_TYPE_ANY
Any network type is allowed.
Constant Value:
1
public static final int
NETWORK_TYPE_UNKNOWN
Network type preference is unknown.
Constant Value:
0
public static final int
NETWORK_TYPE_WIFI_ONLY
Only WiFi networks are allowed.
Constant Value:
2
Public Methods
public abstract int
getBatteryUsagePreference
()
Returns the battery usage preference.
public abstract int
getNetworkPreference
()
Returns the network type preference.
public abstract boolean
isRoamingAllowed
()
Returns whether roaming is allowed.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eTransferPreferences\u003c/code\u003e interface defines preference types and methods to retrieve preferences information for data transfers.\u003c/p\u003e\n"],["\u003cp\u003eIt allows developers to specify preferences for battery usage (charging only, unrestricted, or unknown) during transfers.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can also set network type preferences (any, Wi-Fi only, or unknown) and control whether roaming is permitted during transfers.\u003c/p\u003e\n"],["\u003cp\u003eThe interface provides methods to retrieve the current battery usage preference, network type preference, and roaming allowance setting.\u003c/p\u003e\n"]]],["The `TransferPreferences` interface defines preferences for data transfers. Key actions include retrieving battery usage preference, network type preference, and checking if roaming is permitted. Battery usage options are `CHARGING_ONLY`, `UNKNOWN`, and `UNRESTRICTED`. Network type options are `ANY`, `UNKNOWN`, and `WIFI_ONLY`. These constants define the allowed transfer conditions, and the public methods provide ways to access the currently set preferences.\n"],null,["# TransferPreferences\n\npublic interface **TransferPreferences** \nTransfer preferences interface. Defines preference types and methods to retrieve\npreferences information. \n\n### Nested Class Summary\n\n|------------|---|---|----------------------------------|\n| @interface | [TransferPreferences.BatteryUsage](/android/reference/com/google/android/gms/drive/TransferPreferences.BatteryUsage) || Battery usage preference values. |\n| @interface | [TransferPreferences.NetworkType](/android/reference/com/google/android/gms/drive/TransferPreferences.NetworkType) || Network type preference values. |\n\n### Constant Summary\n\n|-----|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|\n| int | [BATTERY_USAGE_CHARGING_ONLY](/android/reference/com/google/android/gms/drive/TransferPreferences#BATTERY_USAGE_CHARGING_ONLY) | Transfer allowed only in charging state. |\n| int | [BATTERY_USAGE_UNKNOWN](/android/reference/com/google/android/gms/drive/TransferPreferences#BATTERY_USAGE_UNKNOWN) | Battery usage preference is unknown. |\n| int | [BATTERY_USAGE_UNRESTRICTED](/android/reference/com/google/android/gms/drive/TransferPreferences#BATTERY_USAGE_UNRESTRICTED) | Battery usage is unrestricted. |\n| int | [NETWORK_TYPE_ANY](/android/reference/com/google/android/gms/drive/TransferPreferences#NETWORK_TYPE_ANY) | Any network type is allowed. |\n| int | [NETWORK_TYPE_UNKNOWN](/android/reference/com/google/android/gms/drive/TransferPreferences#NETWORK_TYPE_UNKNOWN) | Network type preference is unknown. |\n| int | [NETWORK_TYPE_WIFI_ONLY](/android/reference/com/google/android/gms/drive/TransferPreferences#NETWORK_TYPE_WIFI_ONLY) | Only WiFi networks are allowed. |\n\n### Public Method Summary\n\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [getBatteryUsagePreference](/android/reference/com/google/android/gms/drive/TransferPreferences#getBatteryUsagePreference())() Returns the battery usage preference. |\n| abstract int | [getNetworkPreference](/android/reference/com/google/android/gms/drive/TransferPreferences#getNetworkPreference())() Returns the network type preference. |\n| abstract boolean | [isRoamingAllowed](/android/reference/com/google/android/gms/drive/TransferPreferences#isRoamingAllowed())() Returns whether roaming is allowed. |\n\nConstants\n---------\n\n#### public static final int\n**BATTERY_USAGE_CHARGING_ONLY**\n\nTransfer allowed only in charging state. \nConstant Value: 257 \n\n#### public static final int\n**BATTERY_USAGE_UNKNOWN**\n\nBattery usage preference is unknown. \nConstant Value: 0 \n\n#### public static final int\n**BATTERY_USAGE_UNRESTRICTED**\n\nBattery usage is unrestricted. \nConstant Value: 256 \n\n#### public static final int\n**NETWORK_TYPE_ANY**\n\nAny network type is allowed. \nConstant Value: 1 \n\n#### public static final int\n**NETWORK_TYPE_UNKNOWN**\n\nNetwork type preference is unknown. \nConstant Value: 0 \n\n#### public static final int\n**NETWORK_TYPE_WIFI_ONLY**\n\nOnly WiFi networks are allowed. \nConstant Value: 2\n\nPublic Methods\n--------------\n\n#### public abstract int **getBatteryUsagePreference** ()\n\nReturns the battery usage preference. \n\n#### public abstract int **getNetworkPreference** ()\n\nReturns the network type preference. \n\n#### public abstract boolean\n**isRoamingAllowed** ()\n\nReturns whether roaming is allowed."]]