Skip to main content

Android version limitations for copyPan

The copy card number to clipboard feature using the copyPan method for Android has the following strategy:

  • The PAN copied to the clipboard is set as EXTRA_IS_SENSITIVE.
  • A WorkManager is scheduled to attempt to clear the clipboard after 3 minutes.

To protect users' privacy, from Android 10 (API 29) Google prohibits apps from read or write access to device clipboards while in the background.

The implementation faces different restrictions depending on the Android version run on the device.

  • For Android 13 (API 33) and newer – The operating system (OS) provides security and cleans the clipboard. This is completed within approximately one hour.

    • The PAN is cleaned within three minutes if the app is in focus.
    • If the app is in the background, the WorkManager fails.
  • For Android 9 (API 28) and older – The background clipboard restriction does not apply. The WorkManager solution guarantees the PAN is cleaned after three minutes regardless of whether the app is in focus or in the background.

  • For Android 10, 11, and 12 (API 29-32) – The background restriction applies, but the OS auto-clear feature does not. A guaranteed background clear is not possible for the SDK. We recommend accepting this platform limitation. Attempts to clear from the background fail.

    • The PAN is cleaned within three minutes if the app is in focus.
    • If the app is in the background, the PAN is not cleaned.
Was this article helpful?
Share
Copy Link Share via email

Articles in this section