summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
diff options
context:
space:
mode:
authordcherniev <dcherniev@github.com>2017-01-04 16:47:49 +0200
committerdcherniev <dcherniev@github.com>2017-01-04 17:07:11 +0200
commit09b37dd3022f6e3bf12f323f14bd5c18f48caaf8 (patch)
tree69536c1f422e87b64c623bc2e41033986d59b578 /src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
parent4ff12fe67f0ed15700fd030690276712ef23659d (diff)
downloadsdl_core-09b37dd3022f6e3bf12f323f14bd5c18f48caaf8.tar.gz
Correct response params in UnSubscribeVehicleData
Corrected response parameters, generated in case when vi interface is not available. Related to: APPLINK-28727
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
index 6902a9d659..9b0c0a673f 100644
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2017, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -201,16 +201,14 @@ void UnsubscribeVehicleDataRequest::Run() {
}
if (is_everything_already_unsubscribed) {
- mobile_apis::Result::eType result_code =
- vi_already_unsubscribed_by_this_app_.size()
- ? mobile_apis::Result::IGNORED
- : mobile_apis::Result::SUCCESS;
-
- const char* info = vi_already_unsubscribed_by_this_app_.size()
- ? "Already subscribed on some provided VehicleData."
- : NULL;
-
- SendResponse(true, result_code, info, &response_params);
+ if (!vi_already_unsubscribed_by_this_app_.empty()) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Some provided VehicleData was not subscribed.",
+ &response_params);
+ } else {
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ }
return;
}