1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-28 04:44:30 +00:00
treble_evolution/patches/trebledroid/platform_hardware_interfaces/0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch
2024-03-10 06:48:11 +00:00

29 lines
1.1 KiB
Diff

From 70e2131690533463ea51b8d9c3beb52c3f33c7c1 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 24 Oct 2023 04:59:57 -0400
Subject: [PATCH 3/3] Fix crash on Samsung S23 using stock properties, because
of sensor reporting vec3 instead of scalar. Likely the device orientation
sensor
---
sensors/aidl/convert/convert.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sensors/aidl/convert/convert.cpp b/sensors/aidl/convert/convert.cpp
index be3833dfa..c56b30475 100644
--- a/sensors/aidl/convert/convert.cpp
+++ b/sensors/aidl/convert/convert.cpp
@@ -167,6 +167,9 @@ void convertToSensorEvent(const Event& src, sensors_event_t* dst) {
auto dstr = ::android::internal::ToString(d);
// ALOGE("Received 6DOF for expected scalar %s", dstr.c_str());
dst->data[0] = d.values[0];
+ } else if (src.payload.getTag() == Event::EventPayload::vec3) {
+ auto d = src.payload.get<Event::EventPayload::vec3>();
+ dst->data[0] = d.x;
} else {
dst->data[0] = src.payload.get<Event::EventPayload::scalar>();
}
--
2.25.1