lineage_patches_unified/patches/platform_frameworks_native/0005-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch
2019-10-23 09:02:48 +00:00

38 lines
1.3 KiB
Diff

From fd7365352954e1ab647fca2eefeaa2707d47f7fa Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 14 Aug 2019 23:37:10 +0200
Subject: [PATCH 5/5] On Samsung, we need to send a hack-message to HAL to get
all Sensors
Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376
---
services/sensorservice/SensorDevice.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index 717f31769..45d6c679b 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -30,7 +30,9 @@
#include <cinttypes>
#include <thread>
+#include <android-base/properties.h>
using namespace android::hardware::sensors;
+
using namespace android::hardware::sensors::V1_0;
using namespace android::hardware::sensors::V1_0::implementation;
using android::hardware::sensors::V2_0::ISensorsCallback;
@@ -115,6 +117,8 @@ SensorDevice::SensorDevice()
void SensorDevice::initializeSensorList() {
float minPowerMa = 0.001; // 1 microAmp
+ if(::android::base::GetBoolProperty("persist.sys.phh.samsung_sensors", false))
+ setMode(5555);
checkReturn(mSensors->getSensorsList(
[&](const auto &list) {
const size_t count = list.size();
--
2.17.1