From 1909098d4ac76570d8cafddcc8bb1827483b262a Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Mon, 1 Feb 2021 11:37:01 +0800 Subject: [PATCH] Increase min delay of default gyro sensor The gyro sensor is simulated by CPU. The min delay was too short in comparison with CPU time slice, which might result in CTS failure. This commit increases the min delay so as to decrease the relative error of time intervals. Test: atest CtsSensorTestCases:android.hardware.cts.SingleSensorTests#testGyroscope_fastest Bug: 177871363 Change-Id: I58bc08d30633250cacc5f7dddc6cd836c796475b --- sensors/common/default/2.X/Sensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensors/common/default/2.X/Sensor.cpp b/sensors/common/default/2.X/Sensor.cpp index 642fc89145..1a7c62853f 100644 --- a/sensors/common/default/2.X/Sensor.cpp +++ b/sensors/common/default/2.X/Sensor.cpp @@ -313,7 +313,7 @@ GyroSensor::GyroSensor(int32_t sensorHandle, ISensorsEventCallback* callback) : mSensorInfo.maxRange = 1000.0f * M_PI / 180.0f; mSensorInfo.resolution = 1000.0f * M_PI / (180.0f * 32768.0f); mSensorInfo.power = 0.001f; - mSensorInfo.minDelay = 2.5f * 1000; // microseconds + mSensorInfo.minDelay = 10 * 1000; // microseconds mSensorInfo.maxDelay = kDefaultMaxDelayUs; mSensorInfo.fifoReservedEventCount = 0; mSensorInfo.fifoMaxEventCount = 0;