mirror of
https://github.com/ponces/treble_aosp.git
synced 2024-11-22 04:16:14 +00:00
36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
From 6dcdf89f11eeb4af174a07c966e902c523ba265c 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/14] 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 4d8ffb68bb..1d041e1498 100644
|
|
--- a/services/inputflinger/reader/InputDevice.cpp
|
|
+++ b/services/inputflinger/reader/InputDevice.cpp
|
|
@@ -272,7 +272,10 @@ std::list<NotifyArgs> InputDevice::configureInternal(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.34.1
|
|
|