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

Commit 799a759d authored by xuchengchen's avatar xuchengchen
Browse files

If the handle does not exist, it should return false



Test: size_type erase(const key_type& key)  If the key does not exist, the return value is 0
Change-Id: Idf3bf9be6d99c748b634d08fb3edc5aa02c48240
Signed-off-by: default avatarxuchengchen <xuchengchen@xiaomi.com>
parent 754cf33b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ bool SensorService::SensorEventConnection::addSensor(int32_t handle) {

bool SensorService::SensorEventConnection::removeSensor(int32_t handle) {
    Mutex::Autolock _l(mConnectionLock);
    if (mSensorInfo.erase(handle) >= 0) {
    if (mSensorInfo.erase(handle) > 0) {
        return true;
    }
    return false;