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

Commit 8b4869dc authored by Aravind Akella's avatar Aravind Akella Committed by Android Git Automerger
Browse files

am 5105960d: Fix sockfd leakage in SensorService. Remove sockfd from Looper...

am 5105960d: Fix sockfd leakage in SensorService. Remove sockfd from Looper when the connection is removed from mActiveConnections.

* commit '5105960d':
  Fix sockfd leakage in SensorService. Remove sockfd from Looper when the connection is removed from mActiveConnections.
parents 53bffaaf 5105960d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -653,6 +653,7 @@ void SensorService::cleanupConnection(SensorEventConnection* c)
            i++;
        }
    }
    mLooper->removeFd(c->getSensorChannel()->getSendFd());
    mActiveConnections.remove(connection);
    BatteryService::cleanup(c->getUid());
    if (c->needsWakeLock()) {
@@ -799,6 +800,7 @@ status_t SensorService::cleanupWithoutDisableLocked(
            BatteryService::disableSensor(connection->getUid(), handle);
        }
        if (connection->hasAnySensor() == false) {
            mLooper->removeFd(connection->getSensorChannel()->getSendFd());
            mActiveConnections.remove(connection);
        }
        // see if this sensor becomes inactive