DevicePolicyManager.SetAffiliationIds Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates the entity that controls the device.
[Android.Runtime.Register("setAffiliationIds", "(Landroid/content/ComponentName;Ljava/util/Set;)V", "GetSetAffiliationIds_Landroid_content_ComponentName_Ljava_util_Set_Handler", ApiSince=26)]
public virtual void SetAffiliationIds (Android.Content.ComponentName admin, System.Collections.Generic.ICollection<string> ids);
[<Android.Runtime.Register("setAffiliationIds", "(Landroid/content/ComponentName;Ljava/util/Set;)V", "GetSetAffiliationIds_Landroid_content_ComponentName_Ljava_util_Set_Handler", ApiSince=26)>]
abstract member SetAffiliationIds : Android.Content.ComponentName * System.Collections.Generic.ICollection<string> -> unit
override this.SetAffiliationIds : Android.Content.ComponentName * System.Collections.Generic.ICollection<string> -> unit
Parameters
- admin
- ComponentName
Which device owner, or owner of secondary user, this request is associated with.
- ids
- ICollection<String>
A set of opaque non-empty affiliation ids.
- Attributes
Remarks
Indicates the entity that controls the device. Two users are affiliated if the set of ids set by the device owner and the admin of the secondary user.
A user that is affiliated with the device owner user is considered to be affiliated with the device.
<strong>Note:</strong> Features that depend on user affiliation (such as security logging or #bindDeviceAdminServiceAsUser
) won't be available when a secondary user is created, until it becomes affiliated. Therefore it is recommended that the appropriate affiliation ids are set by its owner as soon as possible after the user is created.
Note: This method used to be available for affiliating device owner and profile owner. However, since Android 11, this combination is not possible. This method is now only useful for affiliating the primary user with managed secondary users.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.