Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71af4029 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Android (Google) Code Review
Browse files

Merge "Move check for secure windows to InputTracer" into main

parents 0f713677 ee76c372
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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 {};
}
+10 −2
Original line number Diff line number Diff line
@@ -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};
}