1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-28 03:34:31 +00:00
treble_evolution/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch
2024-03-10 06:48:11 +00:00

36 lines
1.5 KiB
Diff

From 0158db9621be2e9282ca9cbac01a690bc002b68e 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/11] 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 0a64a1c4a8..425091805b 100644
--- a/services/inputflinger/reader/InputDevice.cpp
+++ b/services/inputflinger/reader/InputDevice.cpp
@@ -264,7 +264,10 @@ std::list<NotifyArgs> InputDevice::configure(nsecs_t when,
mAssociatedDisplayUniqueId = std::nullopt;
mAssociatedViewport = std::nullopt;
// 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.portAssociations;
--
2.25.1