Applications are not supposed to be able to do any I/O using a stale Tag
object. This was not checked in older Android versions, but enforced
later since Android 13 (and possibly in Android 12L).
When we are checking for a disconnected tag, the Tag object can become
stale if the same tag (or another tag) gets rediscovered. In addition,
if NfcService is restarted for some reason, the cookie value used to
check for this will also be reset to 0. In any case, a SecurityException
could be raised when checking for a disconnected tag, and we should be
able to handle this case.
Both @dschuermann and myself no longer spend a lot of time on this
Here's a brief summary of a blog post we never wrote:
* All of OpenKeychain's UI is an anti-feature.
* If the user is doing anything in OpenKeychain's UI, OpenPGP is still doing it wrong.
* OpenKeychain shouldn't be an app, it should be a library.
* Changing OpenKeychain into a library is more work than we are motivated to do in our free time.