summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2024-04-02 03:34:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-04-02 03:34:24 +0000
commit71af4029bf44eec499c245b7405c6351d367423d (patch)
treefe45bcff706ae6315da2fa56ff9ef121dba72b45
parent0f713677e08e871abe3ebade263447f0e2ee91c3 (diff)
parentee76c372f58cce87d863333ad46c04b219c05566 (diff)
Merge "Move check for secure windows to InputTracer" into main
-rw-r--r--services/inputflinger/dispatcher/InputDispatcher.cpp7
-rw-r--r--services/inputflinger/dispatcher/trace/InputTracer.cpp12
2 files changed, 10 insertions, 9 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index fa62fa41d5..4389d6528c 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -838,13 +838,6 @@ Result<void> validateWindowInfosUpdate(const gui::WindowInfosUpdate& update) {
if (!inserted) {
return Error() << "Duplicate entry for " << info;
}
- if (info.layoutParamsFlags.test(WindowInfo::Flag::SECURE) &&
- !info.inputConfig.test(WindowInfo::InputConfig::NOT_VISIBLE) &&
- !info.inputConfig.test(WindowInfo::InputConfig::SENSITIVE_FOR_TRACING)) {
- return Error()
- << "Window with FLAG_SECURE does not set InputConfig::SENSITIVE_FOR_TRACING: "
- << info;
- }
}
return {};
}
diff --git a/services/inputflinger/dispatcher/trace/InputTracer.cpp b/services/inputflinger/dispatcher/trace/InputTracer.cpp
index f8ee95fa9a..415b696e93 100644
--- a/services/inputflinger/dispatcher/trace/InputTracer.cpp
+++ b/services/inputflinger/dispatcher/trace/InputTracer.cpp
@@ -86,8 +86,16 @@ InputTargetInfo getTargetInfo(const InputTarget& target) {
// This is a global monitor, assume its target is the system.
return {.uid = gui::Uid{AID_SYSTEM}, .isSecureWindow = false};
}
- const bool isSensitiveTarget = target.windowHandle->getInfo()->inputConfig.test(
- gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING);
+ const auto& info = *target.windowHandle->getInfo();
+ const bool isSensitiveTarget =
+ info.inputConfig.test(gui::WindowInfo::InputConfig::SENSITIVE_FOR_TRACING);
+
+ // All FLAG_SECURE targets must be marked as sensitive for tracing.
+ if (info.layoutParamsFlags.test(gui::WindowInfo::Flag::SECURE) && !isSensitiveTarget) {
+ LOG(FATAL)
+ << "Input target with FLAG_SECURE does not set InputConfig::SENSITIVE_FOR_TRACING: "
+ << info;
+ }
return {target.windowHandle->getInfo()->ownerUid, isSensitiveTarget};
}