Android APIs
public class

SystemUpdatePolicy

extends Object
implements Parcelable
java.lang.Object
   ↳ android.app.admin.SystemUpdatePolicy

Class Overview

A class that represents a local system update policy set by the device owner.

Summary

Constants
int TYPE_INSTALL_AUTOMATIC Install system update automatically as soon as one is available.
int TYPE_INSTALL_WINDOWED Install system update automatically within a daily maintenance window, for a maximum of 30 days.
int TYPE_POSTPONE Incoming system update will be blocked for a maximum of 30 days, after which the system should revert back to its normal behavior as if no policy were set.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<SystemUpdatePolicy> CREATOR
Public Methods
static SystemUpdatePolicy createAutomaticInstallPolicy()
Create a policy object and set it to install update automatically as soon as one is available.
static SystemUpdatePolicy createPostponeInstallPolicy()
Create a policy object and set it to block installation for a maximum period of 30 days.
static SystemUpdatePolicy createWindowedInstallPolicy(int startTime, int endTime)
Create a policy object and set it to: new system update will only be installed automatically when the system clock is inside a daily maintenance window.
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
int getInstallWindowEnd()
Get the end of the maintenance window.
int getInstallWindowStart()
Get the start of the maintenance window.
int getPolicyType()
Returns the type of system update policy.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int TYPE_INSTALL_AUTOMATIC

Added in API level 23

Install system update automatically as soon as one is available.

Constant Value: 1 (0x00000001)

public static final int TYPE_INSTALL_WINDOWED

Added in API level 23

Install system update automatically within a daily maintenance window, for a maximum of 30 days. After the expiration the policy will no longer be effective and the system should revert back to its normal behavior as if no policy were set. The only exception is TYPE_INSTALL_AUTOMATIC which should still take effect to install system update immediately.

Constant Value: 2 (0x00000002)

public static final int TYPE_POSTPONE

Added in API level 23

Incoming system update will be blocked for a maximum of 30 days, after which the system should revert back to its normal behavior as if no policy were set. The only exception is TYPE_INSTALL_AUTOMATIC which should still take effect to install system update immediately.

Constant Value: 3 (0x00000003)

Fields

public static final Creator<SystemUpdatePolicy> CREATOR

Added in API level 23

Public Methods

public static SystemUpdatePolicy createAutomaticInstallPolicy ()

Added in API level 23

Create a policy object and set it to install update automatically as soon as one is available.

public static SystemUpdatePolicy createPostponeInstallPolicy ()

Added in API level 23

Create a policy object and set it to block installation for a maximum period of 30 days. After expiration the system should revert back to its normal behavior as if no policy were set.

See Also

public static SystemUpdatePolicy createWindowedInstallPolicy (int startTime, int endTime)

Added in API level 23

Create a policy object and set it to: new system update will only be installed automatically when the system clock is inside a daily maintenance window. If the start and end times are the same, the window is considered to include the WHOLE 24 hours, that is, updates can install at any time. If the given window in invalid, a IllegalArgumentException will be thrown. If start time is later than end time, the window is considered spanning midnight, i.e. end time donates a time on the next day. The maintenance window will last for 30 days, after which the system should revert back to its normal behavior as if no policy were set.

Parameters
startTime the start of the maintenance window, measured as the number of minutes from midnight in the device's local time. Must be in the range of [0, 1440).
endTime the end of the maintenance window, measured as the number of minutes from midnight in the device's local time. Must be in the range of [0, 1440).

public int describeContents ()

Added in API level 23

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public int getInstallWindowEnd ()

Added in API level 23

Get the end of the maintenance window.

Returns
  • the end of the maintenance window measured as the number of minutes from midnight, or -1 if the policy does not have a maintenance window.

public int getInstallWindowStart ()

Added in API level 23

Get the start of the maintenance window.

Returns
  • the start of the maintenance window measured as the number of minutes from midnight, or -1 if the policy does not have a maintenance window.

public int getPolicyType ()

Added in API level 23

Returns the type of system update policy.

Returns

public String toString ()

Added in API level 23

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 23

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.