Loading system/common/metrics.cc +1 −3 Original line number Diff line number Diff line Loading @@ -904,17 +904,15 @@ void LogManufacturerInfo(const RawAddress& address, void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, uint32_t vendor_error_code) { std::string obfuscated_id; int metric_id = 0; if (!address.IsEmpty()) { obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address); metric_id = MetricIdAllocator::GetInstance().AllocateId(address); } // nullptr and size 0 represent missing value for obfuscated_id android::util::BytesField obfuscated_id_field( address.IsEmpty() ? nullptr : obfuscated_id.c_str(), address.IsEmpty() ? 0 : obfuscated_id.size()); int ret = android::util::stats_write( android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, metric_id, android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, 0, obfuscated_id_field, error_code, vendor_error_code); if (ret < 0) { LOG(WARNING) << __func__ << ": failed for " << address << ", error_code " Loading system/gd/hci/controller.cc +1 −0 Original line number Diff line number Diff line Loading @@ -655,6 +655,7 @@ struct Controller::impl { OP_CODE_MAPPING(WRITE_SIMPLE_PAIRING_DEBUG_MODE) OP_CODE_MAPPING(REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY) OP_CODE_MAPPING(SEND_KEYPRESS_NOTIFICATION) OP_CODE_MAPPING(SET_EVENT_MASK_PAGE_2) OP_CODE_MAPPING(IO_CAPABILITY_REQUEST_NEGATIVE_REPLY) OP_CODE_MAPPING(REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY) OP_CODE_MAPPING(READ_ENCRYPTION_KEY_SIZE) Loading system/gd/hci/hci_layer.cc +3 −1 Original line number Diff line number Diff line Loading @@ -278,13 +278,15 @@ struct HciLayer::impl { } void handle_root_inflammation(uint8_t vse_error_reason) { LOG_ERROR("Received a Root Inflammation Event vendor reason 0x%02hhx, scheduling an abort", vse_error_reason); bluetooth::os::LogMetricBluetoothHalCrashReason(Address::kEmpty, 0, vse_error_reason); // Add Logging for crash reason if (hci_timeout_alarm_ != nullptr) { hci_timeout_alarm_->Cancel(); delete hci_timeout_alarm_; hci_timeout_alarm_ = nullptr; } LOG_ERROR("Received a Root Inflammation Event, scheduling an abort"); if (hci_abort_alarm_ == nullptr) { hci_abort_alarm_ = new Alarm(module_.GetHandler()); hci_abort_alarm_->Schedule(BindOnce(&abort_after_root_inflammation, vse_error_reason), kHciTimeoutRestartMs); Loading system/gd/hci/hci_packets.pdl +4 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,9 @@ enum OpCode : 16 { ENHANCED_FLUSH = 0x0C5F, SEND_KEYPRESS_NOTIFICATION = 0x0C60, // Allow stacks to disable AMP events SET_EVENT_MASK_PAGE_2 = 0x0C63, READ_LE_HOST_SUPPORT = 0x0C6C, WRITE_LE_HOST_SUPPORT = 0x0C6D, Loading Loading @@ -515,6 +518,7 @@ enum OpCodeIndex : 16 { SEND_KEYPRESS_NOTIFICATION = 202, IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 203, READ_ENCRYPTION_KEY_SIZE = 204, SET_EVENT_MASK_PAGE_2 = 222, READ_DATA_BLOCK_SIZE = 232, READ_LE_HOST_SUPPORT = 245, WRITE_LE_HOST_SUPPORT = 246, Loading system/gd/os/android/metrics.cc +20 −0 Original line number Diff line number Diff line Loading @@ -406,5 +406,25 @@ void LogMetricManufacturerInfo( } } void LogMetricBluetoothHalCrashReason( const Address& address, uint32_t error_code, uint32_t vendor_error_code) { int ret = android::util::stats_write( android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, 0 /* metric_id */, byteField, error_code, vendor_error_code); if (ret < 0) { LOG_WARN( "Failed for %s, error_code %s, vendor_error_code %s, error %d", address.ToString().c_str(), common::ToHexString(error_code).c_str(), common::ToHexString(vendor_error_code).c_str(), ret); } } } // namespace os } // namespace bluetooth Loading
system/common/metrics.cc +1 −3 Original line number Diff line number Diff line Loading @@ -904,17 +904,15 @@ void LogManufacturerInfo(const RawAddress& address, void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, uint32_t vendor_error_code) { std::string obfuscated_id; int metric_id = 0; if (!address.IsEmpty()) { obfuscated_id = AddressObfuscator::GetInstance()->Obfuscate(address); metric_id = MetricIdAllocator::GetInstance().AllocateId(address); } // nullptr and size 0 represent missing value for obfuscated_id android::util::BytesField obfuscated_id_field( address.IsEmpty() ? nullptr : obfuscated_id.c_str(), address.IsEmpty() ? 0 : obfuscated_id.size()); int ret = android::util::stats_write( android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, metric_id, android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, 0, obfuscated_id_field, error_code, vendor_error_code); if (ret < 0) { LOG(WARNING) << __func__ << ": failed for " << address << ", error_code " Loading
system/gd/hci/controller.cc +1 −0 Original line number Diff line number Diff line Loading @@ -655,6 +655,7 @@ struct Controller::impl { OP_CODE_MAPPING(WRITE_SIMPLE_PAIRING_DEBUG_MODE) OP_CODE_MAPPING(REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY) OP_CODE_MAPPING(SEND_KEYPRESS_NOTIFICATION) OP_CODE_MAPPING(SET_EVENT_MASK_PAGE_2) OP_CODE_MAPPING(IO_CAPABILITY_REQUEST_NEGATIVE_REPLY) OP_CODE_MAPPING(REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY) OP_CODE_MAPPING(READ_ENCRYPTION_KEY_SIZE) Loading
system/gd/hci/hci_layer.cc +3 −1 Original line number Diff line number Diff line Loading @@ -278,13 +278,15 @@ struct HciLayer::impl { } void handle_root_inflammation(uint8_t vse_error_reason) { LOG_ERROR("Received a Root Inflammation Event vendor reason 0x%02hhx, scheduling an abort", vse_error_reason); bluetooth::os::LogMetricBluetoothHalCrashReason(Address::kEmpty, 0, vse_error_reason); // Add Logging for crash reason if (hci_timeout_alarm_ != nullptr) { hci_timeout_alarm_->Cancel(); delete hci_timeout_alarm_; hci_timeout_alarm_ = nullptr; } LOG_ERROR("Received a Root Inflammation Event, scheduling an abort"); if (hci_abort_alarm_ == nullptr) { hci_abort_alarm_ = new Alarm(module_.GetHandler()); hci_abort_alarm_->Schedule(BindOnce(&abort_after_root_inflammation, vse_error_reason), kHciTimeoutRestartMs); Loading
system/gd/hci/hci_packets.pdl +4 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,9 @@ enum OpCode : 16 { ENHANCED_FLUSH = 0x0C5F, SEND_KEYPRESS_NOTIFICATION = 0x0C60, // Allow stacks to disable AMP events SET_EVENT_MASK_PAGE_2 = 0x0C63, READ_LE_HOST_SUPPORT = 0x0C6C, WRITE_LE_HOST_SUPPORT = 0x0C6D, Loading Loading @@ -515,6 +518,7 @@ enum OpCodeIndex : 16 { SEND_KEYPRESS_NOTIFICATION = 202, IO_CAPABILITY_REQUEST_NEGATIVE_REPLY = 203, READ_ENCRYPTION_KEY_SIZE = 204, SET_EVENT_MASK_PAGE_2 = 222, READ_DATA_BLOCK_SIZE = 232, READ_LE_HOST_SUPPORT = 245, WRITE_LE_HOST_SUPPORT = 246, Loading
system/gd/os/android/metrics.cc +20 −0 Original line number Diff line number Diff line Loading @@ -406,5 +406,25 @@ void LogMetricManufacturerInfo( } } void LogMetricBluetoothHalCrashReason( const Address& address, uint32_t error_code, uint32_t vendor_error_code) { int ret = android::util::stats_write( android::util::BLUETOOTH_HAL_CRASH_REASON_REPORTED, 0 /* metric_id */, byteField, error_code, vendor_error_code); if (ret < 0) { LOG_WARN( "Failed for %s, error_code %s, vendor_error_code %s, error %d", address.ToString().c_str(), common::ToHexString(error_code).c_str(), common::ToHexString(vendor_error_code).c_str(), ret); } } } // namespace os } // namespace bluetooth