Loading services/inputflinger/include/InputReaderBase.h +3 −3 Original line number Diff line number Diff line Loading @@ -106,15 +106,15 @@ struct InputReaderConfiguration { // The associations between input ports and display ports. // Used to determine which DisplayViewport should be tied to which InputDevice. std::unordered_map<std::string, uint8_t> portAssociations; std::unordered_map<std::string, uint8_t> inputPortToDisplayPortAssociations; // The associations between input device ports and display unique ids. // Used to determine which DisplayViewport should be tied to which InputDevice. std::unordered_map<std::string, std::string> uniqueIdAssociationsByPort; std::unordered_map<std::string, std::string> inputPortToDisplayUniqueIdAssociations; // The associations between input device descriptor and display unique ids. // Used to determine which DisplayViewport should be tied to which InputDevice. std::unordered_map<std::string, std::string> uniqueIdAssociationsByDescriptor; std::unordered_map<std::string, std::string> inputDeviceDescriptorToDisplayUniqueIdAssociations; // The associations between input device ports device types. // This is used to determine which device type and source should be tied to which InputDevice. Loading services/inputflinger/reader/InputDevice.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -281,14 +281,14 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, const std::string& inputDeviceDescriptor = mIdentifier.descriptor; if (!inputDeviceDescriptor.empty()) { const std::unordered_map<std::string, uint8_t>& ports = readerConfig.portAssociations; readerConfig.inputPortToDisplayPortAssociations; const auto& displayPort = ports.find(inputDeviceDescriptor); if (displayPort != ports.end()) { mAssociatedDisplayPort = std::make_optional(displayPort->second); } else { const std::unordered_map<std::string, std::string>& displayUniqueIdsByDescriptor = readerConfig.uniqueIdAssociationsByDescriptor; readerConfig.inputDeviceDescriptorToDisplayUniqueIdAssociations; const auto& displayUniqueIdByDescriptor = displayUniqueIdsByDescriptor.find(inputDeviceDescriptor); if (displayUniqueIdByDescriptor != displayUniqueIdsByDescriptor.end()) { Loading @@ -301,13 +301,13 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, const std::string& inputPort = mIdentifier.location; if (!inputPort.empty()) { const std::unordered_map<std::string, uint8_t>& ports = readerConfig.portAssociations; readerConfig.inputPortToDisplayPortAssociations; const auto& displayPort = ports.find(inputPort); if (displayPort != ports.end()) { mAssociatedDisplayPort = std::make_optional(displayPort->second); } else { const std::unordered_map<std::string, std::string>& displayUniqueIdsByPort = readerConfig.uniqueIdAssociationsByPort; readerConfig.inputPortToDisplayUniqueIdAssociations; const auto& displayUniqueIdByPort = displayUniqueIdsByPort.find(inputPort); if (displayUniqueIdByPort != displayUniqueIdsByPort.end()) { mAssociatedDisplayUniqueIdByPort = displayUniqueIdByPort->second; Loading services/inputflinger/tests/FakeInputReaderPolicy.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ void FakeInputReaderPolicy::addExcludedDeviceName(const std::string& deviceName) void FakeInputReaderPolicy::addInputPortAssociation(const std::string& inputPort, uint8_t displayPort) { mConfig.portAssociations.insert({inputPort, displayPort}); mConfig.inputPortToDisplayPortAssociations.insert({inputPort, displayPort}); } void FakeInputReaderPolicy::addDeviceTypeAssociation(const std::string& inputPort, Loading @@ -139,7 +139,7 @@ void FakeInputReaderPolicy::addDeviceTypeAssociation(const std::string& inputPor void FakeInputReaderPolicy::addInputUniqueIdAssociation(const std::string& inputUniqueId, const std::string& displayUniqueId) { mConfig.uniqueIdAssociationsByPort.insert({inputUniqueId, displayUniqueId}); mConfig.inputPortToDisplayUniqueIdAssociations.insert({inputUniqueId, displayUniqueId}); } void FakeInputReaderPolicy::addKeyboardLayoutAssociation(const std::string& inputUniqueId, Loading Loading
services/inputflinger/include/InputReaderBase.h +3 −3 Original line number Diff line number Diff line Loading @@ -106,15 +106,15 @@ struct InputReaderConfiguration { // The associations between input ports and display ports. // Used to determine which DisplayViewport should be tied to which InputDevice. std::unordered_map<std::string, uint8_t> portAssociations; std::unordered_map<std::string, uint8_t> inputPortToDisplayPortAssociations; // The associations between input device ports and display unique ids. // Used to determine which DisplayViewport should be tied to which InputDevice. std::unordered_map<std::string, std::string> uniqueIdAssociationsByPort; std::unordered_map<std::string, std::string> inputPortToDisplayUniqueIdAssociations; // The associations between input device descriptor and display unique ids. // Used to determine which DisplayViewport should be tied to which InputDevice. std::unordered_map<std::string, std::string> uniqueIdAssociationsByDescriptor; std::unordered_map<std::string, std::string> inputDeviceDescriptorToDisplayUniqueIdAssociations; // The associations between input device ports device types. // This is used to determine which device type and source should be tied to which InputDevice. Loading
services/inputflinger/reader/InputDevice.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -281,14 +281,14 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, const std::string& inputDeviceDescriptor = mIdentifier.descriptor; if (!inputDeviceDescriptor.empty()) { const std::unordered_map<std::string, uint8_t>& ports = readerConfig.portAssociations; readerConfig.inputPortToDisplayPortAssociations; const auto& displayPort = ports.find(inputDeviceDescriptor); if (displayPort != ports.end()) { mAssociatedDisplayPort = std::make_optional(displayPort->second); } else { const std::unordered_map<std::string, std::string>& displayUniqueIdsByDescriptor = readerConfig.uniqueIdAssociationsByDescriptor; readerConfig.inputDeviceDescriptorToDisplayUniqueIdAssociations; const auto& displayUniqueIdByDescriptor = displayUniqueIdsByDescriptor.find(inputDeviceDescriptor); if (displayUniqueIdByDescriptor != displayUniqueIdsByDescriptor.end()) { Loading @@ -301,13 +301,13 @@ std::list<NotifyArgs> InputDevice::configureInternal(nsecs_t when, const std::string& inputPort = mIdentifier.location; if (!inputPort.empty()) { const std::unordered_map<std::string, uint8_t>& ports = readerConfig.portAssociations; readerConfig.inputPortToDisplayPortAssociations; const auto& displayPort = ports.find(inputPort); if (displayPort != ports.end()) { mAssociatedDisplayPort = std::make_optional(displayPort->second); } else { const std::unordered_map<std::string, std::string>& displayUniqueIdsByPort = readerConfig.uniqueIdAssociationsByPort; readerConfig.inputPortToDisplayUniqueIdAssociations; const auto& displayUniqueIdByPort = displayUniqueIdsByPort.find(inputPort); if (displayUniqueIdByPort != displayUniqueIdsByPort.end()) { mAssociatedDisplayUniqueIdByPort = displayUniqueIdByPort->second; Loading
services/inputflinger/tests/FakeInputReaderPolicy.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ void FakeInputReaderPolicy::addExcludedDeviceName(const std::string& deviceName) void FakeInputReaderPolicy::addInputPortAssociation(const std::string& inputPort, uint8_t displayPort) { mConfig.portAssociations.insert({inputPort, displayPort}); mConfig.inputPortToDisplayPortAssociations.insert({inputPort, displayPort}); } void FakeInputReaderPolicy::addDeviceTypeAssociation(const std::string& inputPort, Loading @@ -139,7 +139,7 @@ void FakeInputReaderPolicy::addDeviceTypeAssociation(const std::string& inputPor void FakeInputReaderPolicy::addInputUniqueIdAssociation(const std::string& inputUniqueId, const std::string& displayUniqueId) { mConfig.uniqueIdAssociationsByPort.insert({inputUniqueId, displayUniqueId}); mConfig.inputPortToDisplayUniqueIdAssociations.insert({inputUniqueId, displayUniqueId}); } void FakeInputReaderPolicy::addKeyboardLayoutAssociation(const std::string& inputUniqueId, Loading