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

Commit 4952dd41 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix logical error in UID idle/active handling" into rvc-dev am: c8f7d50c

Original change: undetermined

Change-Id: I899ebe4b0cfde400c3163e27cbd9d0a2b52aeb7d
parents 2108289c c8f7d50c
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -820,7 +820,7 @@ status_t SensorDevice::updateBatchParamsLocked(int handle, Info &info) {

    status_t err(NO_ERROR);
    // If the min period or min timeout has changed since the last batch call, call batch.
    if (prevBestBatchParams != info.bestBatchParams) {
    if (prevBestBatchParams != info.bestBatchParams && info.numActiveClients() > 0) {
        ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w BATCH 0x%08x %" PRId64 " %" PRId64, handle,
                 info.bestBatchParams.mTSample, info.bestBatchParams.mTBatch);
        err = checkReturnAndGetStatus(mSensors->batch(
@@ -890,9 +890,9 @@ void SensorDevice::setUidStateForConnection(void* ident, SensorService::UidState
        Info& info = mActivationCount.editValueAt(i);

        if (info.hasBatchParamsForIdent(ident)) {
            if (updateBatchParamsLocked(handle, info) != NO_ERROR) {
                bool enable = info.numActiveClients() == 0 && info.isActive;
                bool disable = info.numActiveClients() > 0 && !info.isActive;
            updateBatchParamsLocked(handle, info);
            bool disable = info.numActiveClients() == 0 && info.isActive;
            bool enable = info.numActiveClients() > 0 && !info.isActive;

            if ((enable || disable) &&
                doActivateHardwareLocked(handle, enable) == NO_ERROR) {
@@ -901,7 +901,6 @@ void SensorDevice::setUidStateForConnection(void* ident, SensorService::UidState
        }
    }
}
}

bool SensorDevice::isSensorActive(int handle) const {
    Mutex::Autolock _l(mLock);