Partager via


TelephonyManager.PrimaryImei Property

Definition

Returns the primary IMEI (International Mobile Equipment Identity) of the device as mentioned in GSMA TS.

public virtual string PrimaryImei { [Android.Runtime.Register("getPrimaryImei", "()Ljava/lang/String;", "GetGetPrimaryImeiHandler", ApiSince=34)] get; }
[<get: Android.Runtime.Register("getPrimaryImei", "()Ljava/lang/String;", "GetGetPrimaryImeiHandler", ApiSince=34)>]
member this.PrimaryImei : string

Property Value

Primary IMEI of type string

Attributes

Remarks

Returns the primary IMEI (International Mobile Equipment Identity) of the device as mentioned in GSMA TS.37. #getImei(int) returns the IMEI that belongs to the selected slotID whereas this API #getPrimaryImei() returns primary IMEI of the device. A single SIM device with only one IMEI will be set by default as primary IMEI. A multi-SIM device with multiple IMEIs will have one of the IMEIs set as primary as mentioned in GSMA TS37_2.2_REQ_8.

Requires one of the following permissions <ul> <li>If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device. <li>If the calling app is the device owner of a fully-managed device, a profile owner of an organization-owned device, or their delegates (see android.app.admin.DevicePolicyManager#getEnrollmentSpecificId()). <li>If the calling app has carrier privileges (see #hasCarrierPrivileges) on any active subscription. <li>If the calling app is the default SMS role holder (see RoleManager#isRoleHeld(String)). <li>If the calling app has been granted the Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER permission. </ul>

Java documentation for android.telephony.TelephonyManager.getPrimaryImei().

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