1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 08:36:19 +00:00
treble_evolution/patches/platform_frameworks_base/0030-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch
2024-04-24 15:13:17 +00:00

101 lines
4.5 KiB
Diff

From 1174c244ae1acc819b9faf77eb2e4555efc0d637 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 14 Dec 2022 17:21:00 -0500
Subject: [PATCH 30/51] Call Samsung's ISehSysInputDev to report screen state
to touchscreen driver
This fixes touchscreen not waking up on Galaxy F23
---
services/core/Android.bp | 1 +
.../server/display/LocalDisplayAdapter.java | 31 +++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/services/core/Android.bp b/services/core/Android.bp
index f5a80d80f271..575da5d97d0c 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -204,6 +204,7 @@ java_library_static {
"com_android_wm_shell_flags_lib",
"com.android.server.utils_aconfig-java",
"service-jobscheduler-deviceidle.flags-aconfig-java",
+ "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL
],
javac_shard_size: 50,
javacflags: [
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 22898a65c5de..f9dbd91e6b5a 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -35,6 +35,7 @@ import android.os.Trace;
import android.util.DisplayUtils;
import android.util.LongSparseArray;
import android.util.Slog;
+import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
import android.view.DisplayAddress;
@@ -55,6 +56,8 @@ import com.android.server.display.notifications.DisplayNotificationManager;
import com.android.server.lights.LightsManager;
import com.android.server.lights.LogicalLight;
+import vendor.samsung.hardware.sysinput.V1_1.ISehSysInputDev;
+
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
@@ -244,6 +247,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
private float mActiveRenderFrameRate;
private DisplayEventReceiver.FrameRateOverride[] mFrameRateOverrides =
new DisplayEventReceiver.FrameRateOverride[0];
+ private boolean triedSamsungHal = false;
+ private ISehSysInputDev samsungSysinput = null;
LocalDisplayDevice(IBinder displayToken, long physicalDisplayId,
SurfaceControl.StaticDisplayInfo staticDisplayInfo,
@@ -850,16 +855,42 @@ final class LocalDisplayAdapter extends DisplayAdapter {
}
}
+ if (!triedSamsungHal) {
+ triedSamsungHal = true;
+ try {
+ samsungSysinput = ISehSysInputDev.getService();
+ } catch(Throwable t) {}
+ }
final int mode = getPowerModeForState(state);
Trace.traceBegin(Trace.TRACE_TAG_POWER, "setDisplayState("
+ "id=" + physicalDisplayId
+ ", state=" + Display.stateToString(state) + ")");
+
+ if (samsungSysinput != null) {
+ try {
+ Log.d("PHH", "setTspEnable 1, " + state + ", true");
+ samsungSysinput.setTspEnable(1, state, true);
+ } catch(Throwable t) {
+ Log.d("PHH", "Failed settings tsp enable", t);
+ }
+ }
+
try {
mSurfaceControlProxy.setDisplayPowerMode(token, mode);
Trace.traceCounter(Trace.TRACE_TAG_POWER, "DisplayPowerMode", mode);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_POWER);
}
+
+ if (samsungSysinput != null) {
+ try {
+ Log.d("PHH", "setTspEnable 1, " + state + ", false");
+ samsungSysinput.setTspEnable(1, state, false);
+ } catch(Throwable t) {
+ Log.d("PHH", "Failed settings tsp enable", t);
+ }
+ }
+
setCommittedState(state);
// If we're entering a suspended (but not OFF) power state and we
--
2.25.1