The Samsung Galaxy S10 family of phones use a proximity sensor which works quite differently than on practically all other Android devices. Probably because the edge to edge screen left no room, they realized proximity detection using a so-called "Palm Proximity Sensor" which requires you to physically touch the screen with your palm. Covering the phone with a case, putting it in your pocket or laying it face down on the table won't work.
In my opinion this is a violation of the Android API specification which says this:
"The Android platform also provides a sensor that lets you determine how close the face of a device is to an object (known as the proximity sensor). "
And, in the Android system specification we find this statement:
"A proximity sensor reports the distance from the sensor to the closest visible surface. "
Finally, the Android 9 Compatibility Definition specifies:
"Device implementations MAY include a proximity sensor.
If device implementations include a proximity sensor, they:
Note that in all of the cited sections proximity is defined as "objects" being close or far from the device. Nowhere they require that the device needs to by physically touched. Also, from the term "in use" we cannot infer that the phone needs to be either held near your ear or its screen being awkwardly palmed.
As a fun fact, Samsungs own apps -- the Phone app and the internal, hidden self-testing app you can open if you dial *#77692# -- use an internal sensor which is not exposed to 3rd party apps.
Since the Phone app uses a different sensor during calls to detect if your holding your phone near your ear, I suspect that this other sensor draws more power from the battery so they don't allow 3rd party apps to use it.
I have asked the Samsung support about this, but the response is mixed. They won't comment on the fact that their own apps use internal APIs and claim the implementation was valid. In my opinion these phones should not have received Google's Android device certification.
At this point the only hope is that Samsung releases a ROM update which fixes this in some way, but I don't expect this to happen.
If you own an S10/S10+/S10e device, you can verify this yourself. Follow these simple steps: