diff options
| author | 2021-02-05 15:35:34 +0800 | |
|---|---|---|
| committer | 2021-03-11 17:43:04 +0000 | |
| commit | 94ae13178781a14867071636fded56c907a9db8b (patch) | |
| tree | 63ec35d2cbb63851d62cd9d58368ae35e6ec99ae | |
| parent | 73ab3a30ac6a1dd63f9257a091546f10cfa51811 (diff) | |
Fix sensor activate after SensorEventConnection removed
When app idle and register a sensor on existing connection,the method
sensor.batch() retrun NO_ERROR but sensor.activate() return INVALID_OPERATION.
The sensor will remove from the connecion but unable to remove from the
batchParams,this make the sensor active after the app killed.
As the client is disabled, keep the sensor in the connection for resume.
Bug: 180825144
Test: Debug app in 180825144
Signed-off-by: xiamengsen <xiamengsen@xiaomi.com>
Change-Id: Icc22862d1a083abba08fb2cbcabd043444b7090f
| -rw-r--r-- | services/sensorservice/SensorDevice.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp index e355594176..4d4cac568c 100644 --- a/services/sensorservice/SensorDevice.cpp +++ b/services/sensorservice/SensorDevice.cpp @@ -689,9 +689,9 @@ status_t SensorDevice::activateLocked(void* ident, int handle, int enabled) { ALOGD_IF(DEBUG_CONNECTIONS, "enable index=%zd", info.batchParams.indexOfKey(ident)); if (isClientDisabledLocked(ident)) { - ALOGE("SensorDevice::activate, isClientDisabledLocked(%p):true, handle:%d", + ALOGW("SensorDevice::activate, isClientDisabledLocked(%p):true, handle:%d", ident, handle); - return INVALID_OPERATION; + return NO_ERROR; } if (info.batchParams.indexOfKey(ident) >= 0) { |