Metrics collector: Log a separate bus for USI styluses
For USI styluses, Vendor IDs are assigned by USI, and are different from
the Vendor IDs for USB devices. Therefore, to identify a device from its
VID/PID, we need to know whether it is reporting USB product/vendor IDs
or USI ones.
Here, we introduce USI as a new bus enum value for metrics purposes.
This way, we can differentiate product identifiers based on the bus
through which it is using.
Bug: 299645968
Test: atest inputflinger_tests
Change-Id: I954e5a7c3db7d1ae3d0c6906923848fe5ced84f1
diff --git a/services/inputflinger/InputDeviceMetricsCollector.h b/services/inputflinger/InputDeviceMetricsCollector.h
index c70e6d4..1f7c5d9 100644
--- a/services/inputflinger/InputDeviceMetricsCollector.h
+++ b/services/inputflinger/InputDeviceMetricsCollector.h
@@ -110,8 +110,7 @@
UidUsageBreakdown uidBreakdown;
};
- virtual void logInputDeviceUsageReported(const InputDeviceIdentifier&,
- const DeviceUsageReport&) = 0;
+ virtual void logInputDeviceUsageReported(const InputDeviceInfo&, const DeviceUsageReport&) = 0;
virtual ~InputDeviceMetricsLogger() = default;
};
@@ -189,7 +188,7 @@
std::map<DeviceId, ActiveSession> mActiveUsageSessions;
void onInputDevicesChanged(const std::vector<InputDeviceInfo>& infos);
- void onInputDeviceRemoved(DeviceId deviceId, const InputDeviceIdentifier& identifier);
+ void onInputDeviceRemoved(DeviceId deviceId, const InputDeviceInfo& info);
using SourceProvider = std::function<std::set<InputDeviceUsageSource>(const InputDeviceInfo&)>;
void onInputDeviceUsage(DeviceId deviceId, std::chrono::nanoseconds eventTime,
const SourceProvider& getSources);