summaryrefslogtreecommitdiff
path: root/sensors/common/default/2.X/Sensor.cpp
AgeCommit message (Collapse)Author
2022-02-09Fix cert-dcl16-c warningsChih-Hung Hsieh
Bug: 120614316 Test: make tidy-hardware-interfaces_subset Change-Id: I6bbeddb9990e4771155ec7d49a68f0e161789030
2021-09-03Use CLOCK_BOOTTIME for default sensor implementationHsin-Yi Chen
The sensor implementation used to generate periodic signals according to CLOCK_REALTIME. The clock can be adjusted by user or synchronization service and results in wrong period. This commit changes it to CLOCK_BOOTTIME which is monotonic. Test: atest VtsHalSensorsV2_0TargetTest Test: atest VtsHalSensorsV2_1TargetTest Test: atest CtsSensorTestCases Bug: 194030777 Change-Id: Iac39c93d6d2518b1abe8fc07fd695b9bb2cf30a5
2021-02-01Increase min delay of default gyro sensorHsin-Yi Chen
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
2020-12-04Adjust the parameters of accelerometer and hinge angle sensorHsin-Yi Chen
This commit fixes the following CTS failures: CtsSensorTestCases:android.hardware.cts.SingleSensorTests#testSensorProperties CtsSensorTestCases:android.hardware.cts.SensorTest#testSensorOperations Test: atest VtsHalSensorsV2_0TargetTest Test: atest VtsHalSensorsV2_1TargetTest Test: atest CtsSensorTestCases Bug: 169548171 Change-Id: Ie295a06a539ed6788bdff0f9c936a4186e5f1d0f
2020-12-03Set default value for pressure sensorHsin-Yi Chen
This commit fixes the following CTS failures: CtsSensorTestCases:android.hardware.cts.SensorBatchingTests#testPressure* CtsSensorTestCases:android.hardware.cts.SingleSensorTests#testPressure* Test: atest VtsHalSensorsV2_0TargetTest Test: atest VtsHalSensorsV2_1TargetTest Test: atest CtsSensorTestCases Bug: 169548171 Change-Id: I2e8ab93d6174c6191497436bf7e7c6a43d34de3f
2020-11-13Fix VTS SensorsHidl Test FailuresKarthik Bharadwaj
This CL fixes test failures by: - Remove the deprecated 'Device Temperature' sensor from the sensor list - Ignoring the deprecated 'Device Temperature' sensor type for tests - Only accessing shared memory buffer if the shared memory type is supported - Return a default z-axis data value for the accel sensor type. - Update the batch() functions argument to take an int64 timestamp to adhere to the interface Bug: 171940270 Test: run vts -a x86 -m VtsHalSensorsV2_0TargetTest Change-Id: I88fe8746030f42edd620f9891aa44bc228a73426
2020-02-18Add Hinge Angle Sensor to default impl for HAL 2.1Anthony Stange
Bug: 144139857 Test: Verify this type is exposed when VTS is run Change-Id: I994f1b4c77729b76760b7cafc19b825c98ca97ca
2020-02-18Add default impl of Sensors HAL 2.1Anthony Stange
Create a default implementation of HAL 2.1 that shares 90% of the underlying code with HAL 2.0 since the interfaces are very similar. Bug: 144139857 Test: compile Change-Id: Ic6b139df98ddb1f92833b1f2d65e1cecc297fd41