AppRTCProximitySensor

AppRTCProximitySensor manages functions related to the proximity sensor in the AppRTC demo. On most device, the proximity sensor is implemented as a boolean-sensor. It returns just two values "NEAR" or "FAR". Thresholding is done on the LUX value i.e. the LUX value of the light sensor is compared with a threshold. A LUX-value more than the threshold means the proximity sensor returns "FAR". Anything less than the threshold value and the sensor returns "NEAR".

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun onAccuracyChanged(sensor: Sensor, accuracy: Int)
Link copied to clipboard
open override fun onSensorChanged(event: SensorEvent)
Link copied to clipboard

Getter for last reported state. Set to true if "near" is reported.

Link copied to clipboard
fun start(): Boolean

Activate the proximity sensor. Also do initialization if called for the first time.

Link copied to clipboard
fun stop()

Deactivate the proximity sensor.