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

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

[sensorservice] Fix inconsistent states in SensorDevice am: 4f707f8b

am: 86b20dce

Change-Id: I3112afafc8a912b459e6be5243396e7ca8c7ba93
parents 5bcce574 86b20dce
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -481,6 +481,11 @@ ssize_t SensorDevice::Info::removeBatchParamsForIdent(void* ident) {
    return idx;
}

void SensorDevice::notifyConnectionDestroyed(void* ident) {
    Mutex::Autolock _l(mLock);
    mDisabledClients.remove(ident);
}

// ---------------------------------------------------------------------------
}; // namespace android
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ public:
    void enableAllSensors();
    void autoDisable(void *ident, int handle);
    status_t injectSensorData(const sensors_event_t *event);
    void notifyConnectionDestroyed(void *ident);

    // Dumpable
    virtual std::string dump() const;
+3 −0
Original line number Diff line number Diff line
@@ -997,6 +997,9 @@ void SensorService::cleanupConnection(SensorEventConnection* c) {
    if (c->needsWakeLock()) {
        checkWakeLockStateLocked();
    }

    SensorDevice& dev(SensorDevice::getInstance());
    dev.notifyConnectionDestroyed(c);
}

sp<SensorInterface> SensorService::getSensorInterfaceFromHandle(int handle) const {