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

Commit 844f3020 authored by Andrew Lehmer's avatar Andrew Lehmer Committed by Android (Google) Code Review
Browse files

Merge "Increase recent event count for proximity sensors"

parents 6b2574b7 aeef9d52
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) {