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

Commit 89e1dcde authored by Peng Xu's avatar Peng Xu Committed by android-build-merger
Browse files

Merge "Check key before edit value in countFlushCompleteEventsLocked" into...

Merge "Check key before edit value in countFlushCompleteEventsLocked" into oc-dr1-dev am: 8669acc9
am: f0eff80a

Change-Id: If794f597345d2949fa4194e36cae47a522888ea0
parents 3a98c6d6 f0eff80a
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -477,7 +477,14 @@ void SensorService::SensorEventConnection::countFlushCompleteEventsLocked(
    // separately before the next batch of events.
    for (int j = 0; j < numEventsDropped; ++j) {
        if (scratch[j].type == SENSOR_TYPE_META_DATA) {
            FlushInfo& flushInfo = mSensorInfo.editValueFor(scratch[j].meta_data.sensor);
            ssize_t index = mSensorInfo.indexOfKey(scratch[j].meta_data.sensor);
            if (index < 0) {
                ALOGW("%s: sensor 0x%x is not found in connection",
                      __func__, scratch[j].meta_data.sensor);
                continue;
            }

            FlushInfo& flushInfo = mSensorInfo.editValueAt(index);
            flushInfo.mPendingFlushEventsToSend++;
            ALOGD_IF(DEBUG_CONNECTIONS, "increment pendingFlushCount %d",
                     flushInfo.mPendingFlushEventsToSend);