Ambient light sensor problem

Hello there! When I developing my app the standard android sdk don’t see the light sensor, when I call him, he return Null. I searched information about this issue and found in stackoverflow
(Android Light Sensor Returns null - Stack Overflow )
so what Samsung phones don’t have a light sensor, it’s really true? But my debugging Samsung Galaxy m21 have a adaptative brightness function. How can I call and get data from light sensor?

I had problems with sensors (accidentally deleted sensors dir from persist partition, it contains sensors calibration, wifi, and bt hw address).
So I used the latest unbrick tool (9.0.5), but it didn’t solve my issues, then I used the oldest unbrick tool I could find [(Marshmallow) and sensors started to work but could not enable wifi, so I made a local upgrade to 9.0.5, after that all my issues got resolved - sensors and wifi work again. Try what I did, maybe it will solve your issue too.