3

I'm developping an app for Samsung devices with an activity that has to handle a NFC tag..

This activity is called when the app is launched and on resume.

I noticed that, when the phone stays awake with the NFC tag connected to it, after a while the device stops recognizing/scanning for NFC tags.

After trying with some other applications from Play Store, I noticed that this doesn't happen only with my app.

All I can do to make it work again is to switch phone's screen on/off or to switch nfc on/off.

I tried different ways to fix it, as to keep the cpu running, but none of these methods worked :

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Tag");
wl.acquire();

and

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

The only post about my problem that I found is : onTagDiscovered() not called any more when nfc tag already there after updating from 4.4.4 to 5.1.1 Samsung

Unfortunately, I'm working over non-rooted phones, and I'm not able to get a Samsung Knox licence (unless it is free ?)

Thanks in advance

EDIT

Tried with

setKeepScreenOn(true);

But still no change about this bug

pocus
  • 51
  • 7
  • I finally got an answer from Samsung. They sent me a technical report about my issue ("Unable to detect NFC tag, after device connects NFC tag without any operation over 60 seconds") They said "This issue can be recoverable ONLY by screen off -> on" And the history about this issue : "60 secs timeout is intended behaviour to avoir power consumption. We've got some VOC's from customers who use their mobile phone with the cover including credit card like right picture. We found that they usually play the mobile game or web browsing with the cover folded. (1/2) – pocus Feb 18 '20 at 14:57
  • It can make RF connection and it makes such power consumption because the card was place to the NFC antenna while cover folded. To avoid this problem, we decided to set the timeout (60 secs) of disabling discovery" (2/2) – pocus Feb 18 '20 at 14:59

0 Answers0