Merge "DeviceInitializerStatus API review changes" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ed1ef7d4eb
@@ -5695,9 +5695,6 @@ package android.app.admin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class DeviceInitializerStatus {
|
public class DeviceInitializerStatus {
|
||||||
method public static boolean isCustomStatus(int);
|
|
||||||
method public static boolean isErrorStatus(int);
|
|
||||||
method public static boolean isHighPriority(int);
|
|
||||||
field public static final int FLAG_STATUS_CUSTOM = 33554432; // 0x2000000
|
field public static final int FLAG_STATUS_CUSTOM = 33554432; // 0x2000000
|
||||||
field public static final int FLAG_STATUS_ERROR = 16777216; // 0x1000000
|
field public static final int FLAG_STATUS_ERROR = 16777216; // 0x1000000
|
||||||
field public static final int FLAG_STATUS_HIGH_PRIORITY = 134217728; // 0x8000000
|
field public static final int FLAG_STATUS_HIGH_PRIORITY = 134217728; // 0x8000000
|
||||||
@@ -5709,9 +5706,9 @@ package android.app.admin {
|
|||||||
field public static final int STATUS_ERROR_INSTALL_PACKAGE = 16777240; // 0x1000018
|
field public static final int STATUS_ERROR_INSTALL_PACKAGE = 16777240; // 0x1000018
|
||||||
field public static final int STATUS_ERROR_RESET_PROTECTION_BLOCKING_PROVISIONING = 16777238; // 0x1000016
|
field public static final int STATUS_ERROR_RESET_PROTECTION_BLOCKING_PROVISIONING = 16777238; // 0x1000016
|
||||||
field public static final int STATUS_ERROR_SET_DEVICE_POLICY = 16777241; // 0x1000019
|
field public static final int STATUS_ERROR_SET_DEVICE_POLICY = 16777241; // 0x1000019
|
||||||
field public static final int STATUS_STATE_CONNECT_BLUETOOTH_PROXY = 134217736; // 0x8000008
|
field public static final int STATUS_STATE_CONNECTING_BLUETOOTH_PROXY = 134217736; // 0x8000008
|
||||||
field public static final int STATUS_STATE_DEVICE_PROVISIONED = 134217738; // 0x800000a
|
field public static final int STATUS_STATE_DEVICE_PROVISIONED = 134217738; // 0x800000a
|
||||||
field public static final int STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY = 134217737; // 0x8000009
|
field public static final int STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY = 134217737; // 0x8000009
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DevicePolicyManager {
|
public class DevicePolicyManager {
|
||||||
|
|||||||
@@ -5791,9 +5791,6 @@ package android.app.admin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class DeviceInitializerStatus {
|
public class DeviceInitializerStatus {
|
||||||
method public static boolean isCustomStatus(int);
|
|
||||||
method public static boolean isErrorStatus(int);
|
|
||||||
method public static boolean isHighPriority(int);
|
|
||||||
field public static final int FLAG_STATUS_CUSTOM = 33554432; // 0x2000000
|
field public static final int FLAG_STATUS_CUSTOM = 33554432; // 0x2000000
|
||||||
field public static final int FLAG_STATUS_ERROR = 16777216; // 0x1000000
|
field public static final int FLAG_STATUS_ERROR = 16777216; // 0x1000000
|
||||||
field public static final int FLAG_STATUS_HIGH_PRIORITY = 134217728; // 0x8000000
|
field public static final int FLAG_STATUS_HIGH_PRIORITY = 134217728; // 0x8000000
|
||||||
@@ -5805,9 +5802,9 @@ package android.app.admin {
|
|||||||
field public static final int STATUS_ERROR_INSTALL_PACKAGE = 16777240; // 0x1000018
|
field public static final int STATUS_ERROR_INSTALL_PACKAGE = 16777240; // 0x1000018
|
||||||
field public static final int STATUS_ERROR_RESET_PROTECTION_BLOCKING_PROVISIONING = 16777238; // 0x1000016
|
field public static final int STATUS_ERROR_RESET_PROTECTION_BLOCKING_PROVISIONING = 16777238; // 0x1000016
|
||||||
field public static final int STATUS_ERROR_SET_DEVICE_POLICY = 16777241; // 0x1000019
|
field public static final int STATUS_ERROR_SET_DEVICE_POLICY = 16777241; // 0x1000019
|
||||||
field public static final int STATUS_STATE_CONNECT_BLUETOOTH_PROXY = 134217736; // 0x8000008
|
field public static final int STATUS_STATE_CONNECTING_BLUETOOTH_PROXY = 134217736; // 0x8000008
|
||||||
field public static final int STATUS_STATE_DEVICE_PROVISIONED = 134217738; // 0x800000a
|
field public static final int STATUS_STATE_DEVICE_PROVISIONED = 134217738; // 0x800000a
|
||||||
field public static final int STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY = 134217737; // 0x8000009
|
field public static final int STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY = 134217737; // 0x8000009
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DevicePolicyManager {
|
public class DevicePolicyManager {
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ package android.app.admin;
|
|||||||
* <li>{@link #STATUS_ERROR_SET_DEVICE_POLICY}
|
* <li>{@link #STATUS_ERROR_SET_DEVICE_POLICY}
|
||||||
* <li>{@link #STATUS_ERROR_DELETE_APPS}
|
* <li>{@link #STATUS_ERROR_DELETE_APPS}
|
||||||
* <li>{@link #STATUS_ERROR_DOUBLE_BUMP}
|
* <li>{@link #STATUS_ERROR_DOUBLE_BUMP}
|
||||||
* <li>{@link #STATUS_STATE_CONNECT_BLUETOOTH_PROXY}
|
* <li>{@link #STATUS_STATE_CONNECTING_BLUETOOTH_PROXY}
|
||||||
* <li>{@link #STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY}
|
* <li>{@link #STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY}
|
||||||
* <li>{@link #STATUS_STATE_DEVICE_PROVISIONED}
|
* <li>{@link #STATUS_STATE_DEVICE_PROVISIONED}
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
@@ -84,13 +84,13 @@ public class DeviceInitializerStatus {
|
|||||||
* Device provisioning status code that indicates that a device is connecting to establish
|
* Device provisioning status code that indicates that a device is connecting to establish
|
||||||
* a Bluetooth network proxy.
|
* a Bluetooth network proxy.
|
||||||
*/
|
*/
|
||||||
public static final int STATUS_STATE_CONNECT_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 8;
|
public static final int STATUS_STATE_CONNECTING_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device provisioning status code that indicates that a connected Bluetooth network proxy
|
* Device provisioning status code that indicates that a connected Bluetooth network proxy
|
||||||
* is being shut down.
|
* is being shut down.
|
||||||
*/
|
*/
|
||||||
public static final int STATUS_STATE_DISCONNECT_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 9;
|
public static final int STATUS_STATE_DISCONNECTING_BLUETOOTH_PROXY = FLAG_STATUS_HIGH_PRIORITY | 9;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device provisioning status code that indicates that a device has been successfully
|
* Device provisioning status code that indicates that a device has been successfully
|
||||||
@@ -141,37 +141,5 @@ public class DeviceInitializerStatus {
|
|||||||
*/
|
*/
|
||||||
public static final int STATUS_ERROR_DOUBLE_BUMP = FLAG_STATUS_ERROR | 30;
|
public static final int STATUS_ERROR_DOUBLE_BUMP = FLAG_STATUS_ERROR | 30;
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the specified status code represents an error status.
|
|
||||||
* @param statusCode status code to check
|
|
||||||
* @return {@code true} if the status code is an error status code
|
|
||||||
*/
|
|
||||||
public static boolean isErrorStatus(int statusCode) {
|
|
||||||
return isFlagSet(statusCode, FLAG_STATUS_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the specified status code is a custom status. Custom status codes are defined
|
|
||||||
* and sent by device initialization agents.
|
|
||||||
* @param statusCode status code to check
|
|
||||||
* @return {@code true} if the status code is a custom status code
|
|
||||||
*/
|
|
||||||
public static boolean isCustomStatus(int statusCode) {
|
|
||||||
return isFlagSet(statusCode, FLAG_STATUS_CUSTOM);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the specified status code is a high priority status code.
|
|
||||||
* @param statusCode status code to check
|
|
||||||
* @return {@code true} if the status code is a high priority status code
|
|
||||||
*/
|
|
||||||
public static boolean isHighPriority(int statusCode) {
|
|
||||||
return isFlagSet(statusCode, FLAG_STATUS_HIGH_PRIORITY);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isFlagSet(int statusCode, int flag) {
|
|
||||||
return (statusCode & flag) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DeviceInitializerStatus() {}
|
private DeviceInitializerStatus() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ public class DevicePolicyManager {
|
|||||||
* reported to the remote setup device over Bluetooth.
|
* reported to the remote setup device over Bluetooth.
|
||||||
*
|
*
|
||||||
* <p>Broadcasts with this action must supply a
|
* <p>Broadcasts with this action must supply a
|
||||||
* {@linkplain DeviceInitializerStatus#isCustomStatus(int) custom} status code in the
|
* {@linkplain DeviceInitializerStatus#FLAG_STATUS_CUSTOM custom} status code in the
|
||||||
* {@link EXTRA_DEVICE_INITIALIZER_STATUS_CODE} extra.
|
* {@link EXTRA_DEVICE_INITIALIZER_STATUS_CODE} extra.
|
||||||
*
|
*
|
||||||
* <p>Broadcasts may optionally contain a description in the
|
* <p>Broadcasts may optionally contain a description in the
|
||||||
@@ -718,7 +718,7 @@ public class DevicePolicyManager {
|
|||||||
* sent as part of a broadcast with an action of {@code ACTION_SEND_DEVICE_INITIALIZER_STATUS}.
|
* sent as part of a broadcast with an action of {@code ACTION_SEND_DEVICE_INITIALIZER_STATUS}.
|
||||||
*
|
*
|
||||||
* <p>The status code sent with this extra must be a custom status code as defined by
|
* <p>The status code sent with this extra must be a custom status code as defined by
|
||||||
* {@link DeviceInitializerStatus#isCustomStatus(int)}.
|
* {@link DeviceInitializerStatus#FLAG_STATUS_CUSTOM}.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SystemApi
|
@SystemApi
|
||||||
@@ -4229,7 +4229,7 @@ public class DevicePolicyManager {
|
|||||||
* Called by device initializer to send a provisioning status update to the remote setup device.
|
* Called by device initializer to send a provisioning status update to the remote setup device.
|
||||||
*
|
*
|
||||||
* @param statusCode a custom status code value as defined by
|
* @param statusCode a custom status code value as defined by
|
||||||
* {@link DeviceInitializerStatus#isCustomStatus(int)}.
|
* {@link DeviceInitializerStatus#FLAG_STATUS_CUSTOM}.
|
||||||
* @param description custom description of the status code sent
|
* @param description custom description of the status code sent
|
||||||
*/
|
*/
|
||||||
public void sendDeviceInitializerStatus(int statusCode, String description) {
|
public void sendDeviceInitializerStatus(int statusCode, String description) {
|
||||||
|
|||||||
Reference in New Issue
Block a user