SIM card theft protection

Android 17 QPR2 introduces SIM card protection to mitigate the risk of financial fraud and identity theft. Attackers who steal devices often extract the physical SIM card and insert it into another device to intercept SMS-based one-time passwords (OTPs) for authorizing fraudulent transactions.

This feature allows Android to automatically manage a SIM PIN on behalf of the user. When users opt-in, the platform generates a random PIN, sets it on the SIM card, and securely stores it using an authentication-bound Keystore key. If the default carrier PIN is unknown or the user has previously changed their SIM PIN, they are prompted to manually enter their current PIN when enabling the feature.

Key functionalities

  • Automatic PIN generation and management: The platform generates a unique PIN and securely stores it.
  • Post-reboot connectivity: A copy of the PIN is temporarily stored in Device Encrypted (DE) storage to facilitate connectivity immediately after a user-initiated reboot. The unencrypted copy is erased once the SIM is unlocked.
  • Backup and restore: For users logged into their Google Accounts, the SIM PIN database is included in encrypted device backups, enabling automatic recovery when moving the SIM to a new device.
  • SIM removal notification: If the SIM is extracted, a notification prompts the user to authenticate and retrieve the generated PIN so they can use the SIM in another device.
  • Password manager support: The automatically generated PIN can be saved to a user's preferred password manager, allowing them to recover their PIN across different platforms.

Implementation

This feature requires no custom implementation for partners. The functionality is fully contained within AOSP Settings.

The feature introduces the following TelephonyManager methods:

  • enrollSimInAutoPinManagement
  • unenrollSimFromAutoPinManagement
  • getAutoManagedPinForSim
  • getSimAutoPinManagementEnrollmentStatus

OEM customizations

OEMs can disable the feature by setting the config_enableAutomaticSimPinManagement key to false. This leaves the manual SIM PIN management UI intact but hides the automatic PIN management options.

Carrier customizations

To streamline the setup process, the platform can automatically use a carrier's known default SIM PIN during enrollment:

  • Sharing default PINs: Carriers willing to share their default SIM PIN configurations (or those changing their default configurations) should complete the default PIN configuration form and file a bug using the partner subcomponent Handheld > Allowlist Requests, using the template SIM PIN configuration (SIM Theft Protection).
  • Disabling the feature: Disable the automatic SIM PIN UI by setting the carrier config key CarrierConfigManager.KEY_HIDE_AUTOMATIC_SIM_PIN_MANAGEMENT_BOOL to true.
  • To completely hide all SIM PIN management UI, including manual management (not recommended), use CarrierConfigManager.KEY_HIDE_SIM_LOCK_SETTINGS_BOOL.

Validation

To ensure the feature works as intended, validate the implementation using the following: