2018-08-19 21:38:29 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-08-19 21:38:29 +00:00
|
|
|
|
2021-12-10 02:22:16 +00:00
|
|
|
#include "Common/AndroidAnalytics.h"
|
|
|
|
|
2018-08-19 21:38:29 +00:00
|
|
|
#include <functional>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace Common
|
|
|
|
{
|
2022-01-06 11:20:09 +00:00
|
|
|
static std::function<void(std::string, std::string)> s_android_send_report;
|
|
|
|
|
2018-08-19 21:38:29 +00:00
|
|
|
void AndroidSetReportHandler(std::function<void(std::string, std::string)> func)
|
|
|
|
{
|
|
|
|
s_android_send_report = std::move(func);
|
|
|
|
}
|
2022-01-06 11:20:09 +00:00
|
|
|
|
2018-08-19 21:38:29 +00:00
|
|
|
AndroidAnalyticsBackend::AndroidAnalyticsBackend(std::string passed_endpoint)
|
|
|
|
: m_endpoint{std::move(passed_endpoint)}
|
|
|
|
{
|
|
|
|
}
|
2022-01-06 11:20:09 +00:00
|
|
|
|
2018-08-19 21:38:29 +00:00
|
|
|
AndroidAnalyticsBackend::~AndroidAnalyticsBackend() = default;
|
|
|
|
|
|
|
|
void AndroidAnalyticsBackend::Send(std::string report)
|
|
|
|
{
|
|
|
|
s_android_send_report(m_endpoint, report);
|
|
|
|
}
|
|
|
|
} // namespace Common
|