Udostępnij za pośrednictwem


DevicePolicyManager.SetAffiliationIds Method

Definition

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.

Java documentation for android.app.admin.DevicePolicyManager.setAffiliationIds(android.content.ComponentName, java.util.Set<java.lang.String>).

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.

Applies to