Sync up to v119

This commit is contained in:
AndyCGYan
2019-09-03 12:42:00 +00:00
parent 04c4a9e1b3
commit 81616af6df
11 changed files with 1570 additions and 6 deletions

View File

@@ -0,0 +1,31 @@
From 725b2c6c7b45072c96531656711b89bf9b6b502a Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 12 Aug 2019 23:48:37 +0200
Subject: [PATCH 5/6] Some Samsung devices requires lying colorspace
---
opengl/libs/EGL/eglApi.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index c65bddfbb..3cde19af1 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -454,8 +454,14 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
// ----------------------------------------------------------------------------
// Translates EGL color spaces to Android data spaces.
+static int samsungColorspace = -1;
static android_dataspace dataSpaceFromEGLColorSpace(EGLint colorspace) {
+ if(samsungColorspace == -1) {
+ samsungColorspace = property_get_bool("persist.sys.phh.samsung_colorspace", false);
+ }
if (colorspace == EGL_GL_COLORSPACE_LINEAR_KHR) {
+ if(samsungColorspace)
+ return HAL_DATASPACE_UNKNOWN;
return HAL_DATASPACE_SRGB_LINEAR;
} else if (colorspace == EGL_GL_COLORSPACE_SRGB_KHR) {
return HAL_DATASPACE_SRGB;
--
2.17.1

View File

@@ -0,0 +1,35 @@
From 663f83cdb9628315a8501a24d85eee6df707e1ae 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 6/6] On Samsung, we need to send a hack-message to HAL to get
all Sensors
---
services/sensorservice/SensorDevice.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index 115a983bc..7fe05190e 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -26,6 +26,8 @@
#include <cinttypes>
#include <thread>
+#include <android-base/properties.h>
+
using namespace android::hardware::sensors::V1_0;
using namespace android::hardware::sensors::V1_0::implementation;
using android::hardware::hidl_vec;
@@ -59,6 +61,8 @@ SensorDevice::SensorDevice()
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