InputTracer: Use PackageManagerNative to get package UID
... instead of plumbing the call through InputManagerService via JNI.
Bug: 330360505
Test: manual
Test: atest inputflinger_tests
Change-Id: Ie763733d8dba442afcaea7560e6d997c06ca3877
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index d1930f1..5a8e46e 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -88,13 +88,12 @@
}
// Create the input tracing backend that writes to perfetto from a single thread.
-std::unique_ptr<trace::InputTracingBackendInterface> createInputTracingBackendIfEnabled(
- trace::impl::PerfettoBackend::GetPackageUid getPackageUid) {
+std::unique_ptr<trace::InputTracingBackendInterface> createInputTracingBackendIfEnabled() {
if (!isInputTracingEnabled()) {
return nullptr;
}
return std::make_unique<trace::impl::ThreadedBackend<trace::impl::PerfettoBackend>>(
- trace::impl::PerfettoBackend(getPackageUid));
+ trace::impl::PerfettoBackend());
}
template <class Entry>
@@ -904,9 +903,7 @@
// --- InputDispatcher ---
InputDispatcher::InputDispatcher(InputDispatcherPolicyInterface& policy)
- : InputDispatcher(policy, createInputTracingBackendIfEnabled([&policy](std::string pkg) {
- return policy.getPackageUid(pkg);
- })) {}
+ : InputDispatcher(policy, createInputTracingBackendIfEnabled()) {}
InputDispatcher::InputDispatcher(InputDispatcherPolicyInterface& policy,
std::unique_ptr<trace::InputTracingBackendInterface> traceBackend)