Add option to pause NFC while viewing a card#3047
Open
il-Luca wants to merge 1 commit intoCatimaLoyalty:mainfrom
Open
Add option to pause NFC while viewing a card#3047il-Luca wants to merge 1 commit intoCatimaLoyalty:mainfrom
il-Luca wants to merge 1 commit intoCatimaLoyalty:mainfrom
Conversation
Member
|
What's stopping you from testing it yourself? :) |
Contributor
Author
|
@TheLastProject the fact that I have close to zero knowledge of software development and testing 😹 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

❌ Therefore, the pull request can simply be declined without further discussion or put on hold until someone is capable of thoroughly testing it – no one will complain 🙂
😇 I couldn't resist experimenting with vibecoding to try fixing an issue that’s been bugging me, and that has been raised by others in the past (see #2158)
Problem
When displaying a loyalty card barcode, nearby NFC readers can interfere with barcode readers resulting in failed read – or accidental payments as described in #2158
Solution
Added an optional "Pause NFC" setting that temporarily suppresses NFC tag dispatch while viewing a card.
It uses NfcAdapter.enableReaderMode() with a no-op callback to intercept all NFC technologies (A, B, F, V, Barcode) without processing them. NFC behavior automatically restores when the card view is exited.
The code added to LoyaltyCardViewActivity.onResume() was "stolen" from https://stackoverflow.com/questions/78570610/disable-programmatically-nfc-while-my-app-is-open
Implementation