encryptionState

The state of the encryption of the link.

Having the bond information (hasBondInformation) does not mean the link is encrypted. This state tells whether it is. It is EncryptionState.Unknown when the peripheral is not connected, and on Android versions older than Android 16 (API 36), which do not report it.

Android should encrypt the link with a bonded peripheral right after connecting. If it fails, e.g. because the peripheral lost the keys, the state is EncryptionState.NotEncrypted with the reason, and the connection should not be trusted.

See also