From f243631af8c5c5f90ad3e5aed35a5b182296451f Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 7 Oct 2016 09:21:42 -0700 Subject: [PATCH] wifi: Invoke failure callbacks Invoke the failure callbacks for |requestChipDebugInfo|, |requestDriverDebugDump| and |requestFirmwareDebugDump| methods. Bug: 32014425 Test: Compiles Change-Id: I49b8ae93fe846df6d9663b10d2a70eb89bd00931 --- wifi/1.0/default/wifi_chip.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.0/default/wifi_chip.cpp index 82dce942d0..4dd020b592 100644 --- a/wifi/1.0/default/wifi_chip.cpp +++ b/wifi/1.0/default/wifi_chip.cpp @@ -113,6 +113,11 @@ Return WifiChip::requestChipDebugInfo() { if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get driver version: " << LegacyErrorToString(ret.first); + FailureReason reason = CreateFailureReasonLegacyError( + ret.first, " failed to get driver version"); + for (const auto& callback : callbacks_) { + callback->onChipDebugInfoFailure(reason); + } return Void(); } result.driverDescription = ret.second.c_str(); @@ -121,6 +126,11 @@ Return WifiChip::requestChipDebugInfo() { if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware version: " << LegacyErrorToString(ret.first); + FailureReason reason = CreateFailureReasonLegacyError( + ret.first, " failed to get firmware version"); + for (const auto& callback : callbacks_) { + callback->onChipDebugInfoFailure(reason); + } return Void(); } result.firmwareDescription = ret.second.c_str(); @@ -140,6 +150,10 @@ Return WifiChip::requestDriverDebugDump() { if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get driver debug dump: " << LegacyErrorToString(ret.first); + FailureReason reason = CreateFailureReasonLegacyError(ret.first, ""); + for (const auto& callback : callbacks_) { + callback->onDriverDebugDumpFailure(reason); + } return Void(); } @@ -162,6 +176,10 @@ Return WifiChip::requestFirmwareDebugDump() { if (ret.first != WIFI_SUCCESS) { LOG(ERROR) << "Failed to get firmware debug dump: " << LegacyErrorToString(ret.first); + FailureReason reason = CreateFailureReasonLegacyError(ret.first, ""); + for (const auto& callback : callbacks_) { + callback->onFirmwareDebugDumpFailure(reason); + } return Void(); }