[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eAndroid Management API utilizes \u003ccode\u003epolicies\u003c/code\u003e to manage device and app settings, allowing for the creation and application of tailored configurations to devices.\u003c/p\u003e\n"],["\u003cp\u003eDevices should be assigned a policy during enrollment, either through a specified \u003ccode\u003epolicyName\u003c/code\u003e in the enrollment token or by leveraging a default enterprise policy named \u003ccode\u003e"default"\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003ePolicies can be updated via \u003ccode\u003eenterprises.policies.patch\u003c/code\u003e, affecting all associated devices, while changing a device's policy requires using \u003ccode\u003eenterprises.devices.patch\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAlthough a single policy can be shared across multiple devices, using one policy per device offers more granular control and is recommended for enhanced management capabilities.\u003c/p\u003e\n"],["\u003cp\u003eUnset policies are represented by \u003ccode\u003e_UNSPECIFIED\u003c/code\u003e values, and while default behaviors are generally stable, it's advisable to explicitly define critical policies for predictable results.\u003c/p\u003e\n"]]],["Policies in the Android Management API manage device and app settings. Create or update policies using `enterprises.policies.patch`, and delete them with `enterprises.policies.delete`. Apply policies to devices during enrollment by including the `policyName` in the enrollment token. Devices without a policy are blocked until one is applied; enrollment fails after five minutes without a policy. Set a default enterprise policy with `name` as \"default\". Update policies with `enterprises.policies.patch`, or change a device's policy with `enterprises.devices.patch`.\n"],null,["# Create a policy\n\n[`policies`](/android/management/reference/rest/v1/enterprises.policies) (also\ncalled a *policy*) are the core resource of the Android Management API. You use\nthem to create and save groups of device and app management settings for your\ncustomers to apply to devices.\n\n- To create or update a `policies` resource, call [`enterprises.policies.patch`](/android/management/reference/rest/v1/enterprises.policies/patch).\n- To delete a `policies` resource, call [`enterprises.policies.delete`](/android/management/reference/rest/v1/enterprises.policies/delete).\n\nSee example policies\n--------------------\n\nWe've created several examples of recommended policies for different device\nsetups and scenarios:\n\n- [Devices with work profiles](/android/management/policies/work-profile)\n- [Fully managed devices](/android/management/policies/fully-managed-devices)\n- [Dedicated devices](/android/management/policies/dedicated-devices)\n- [Network configurations](/android/management/configure-networks)\n\nApply a policy to devices\n-------------------------\n\nA policy can be applied to one or more devices. However, a device can only have\na single policy at any given time.\n\nA device should be associated with a policy during device enrollment. To do\nthis, include the `policyName` when [creating an enrollment\ntoken](/android/management/provision-device#create_an_enrollment_token). After a\ndevice is enrolled with the enrollment token, the `policies` resource linked to\nthe `policyName` is applied to the device or work profile, depending on the\n[provisioning method](/android/management/provision-device#provisioning_methods)\nused.\n| **Key Point:** A `policies` resource not linked to any device or enrollment token for over seven days may be deleted automatically by the API.\n\nDevices enrolled without a policy are blocked from all functions until a policy\nis applied. **If a policy isn't applied within five minutes, then enrollment\nwill fail and the device will be factory reset.**\n\n### Set a default policy for an enterprise\n\nTo prevent devices from being enrolled without a policy, you can define a single\ndefault policy for an enterprise. To do this, set the `name` of a designated\ndefault policy to `\"default\"`. This policy will then be applied to all newly\nenrolled devices by default, unless another `policyName` is specified in the\ndevice's enrollment token.\n\n### Unspecified values\n\n`_UNSPECIFIED` values are used to represent empty or unset policies. The\nassociated API documentation will outline the default behavior when the policy\nis not explicitly set.\n\nWe generally avoid changing default behavior, except for example when required\nfor security reasons or to align with changes in Android platform. We will\nprovide advance notice to the EMM community when such a change is anticipated to\nallow for EMMs and admins to adapt their policies accordingly.\n\nAs an example, see the `_UNSPECIFIED` enum value for\n[`CrossProfileDataSharing`](https://developers.google.com/android/management/reference/rest/v1/enterprises.policies#crossprofiledatasharing)\n.\n| **Important:** To ensure predictable results and minimize the need for future policy adjustments, we recommend EMMs and admins to explicitly define their policies whenever the required outcome is critical.\n\nUpdate or change a device's policy\n----------------------------------\n\nTo update a policy, call\n[`enterprises.policies.patch`](/android/management/reference/rest/v1/enterprises.policies/patch)\n.\nWhen you update a `policies` resource, the update is enforced on all devices\nassociated with that policy.\n\nTo apply a different policy to the device, call\n[`enterprises.devices.patch`](/android/management/reference/rest/v1/enterprises.devices/patch)\n.\n\n**Note:** We recommend defining one policy per device to enable granular\ndevice-level management capabilities. If there is no need for device-level\ngranularity, AM API supports having a single policy shared across several\ndevices. Automatic patch propagation will occur regardless of your choice to use\nmultiple or a single policy per device."]]