blob: 63f5c97cb10af6c14ec9811695df7c4db0c92754 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/developer/feedback/feedback_agent/annotations.h"
#include "src/developer/feedback/feedback_agent/annotations/annotation_provider_factory.h"
#include "src/lib/syslog/cpp/logger.h"
namespace feedback {
using fuchsia::feedback::Annotation;
std::vector<fit::promise<std::vector<Annotation>>> GetAnnotations(
async_dispatcher_t* dispatcher, std::shared_ptr<sys::ServiceDirectory> services,
const std::set<std::string>& allowlist, zx::duration timeout, Cobalt* cobalt) {
if (allowlist.empty()) {
FX_LOGS(WARNING) << "Annotation allowlist is empty, nothing to retrieve";
return {};
}
std::vector<fit::promise<std::vector<Annotation>>> annotation_promises;
for (auto& provider : GetProviders(allowlist, dispatcher, services, timeout, cobalt)) {
annotation_promises.push_back(provider->GetAnnotations());
}
return annotation_promises;
}
} // namespace feedback