共用方式為


DevicePolicyManager.EnrollmentSpecificId Property

Definition

Returns an enrollment-specific identifier of this device, which is guaranteed to be the same value for the same device, enrolled into the same organization by the same managing app.

public virtual string EnrollmentSpecificId { [Android.Runtime.Register("getEnrollmentSpecificId", "()Ljava/lang/String;", "GetGetEnrollmentSpecificIdHandler", ApiSince=31)] get; }
[<get: Android.Runtime.Register("getEnrollmentSpecificId", "()Ljava/lang/String;", "GetGetEnrollmentSpecificIdHandler", ApiSince=31)>]
member this.EnrollmentSpecificId : string

Property Value

A stable, enrollment-specific identifier.

Attributes

Remarks

Returns an enrollment-specific identifier of this device, which is guaranteed to be the same value for the same device, enrolled into the same organization by the same managing app. This identifier is high-entropy, useful for uniquely identifying individual devices within the same organisation. It is available both in a work profile and on a fully-managed device. The identifier would be consistent even if the work profile is removed and enrolled again (to the same organization), or the device is factory reset and re-enrolled.

Can only be called by the Profile Owner or Device Owner, if the #setOrganizationId(String) was previously called. If #setOrganizationId(String) was not called, then the returned value will be an empty string.

Note about access to device identifiers: a device owner, a profile owner of an organization-owned device or the delegated certificate installer (holding the #DELEGATION_CERT_INSTALL delegation) on such a device can still obtain hardware identifiers by calling e.g. android.os.Build#getSerial(), in addition to using this method. However, a profile owner on a personal (non organization-owned) device, or the delegated certificate installer on such a device, cannot obtain hardware identifiers anymore and must switch to using this method.

Java documentation for android.app.admin.DevicePolicyManager.getEnrollmentSpecificId().

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