public class SystemUpdatePolicy
extends Object implements Parcelable
| java.lang.Object | |
| android.app.admin.SystemUpdatePolicy | |
表示设备所有者设置的本地系统更新策略的类。
常量(Constants) |
|
|---|---|
int |
TYPE_INSTALL_AUTOMATIC 尽快自动安装系统更新。 |
int |
TYPE_INSTALL_WINDOWED 在日常维护时段内自动安装系统更新,最长30天。 |
int |
TYPE_POSTPONE 传入的系统更新将被阻止最多30天,之后系统应该恢复到其正常行为,就好像没有设置策略一样。 |
Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<SystemUpdatePolicy> |
CREATOR |
公共方法(Public methods) |
|
|---|---|
static SystemUpdatePolicy |
createAutomaticInstallPolicy() 创建一个策略对象并将其设置为一旦可用就自动安装更新。 |
static SystemUpdatePolicy |
createPostponeInstallPolicy() 创建一个策略对象并将其设置为阻止安装,最长期限为30天。 |
static SystemUpdatePolicy |
createWindowedInstallPolicy(int startTime, int endTime) 创建一个策略对象并将其设置为:只有当系统时钟位于日常维护窗口内时,才会自动安装新的系统更新。 |
int |
describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 |
int |
getInstallWindowEnd() 获取维护窗口的结束。 |
int |
getInstallWindowStart() 获取维护窗口的开始。 |
int |
getPolicyType() 返回系统更新策略的类型。 |
String |
toString() 返回对象的字符串表示形式。 |
void |
writeToParcel(Parcel dest, int flags) 将此对象平铺到一个包裹中。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
int TYPE_INSTALL_AUTOMATIC
尽快自动安装系统更新。
常数值:1(0x00000001)
int TYPE_INSTALL_WINDOWED
在日常维护时段内自动安装系统更新,最长30天。 到期后,政策将不再有效,系统应该恢复到正常行为,就好像没有制定政策一样。 唯一的例外是TYPE_INSTALL_AUTOMATIC ,它应该立即生效以安装系统更新。
常量值:2(0x00000002)
int TYPE_POSTPONE
传入的系统更新将被阻止最多30天,之后系统应该恢复到其正常行为,就好像没有设置策略一样。 唯一的例外是TYPE_INSTALL_AUTOMATIC ,它应该立即生效以安装系统更新。
常量值:3(0x00000003)
SystemUpdatePolicy createAutomaticInstallPolicy ()
创建一个策略对象并将其设置为一旦可用就自动安装更新。
| 返回(Returns) | |
|---|---|
SystemUpdatePolicy |
|
也可以看看:
SystemUpdatePolicy createPostponeInstallPolicy ()
创建一个策略对象并将其设置为阻止安装,最长期限为30天。 到期后,系统应该恢复到正常行为,就好像没有设置策略一样。
| 返回(Returns) | |
|---|---|
SystemUpdatePolicy |
|
也可以看看:
SystemUpdatePolicy createWindowedInstallPolicy (int startTime, int endTime)
创建一个策略对象并将其设置为:只有当系统时钟位于日常维护窗口内时,才会自动安装新的系统更新。 如果开始和结束时间相同,则认为该窗口包含整个24小时,也就是说,可以随时安装更新。 如果给定窗口无效,则会抛出IllegalArgumentException 。 如果开始时间晚于结束时间,则认为窗口跨越午夜,即结束时间在第二天捐赠一次。 维护窗口将持续30天,之后系统应该恢复到其正常行为,就好像没有设置策略一样。
| 参数(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 |
|
也可以看看:
int describeContents ()
描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象将在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。
| 返回(Returns) | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
int getInstallWindowEnd ()
获取维护窗口的结束。
| 返回(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. |
int getInstallWindowStart ()
获取维护窗口的开始。
| 返回(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. |
int getPolicyType ()
返回系统更新策略的类型。
| 返回(Returns) | |
|---|---|
int |
an integer, either one of TYPE_INSTALL_AUTOMATIC, TYPE_INSTALL_WINDOWED and TYPE_POSTPONE, or -1 if no policy has been set. |
String toString ()
返回对象的字符串表示形式。 一般来说, toString方法会返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。
类Object的toString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| 返回(Returns) | |
|---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel dest, int flags)
将此对象平铺到一个包裹中。
| 参数(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. |