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

Commit 2e990eb5 authored by Nick Vaccaro's avatar Nick Vaccaro
Browse files

Sensors: Add LOW_LATENCY_OFFBODY_DETECT sensor API

Test: none
Bug: 34234089
Change-Id: I7680ef1523cec0212e2817368f8d62891edc92cf
parent 3b5f40a2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -210,6 +210,10 @@ Sensor::Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersi
            mFlags |= SENSOR_FLAG_WAKE_UP;
        }
        break;
    case SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT:
        mStringType = SENSOR_STRING_TYPE_LOW_LATENCY_OFFBODY_DETECT;
        mFlags |= SENSOR_FLAG_ON_CHANGE_MODE;
        break;
    case SENSOR_TYPE_WRIST_TILT_GESTURE:
        mStringType = SENSOR_STRING_TYPE_WRIST_TILT_GESTURE;
        mFlags |= SENSOR_FLAG_SPECIAL_REPORTING_MODE;
+2 −1
Original line number Diff line number Diff line
@@ -195,7 +195,8 @@ Sensor const* SensorManager::getDefaultSensor(int type)
        if (type == SENSOR_TYPE_PROXIMITY || type == SENSOR_TYPE_SIGNIFICANT_MOTION ||
            type == SENSOR_TYPE_TILT_DETECTOR || type == SENSOR_TYPE_WAKE_GESTURE ||
            type == SENSOR_TYPE_GLANCE_GESTURE || type == SENSOR_TYPE_PICK_UP_GESTURE ||
            type == SENSOR_TYPE_WRIST_TILT_GESTURE) {
            type == SENSOR_TYPE_WRIST_TILT_GESTURE ||
            type == SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT) {
            wakeUpSensor = true;
        }
        // For now we just return the first sensor of that type we find.
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ size_t eventSizeBySensorType(int type) {
        case SENSOR_TYPE_STATIONARY_DETECT:
        case SENSOR_TYPE_MOTION_DETECT:
        case SENSOR_TYPE_HEART_BEAT:
        case SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT:
            return 1;

        default: