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>