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

Commit aeef9d52 authored by Andrew Lehmer's avatar Andrew Lehmer Committed by Brian Duddie
Browse files

Increase recent event count for proximity sensors

Bug: 116490067
Test: dumpsys sensorservice
Change-Id: I0ca55da7155a8c528db9f99e9a1951d98289a1a4
parent 677ce2cb
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ namespace SensorServiceUtil {

namespace {
    constexpr size_t LOG_SIZE = 10;
    constexpr size_t LOG_SIZE_MED = 30;  // debugging for slower sensors
    constexpr size_t LOG_SIZE_LARGE = 50;  // larger samples for debugging
}// unnamed namespace

@@ -98,10 +99,16 @@ bool RecentEventLogger::populateLastEvent(sensors_event_t *event) const {


size_t RecentEventLogger::logSizeBySensorType(int sensorType) {
    return (sensorType == SENSOR_TYPE_STEP_COUNTER ||
    if (sensorType == SENSOR_TYPE_STEP_COUNTER ||
        sensorType == SENSOR_TYPE_SIGNIFICANT_MOTION ||
        sensorType == SENSOR_TYPE_ACCELEROMETER ||
            sensorType == SENSOR_TYPE_LIGHT) ? LOG_SIZE_LARGE : LOG_SIZE;
        sensorType == SENSOR_TYPE_LIGHT) {
        return LOG_SIZE_LARGE;
    }
    if (sensorType == SENSOR_TYPE_PROXIMITY) {
        return LOG_SIZE_MED;
    }
    return LOG_SIZE;
}

RecentEventLogger::SensorEventLog::SensorEventLog(const sensors_event_t& e) : mEvent(e) {