diff options
| author | 2025-03-08 16:09:49 -0800 | |
|---|---|---|
| committer | 2025-03-08 16:09:49 -0800 | |
| commit | 32ab7738564ffb5f327d2e70f7a8286584f7153f (patch) | |
| tree | 2d698f7db968ce5ebb03271b94a7488e3bfdd239 /services/inputflinger/InputDeviceMetricsSource.cpp | |
| parent | 4b89f17ef1ba81b6822607760d1a83d069bf8533 (diff) | |
| parent | cadcf50fd804adb2765fd622c3d23589138d5a42 (diff) | |
Merge 25Q1 (ab/BP1A.250305.020) to AOSP main
Bug: 385190204
Merged-In: Ib562fdc672f09e92c646583840c324ad50e2fa39
Change-Id: Ie21212b27d78e41c9dacbfab510925d29653cfeb
Diffstat (limited to 'services/inputflinger/InputDeviceMetricsSource.cpp')
| -rw-r--r-- | services/inputflinger/InputDeviceMetricsSource.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/services/inputflinger/InputDeviceMetricsSource.cpp b/services/inputflinger/InputDeviceMetricsSource.cpp index dee4cb836e..70262fbb04 100644 --- a/services/inputflinger/InputDeviceMetricsSource.cpp +++ b/services/inputflinger/InputDeviceMetricsSource.cpp @@ -50,6 +50,18 @@ InputDeviceUsageSource getUsageSourceForKeyArgs(int32_t keyboardType, return InputDeviceUsageSource::BUTTONS; } +std::set<InputDeviceUsageSource> getUsageSourcesForKeyArgs( + const NotifyKeyArgs& args, const std::vector<InputDeviceInfo>& inputDevices) { + int32_t keyboardType = AINPUT_KEYBOARD_TYPE_NONE; + for (const InputDeviceInfo& inputDevice : inputDevices) { + if (args.deviceId == inputDevice.getId()) { + keyboardType = inputDevice.getKeyboardType(); + break; + } + } + return std::set{getUsageSourceForKeyArgs(keyboardType, args)}; +} + std::set<InputDeviceUsageSource> getUsageSourcesForMotionArgs(const NotifyMotionArgs& motionArgs) { LOG_ALWAYS_FATAL_IF(motionArgs.getPointerCount() < 1, "Received motion args without pointers"); std::set<InputDeviceUsageSource> sources; |