Report error and targetLost if system call fails


The call to getMaxTransceiveLength() and isConnected() might fail if
the card was lost in the meantime. Especially Samsung smartphones seem
to not communicate the loss right away.
Consequently a Java exception is thrown:

java.lang.SecurityException: Permission Denial: Tag ( ID: 08 B1 F8 BA ) is out of date
	at android.nfc.Tag.getTagService(Tag.java:382)
	at android.nfc.tech.BasicTagTechnology.getMaxTransceiveLengthInternal(BasicTagTechnology.java:138)
	at android.nfc.tech.IsoDep.getMaxTransceiveLength(IsoDep.java:183)

Permission Denial: Tag ( ID: 08 B1 F8 BA ) is out of date
	at android.nfc.Tag.getTagService(Tag.java:382)
	at android.nfc.tech.BasicTagTechnology.isConnected(BasicTagTechnology.java:63)
	at android.nfc.tech.IsoDep.isConnected(IsoDep.java:40)

If this occurs, it seems safe to assume that the card is gone and the
corresponding error and targetLost should be reported.

Fixes: QTBUG-136506
Pick-to: 6.10 6.9
Change-Id: Ie6432aa9a1e4136f96463311312a1a065484111e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commit7d2ac27c1844cfd954827771f2aa8013c9e9f4a7
parent227718d5a7e5902d1935d7a05c56ef87eae3c360
authorJan Moeller <Jan.Moeller@governikus.de>
committerJan Moeller <Jan.Moeller@governikus.de>
commit timeTue, 10 Jun 2025 16:04:02 +0200