با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
policies (که به آن خط مشی نیز می گویند) منبع اصلی API مدیریت Android هستند. از آنها برای ایجاد و ذخیره گروههایی از تنظیمات مدیریت دستگاه و برنامه برای مشتریانتان استفاده میکنید تا در دستگاهها اعمال شوند.
یک خط مشی را می توان برای یک یا چند دستگاه اعمال کرد. با این حال، یک دستگاه تنها می تواند در هر زمان معین یک خط مشی واحد داشته باشد.
یک دستگاه باید در هنگام ثبت نام دستگاه با خطمشی مرتبط باشد. برای انجام این کار، هنگام ایجاد رمز ثبت نام ، policyName را وارد کنید. پس از ثبت نام دستگاه با رمز ثبتنام، منبع policies مرتبط با policyName بر روی دستگاه یا نمایه کاری اعمال میشود، بسته به روش تهیه مورد استفاده.
دستگاههایی که بدون خطمشی ثبتنام میشوند، تا زمانی که یک خطمشی اعمال شود، از همه عملکردها مسدود میشوند. اگر خطمشی در عرض پنج دقیقه اعمال نشود، ثبت نام انجام نمیشود و دستگاه بازنشانی کارخانهای میشود.
یک خط مشی پیش فرض برای یک شرکت تنظیم کنید
برای جلوگیری از ثبت نام دستگاهها بدون خطمشی، میتوانید یک خطمشی پیشفرض برای یک شرکت تعریف کنید. برای انجام این کار، name یک خط مشی پیش فرض تعیین شده را روی "default" تنظیم کنید. سپس این خطمشی بهطور پیشفرض برای همه دستگاههای تازه ثبتنامشده اعمال میشود، مگر اینکه policyName دیگری در کد ثبتنام دستگاه مشخص شده باشد.
مقادیر نامشخص
مقادیر _UNSPECIFIED برای نمایش خط مشی های خالی یا تنظیم نشده استفاده می شود. اسناد API مرتبط، رفتار پیشفرض را زمانی که این خطمشی بهصراحت تنظیم نشده است، تشریح میکند.
ما معمولاً از تغییر رفتار پیشفرض خودداری میکنیم، بهجز برای مثال زمانی که به دلایل امنیتی یا همسویی با تغییرات در پلتفرم Android لازم باشد. زمانی که چنین تغییری پیشبینی میشود که به EMMها و مدیران اجازه میدهد تا خطمشیهای خود را مطابق با آن تطبیق دهند، از قبل به جامعه EMM اطلاع رسانی میکنیم.
برای بهروزرسانی یک خطمشی، با enterprises.policies.patch تماس بگیرید. هنگامی که یک منبع policies را به روز می کنید، به روز رسانی در همه دستگاه های مرتبط با آن خط مشی اعمال می شود.
توجه: توصیه میکنیم یک خطمشی برای هر دستگاه برای فعال کردن قابلیتهای مدیریتی سطح دستگاه تعریف کنید. اگر نیازی به جزئیات در سطح دستگاه نباشد، AM API از داشتن یک خط مشی واحد به اشتراک گذاشته شده در چندین دستگاه پشتیبانی می کند. انتشار خودکار وصله بدون توجه به انتخاب شما برای استفاده از چندین یا یک خط مشی در هر دستگاه رخ می دهد.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]