Loading system/gd/os/android/metrics.cc +18 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,10 @@ struct formatter<android::bluetooth::DeviceInfoSrcEnum> template <> struct formatter<android::bluetooth::AddressTypeEnum> : enum_formatter<android::bluetooth::AddressTypeEnum> {}; template <> struct formatter<android::bluetooth::EventType> : enum_formatter<android::bluetooth::EventType> {}; template <> struct formatter<android::bluetooth::State> : enum_formatter<android::bluetooth::State> {}; } // namespace fmt namespace bluetooth { Loading Loading @@ -447,5 +451,19 @@ void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions session_optio } } void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state) { if (address.IsEmpty()) { log::warn("Failed BluetoothEvent Upload - Address is Empty"); return; } int metric_id = MetricIdManager::GetInstance().AllocateId(address); int ret = stats_write(BLUETOOTH_CROSS_LAYER_EVENT_REPORTED, event_type, state, 0, metric_id, 0); if (ret < 0) { log::warn("Failed BluetoothEvent Upload - Address {}, Event_type {}, State {}", address, event_type, state); } } } // namespace os } // namespace bluetooth system/gd/os/chromeos/metrics.cc +3 −0 Original line number Diff line number Diff line Loading @@ -209,5 +209,8 @@ void LogMetricBluetoothLEConnectionMetricEvent( std::vector<std::pair<os::ArgumentType, int>>& argument_list) {} void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {} void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state) {} } // namespace os } // namespace bluetooth system/gd/os/host/metrics.cc +3 −0 Original line number Diff line number Diff line Loading @@ -130,5 +130,8 @@ void LogMetricBluetoothLEConnectionMetricEvent( void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {} void LogMetricBluetoothEvent(const Address& /* address */, android::bluetooth::EventType /* event type */, android::bluetooth::State /* state */) {} } // namespace os } // namespace bluetooth system/gd/os/linux/metrics.cc +3 −0 Original line number Diff line number Diff line Loading @@ -115,5 +115,8 @@ void LogMetricBluetoothLEConnectionMetricEvent( std::vector<std::pair<os::ArgumentType, int>>& argument_list) {} void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {} void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state) {} } // namespace os } // namespace bluetooth system/gd/os/metrics.h +9 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,15 @@ void LogMetricBluetoothLEConnectionMetricEvent( // Upload LE Session void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions session_options); /** * Logs a Bluetooth Event * * @param address address of associated device * @param event_type type of event where this is getting logged from * @param state state associated with the event */ void LogMetricBluetoothEvent(const hci::Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state); } // namespace os // } // namespace bluetooth Loading
system/gd/os/android/metrics.cc +18 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,10 @@ struct formatter<android::bluetooth::DeviceInfoSrcEnum> template <> struct formatter<android::bluetooth::AddressTypeEnum> : enum_formatter<android::bluetooth::AddressTypeEnum> {}; template <> struct formatter<android::bluetooth::EventType> : enum_formatter<android::bluetooth::EventType> {}; template <> struct formatter<android::bluetooth::State> : enum_formatter<android::bluetooth::State> {}; } // namespace fmt namespace bluetooth { Loading Loading @@ -447,5 +451,19 @@ void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions session_optio } } void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state) { if (address.IsEmpty()) { log::warn("Failed BluetoothEvent Upload - Address is Empty"); return; } int metric_id = MetricIdManager::GetInstance().AllocateId(address); int ret = stats_write(BLUETOOTH_CROSS_LAYER_EVENT_REPORTED, event_type, state, 0, metric_id, 0); if (ret < 0) { log::warn("Failed BluetoothEvent Upload - Address {}, Event_type {}, State {}", address, event_type, state); } } } // namespace os } // namespace bluetooth
system/gd/os/chromeos/metrics.cc +3 −0 Original line number Diff line number Diff line Loading @@ -209,5 +209,8 @@ void LogMetricBluetoothLEConnectionMetricEvent( std::vector<std::pair<os::ArgumentType, int>>& argument_list) {} void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {} void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state) {} } // namespace os } // namespace bluetooth
system/gd/os/host/metrics.cc +3 −0 Original line number Diff line number Diff line Loading @@ -130,5 +130,8 @@ void LogMetricBluetoothLEConnectionMetricEvent( void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {} void LogMetricBluetoothEvent(const Address& /* address */, android::bluetooth::EventType /* event type */, android::bluetooth::State /* state */) {} } // namespace os } // namespace bluetooth
system/gd/os/linux/metrics.cc +3 −0 Original line number Diff line number Diff line Loading @@ -115,5 +115,8 @@ void LogMetricBluetoothLEConnectionMetricEvent( std::vector<std::pair<os::ArgumentType, int>>& argument_list) {} void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions /* session_options */) {} void LogMetricBluetoothEvent(const Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state) {} } // namespace os } // namespace bluetooth
system/gd/os/metrics.h +9 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,15 @@ void LogMetricBluetoothLEConnectionMetricEvent( // Upload LE Session void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions session_options); /** * Logs a Bluetooth Event * * @param address address of associated device * @param event_type type of event where this is getting logged from * @param state state associated with the event */ void LogMetricBluetoothEvent(const hci::Address& address, android::bluetooth::EventType event_type, android::bluetooth::State state); } // namespace os // } // namespace bluetooth