Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NFC unavailable when camera is open

This is my Torch app:

final Camera.Parameters p;
Camera camera=Camera.open();

camera.setPreviewTexture(new SurfaceTexture(0));
p = camera.getParameters();

p.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
camera.setParameters(p);
camera.startPreview();

When my app is running, some devices cannot detect NFC tags. I noticed this happens with the Nexus 5X, specifically.

It appears certain devices can't detect NFC when the camera is running.

Can this problem be solved programmatically?

like image 343
CL So Avatar asked Jan 05 '16 08:01

CL So


1 Answers

Unfortunately, no, but I sincerely hope Nexus 5X is the only device on which you will ever encounter this.

The reason is that pretty late in the development cycle of the 5X, it was found that the NFC controller polling introduced noise in the camera sensor. The only feasible fix at that time was to turn off NFC when the camera is opened :(

like image 124
Martijn Coenen Avatar answered Nov 07 '22 00:11

Martijn Coenen