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

Commit e6424fc6 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

GD Metrics: Check if RawAddress is null before converting am: 0e54b03c

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1653710

Change-Id: I1092a84129bd0a0dae7ff99fb4614f4ab57181c9
parents 592d8c12 0e54b03c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -14,13 +14,10 @@
 * limitations under the License.
 */

#include <mutex>

#include "gd/common/metrics.h"
#include "gd/hci/address.h"
#include "main/shim/helpers.h"
#include "main/shim/metrics_api.h"
#include "main/shim/shim.h"
#include "types/raw_address.h"

using bluetooth::hci::Address;
@@ -32,10 +29,13 @@ void LogMetricLinkLayerConnectionEvent(
    android::bluetooth::DirectionEnum direction, uint16_t link_type,
    uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
    uint16_t cmd_status, uint16_t reason_code) {
  Address address = bluetooth::ToGdAddress(*raw_address);
  Address address = Address::kEmpty;
  if (raw_address != nullptr) {
    address = bluetooth::ToGdAddress(*raw_address);
  }
  bluetooth::common::LogMetricLinkLayerConnectionEvent(
      &address, connection_handle, direction, link_type, hci_cmd, hci_event,
      hci_ble_event, cmd_status, reason_code);
      raw_address == nullptr ? nullptr : &address, connection_handle, direction,
      link_type, hci_cmd, hci_event, hci_ble_event, cmd_status, reason_code);
}

void LogMetricA2dpAudioUnderrunEvent(const RawAddress& raw_address,