Fix the bug that causes setDelay not working
Fix the bug that causes setDelay not working. Many native sensor apps, such as camera EIS, still use this API. Bug: b/27790706 Change-Id: Iaf7eeb3311a2148ca556d27dbd117e1992715644
This commit is contained in:
@@ -580,7 +580,7 @@ int SensorContext::setDelay(int handle, int64_t delayNs) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sensor.flags & 0xE) == SENSOR_FLAG_CONTINUOUS_MODE) {
|
||||
if ((sensor.flags & REPORTING_MODE_MASK) == SENSOR_FLAG_CONTINUOUS_MODE) {
|
||||
if ((delayNs/1000) < sensor.minDelay) {
|
||||
delayNsClamped = sensor.minDelay * 1000;
|
||||
} else if ((delayNs/1000) > sensor.maxDelay) {
|
||||
@@ -624,7 +624,7 @@ int SensorContext::batch(
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sensor.flags & 0xE) == SENSOR_FLAG_CONTINUOUS_MODE) {
|
||||
if ((sensor.flags & REPORTING_MODE_MASK) == SENSOR_FLAG_CONTINUOUS_MODE) {
|
||||
if ((sampling_period_ns/1000) < sensor.minDelay) {
|
||||
sampling_period_ns_clamped = sensor.minDelay * 1000;
|
||||
} else if ((sampling_period_ns/1000) > sensor.maxDelay) {
|
||||
|
||||
Reference in New Issue
Block a user