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

Commit 4b62d903 authored by Nick Vaccaro's avatar Nick Vaccaro Committed by Android (Google) Code Review
Browse files

Merge "Sensors: Add LOW_LATENCY_OFFBODY_DETECT sensor API"

parents 33bc71ff 2e990eb5
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
@@ -196,7 +196,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: