Skip to content

Most visited

Recently visited

navigation

UpdatePolicy.Builder

UpdatePolicy.Builder

public static class UpdatePolicy.Builder
extends Object

java.lang.Object
   ↳ com.google.android.things.update.UpdatePolicy.Builder


The Builder is used to construct new UpdatePolicy objects.

Summary

Public constructors

UpdatePolicy.Builder()

Public methods

UpdatePolicy build()

Builds an UpdatePolicy with the parameters that have been set on this UpdatePolicy.Builder object.

UpdatePolicy.Builder setApplyDeadline(long deadline, TimeUnit unit)

Set the deadline by which an update must be applied and rebooted into.

UpdatePolicy.Builder setPolicy(int policy)

Sets the base policy to be used by this UpdatePolicy.

Inherited methods

From class java.lang.Object

Public constructors

UpdatePolicy.Builder

UpdatePolicy.Builder ()

Public methods

build

UpdatePolicy build ()

Builds an UpdatePolicy with the parameters that have been set on this UpdatePolicy.Builder object.

Returns
UpdatePolicy A new UpdatePolicy object.
Throws
IllegalArgumentException if all the required fields have not been set

setApplyDeadline

UpdatePolicy.Builder setApplyDeadline (long deadline, 
                TimeUnit unit)

Set the deadline by which an update must be applied and rebooted into.

Parameters
deadline long: The deadline.
unit TimeUnit: The time units for the deadline.
Returns
UpdatePolicy.Builder This builder
Throws
IllegalArgumentException if the deadline is not greater than 0

setPolicy

UpdatePolicy.Builder setPolicy (int policy)

Sets the base policy to be used by this UpdatePolicy.

Parameters
policy int: The update policy to follow.
Returns
UpdatePolicy.Builder This builder.
Throws
IllegalArgumentException if the value for policy is invalid

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)