Revert "Increase HidRawSensor thread priority to reduce latency"
This reverts commit ae23e944243d531eaba31581cc33b0b49ffeb622.
Reason for revert: Possible culprit of b/300512496
Change-Id: Ia99167aa9c979e8afa69ce64f27d535c9228e414
diff --git a/modules/sensors/dynamic_sensor/HidRawSensorDevice.cpp b/modules/sensors/dynamic_sensor/HidRawSensorDevice.cpp
index 5bc4abc..8aa4cf9 100644
--- a/modules/sensors/dynamic_sensor/HidRawSensorDevice.cpp
+++ b/modules/sensors/dynamic_sensor/HidRawSensorDevice.cpp
@@ -35,15 +35,6 @@
const std::unordered_set<unsigned int> HidRawSensorDevice::sInterested{
ACCELEROMETER_3D, GYROMETER_3D, COMPASS_3D, CUSTOM};
-void HidRawSensorDevice::enableSchedFifoMode() {
- constexpr int kHidRawSensorPriority = 10; // Matches with sensor service priority
- struct sched_param param = {0};
- param.sched_priority = kHidRawSensorPriority;
- if (sched_setscheduler(getTid(), SCHED_FIFO | SCHED_RESET_ON_FORK, ¶m) != 0) {
- ALOGE("Couldn't set SCHED_FIFO for HidRawSensor thread: %s", strerror(errno));
- }
-}
-
sp<HidRawSensorDevice> HidRawSensorDevice::create(const std::string &devName) {
sp<HidRawSensorDevice> device(new HidRawSensorDevice(devName));
// offset +1 strong count added by constructor
@@ -83,8 +74,7 @@
return;
}
- run("HidRawSensor", PRIORITY_URGENT_DISPLAY);
- enableSchedFifoMode();
+ run("HidRawSensor");
mValid = true;
}
diff --git a/modules/sensors/dynamic_sensor/HidRawSensorDevice.h b/modules/sensors/dynamic_sensor/HidRawSensorDevice.h
index 7818bf1..06d435e 100644
--- a/modules/sensors/dynamic_sensor/HidRawSensorDevice.h
+++ b/modules/sensors/dynamic_sensor/HidRawSensorDevice.h
@@ -41,7 +41,6 @@
// constructor will result in +1 strong count
explicit HidRawSensorDevice(const std::string &devName);
- void enableSchedFifoMode();
// implement function of Thread
virtual bool threadLoop() override;
std::unordered_map<unsigned int/*reportId*/, sp<HidRawSensor>> mSensors;