0
0
mirror of https://github.com/ponces/treble_aosp.git synced 2025-04-17 03:35:59 +00:00
Files
treble_aosp/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch
2025-04-12 10:17:26 +00:00

36 lines
1.5 KiB
Diff

From 377797ce5e93e7219ac74b0fd02c69a888a34567 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 22 Oct 2020 23:22:46 +0200
Subject: [PATCH 02/15] Matching an input with a display uses uniqueId
Not all devices have a `location`, notably bluetooth devices.
However, we might still want to associate them with a screen,
so match them with uniqueId indeed.
This is useful to have bluetooth keyboard in desktop mode for instance.
Change-Id: Ifcbc8329d54386f58e013270d9888316c0f516b6
---
services/inputflinger/reader/InputDevice.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/services/inputflinger/reader/InputDevice.cpp b/services/inputflinger/reader/InputDevice.cpp
index 5e42d57f06..e0717f258c 100644
--- a/services/inputflinger/reader/InputDevice.cpp
+++ b/services/inputflinger/reader/InputDevice.cpp
@@ -304,7 +304,10 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when,
}
}
// Find the display port that corresponds to the current input port.
- const std::string& inputPort = mIdentifier.location;
+ std::string inputPort = mIdentifier.location;
+ if (inputPort.empty()) {
+ inputPort = mIdentifier.uniqueId;
+ }
if (!inputPort.empty()) {
const std::unordered_map<std::string, uint8_t>& ports =
readerConfig.inputPortToDisplayPortAssociations;
--
2.43.0