chromium/device/bluetooth/bluez/metrics_recorder.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "device/bluetooth/bluez/metrics_recorder.h"

#include "base/containers/contains.h"
#include "base/metrics/histogram_functions.h"

namespace bluetooth {
namespace {

// Note: These values must stay in sync with BlueZ's error.c file.
const char kBlueZInvalidArgumentsError[] =;
const char kBlueZInProgressError[] =;
const char kBlueZAlreadyExistsError[] =;
const char kBlueZNotSupportedError[] =;
const char kBlueZNotConnectedError[] =;
const char kBlueZAlreadyConnectedError[] =;
const char kBlueZNotAvailableError[] =;
const char kBlueZDoesNotExistError[] =;
const char kBlueZNotAuthorizedError[] =;
const char kBlueZNotPermittedError[] =;
const char kBlueZNoSuchAdapterError[] =;
const char kBlueZAgentNotAvailableError[] =;
const char kBlueZNotReadyError[] =;
const char kBlueZFailedError[] =;

// Note: These values are sourced from the "BR/EDR connection failure reasons"
// in BlueZ's error.h file, and should be kept in sync.
const char kBlueZConnectionAlreadyConnected[] =;
const char kBlueZPageTimeout[] =;
const char kBlueZProfileUnavailable[] =;
const char kBlueZSdpSearch[] =;
const char kBlueZCreateSocket[] =;
const char kBlueZInvalidArgument[] =;
const char kBlueZAdapterNotPowered[] =;
const char kBlueZNotSupported[] =;
const char kBlueZBadSocket[] =;
const char kBlueZMemoryAllocation[] =;
const char kBlueZBusy[] =;
const char kBlueZConcurrentConnectionLimit[] =;
const char kBlueZTimeout[] =;
const char kBlueZRefused[] =;
const char kBlueZAbortedByRemote[] =;
const char kBlueZAbortedByLocal[] =;
const char kBlueZLmpProtocolError[] =;
const char kBlueZCanceled[] =;
const char kBlueZUnknown[] =;

}  // namespace

std::optional<ConnectToServiceInsecurelyResult> ExtractResultFromErrorString(
    const std::string& error_string) {}

ConnectToServiceFailureReason ExtractFailureReasonFromErrorString(
    const std::string& error_string) {}

void RecordConnectToServiceInsecurelyResult(
    ConnectToServiceInsecurelyResult result) {}

void RecordConnectToServiceFailureReason(ConnectToServiceFailureReason reason) {}

void RecordBondedConnectToServiceFailureReason(
    ConnectToServiceFailureReason reason) {}

}  // namespace bluetooth