Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 311fb193 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

RESTRICT AUTOMERGE ProximitySensor now supports dual-sensor approach.

The ProximitySensor now supports the concept of a primary and a
secondary hardware sensor. The primary sensor is used for a first
pass check if the phone covered. When triggered, it then checks
the secondary sensor for confirmation (if there is one). It does
not send a proximity event until the secondary sensor confirms (or
rejects) the reading. The secondary sensor is, in fact, the source
of truth.

This is necessary as sometimes keeping the secondary sensor on for
extends periods is undesirable. It may, however, result in increased
latency for proximity readings.

Phones should configure this via a config.xml overlay. If no
proximity sensor is set (primary or secondary) we fall back to the
default Sensor.TYPE_PROXIMITY. If proximity_sensor_type is set in
config.xml, that will be used as the primary sensor. If
proximity_sensor_secondary_type is set, that will function as the
secondary sensor. If no secondary is set, only the primary will be
used.

This CL also introduces the ThresholdSensor interface. This is a
simple sensor wrapper for sensors that need to report a binary
above/below value. ProximitySensor now implements this interface
and also takes in ThresholdSensor as its primary and secondary
inputs.

Bug: 147026387
Test: atest SystemUITests && manual
Change-Id: I1e808e591f1db05c664df6190670cb92315f63f3
Merged-In: I1e808e591f1db05c664df6190670cb92315f63f3
parent 6f2658d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment