SystemUpdatePolicy
public
class
SystemUpdatePolicy
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.app.admin.SystemUpdatePolicy |
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. |
int |
TYPE_POSTPONE
Incoming system updates (except for security updates) will be blocked for a maximum of 30 days, after which the policy will no longer be effective and the system will revert back to its normal behavior as if no policy were set. |
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 instance's marshaled 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 representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
From
class
java.lang.Object
| |
From
interface
android.os.Parcelable
| |
Constants
TYPE_INSTALL_AUTOMATIC
int TYPE_INSTALL_AUTOMATIC
Install system update automatically as soon as one is available.
Constant Value: 1 (0x00000001)
TYPE_INSTALL_WINDOWED
int TYPE_INSTALL_WINDOWED
Install system update automatically within a daily maintenance window. An update can be delayed for a maximum of 30 days, after which the policy will no longer be effective and the system will revert back to its normal behavior as if no policy were set.
After this policy expires, resetting it to any policy other than
TYPE_INSTALL_AUTOMATIC will produce no effect, as the 30-day maximum delay has
already been used up.
The TYPE_INSTALL_AUTOMATIC policy will still take effect to install the delayed
system update immediately.
Re-applying this policy or changing it to TYPE_POSTPONE within the 30-day period
will not extend policy expiration.
However, the expiration will be recalculated when a new system update is made available.
Constant Value: 2 (0x00000002)
TYPE_POSTPONE
int TYPE_POSTPONE
Incoming system updates (except for security updates) will be blocked for a maximum of 30 days, after which the policy will no longer be effective and the system will revert back to its normal behavior as if no policy were set.
Note: security updates (e.g. monthly security patches) may not be affected by this policy, depending on the policy set by the device manufacturer and carrier.
After this policy expires, resetting it to any policy other than
TYPE_INSTALL_AUTOMATIC will produce no effect, as the 30-day maximum delay has
already been used up.
The TYPE_INSTALL_AUTOMATIC policy will still take effect to install the delayed
system update immediately.
Re-applying this policy or changing it to TYPE_INSTALL_WINDOWED within the 30-day
period will not extend policy expiration.
However, the expiration will be recalculated when a new system update is made available.
Constant Value: 3 (0x00000003)
Fields
Public methods
createAutomaticInstallPolicy
SystemUpdatePolicy createAutomaticInstallPolicy ()
Create a policy object and set it to install update automatically as soon as one is available.
| Returns | |
|---|---|
SystemUpdatePolicy |
|
See also:
createPostponeInstallPolicy
SystemUpdatePolicy createPostponeInstallPolicy ()
Create a policy object and set it to block installation for a maximum period of 30 days. After expiration the system will revert back to its normal behavior as if no policy were set.
Note: security updates (e.g. monthly security patches) will not be affected by this policy.
| Returns | |
|---|---|
SystemUpdatePolicy |
|
See also:
createWindowedInstallPolicy
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. 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, an IllegalArgumentException
will be thrown. If start time is later than end time, the window is considered spanning
midnight (i.e. the end time denotes a time on the next day). The maintenance window will last
for 30 days, after which the system will revert back to its normal behavior as if no policy
were set.
| Parameters | |
|---|---|
startTime |
int: 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 |
int: 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). |
| Returns | |
|---|---|
SystemUpdatePolicy |
|
See also:
describeContents
int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(Parcel, int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
getInstallWindowEnd
int getInstallWindowEnd ()
Get the end of the maintenance window.
| Returns | |
|---|---|
int |
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. |
getInstallWindowStart
int getInstallWindowStart ()
Get the start of the maintenance window.
| Returns | |
|---|---|
int |
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. |
getPolicyType
int getPolicyType ()
Returns the type of system update policy.
| Returns | |
|---|---|
int |
an integer, either one of TYPE_INSTALL_AUTOMATIC,
TYPE_INSTALL_WINDOWED and TYPE_POSTPONE, or -1 if no policy has been set.
|
toString
String toString ()
Returns a string representation of the object. In general, the
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String |
a string representation of the object. |
writeToParcel
void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. |
flags |
int: Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
|

