summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins
diff options
context:
space:
mode:
authorAlexander <akutsan@luxoft.com>2018-06-18 11:42:07 +0300
committerIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2018-06-26 12:01:48 +0300
commit88a170ad527e44038f2e219216ae1d4a80c39b0c (patch)
tree4d97010d164cc75cd07c65b622486d5c55b23305 /src/components/application_manager/rpc_plugins
parentdce0fadc0a263120e0346780b7fbbed89867a0a6 (diff)
downloadsdl_core-88a170ad527e44038f2e219216ae1d4a80c39b0c.tar.gz
fixup! Move IsSubsscrbedTo to plugin
Diffstat (limited to 'src/components/application_manager/rpc_plugins')
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc7
-rw-r--r--src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc5
3 files changed, 10 insertions, 9 deletions
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
index 55b10bfb11..dc29a477e8 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -361,7 +361,7 @@ struct SubscribedToIVIPredicate {
bool operator()(const ApplicationSharedPtr app) const {
DCHECK_OR_RETURN(app, false);
auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
- return ext.subscribeToVehicleInfo(
+ return ext.isSubscribedToVehicleInfo(
static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_));
}
};
@@ -423,7 +423,10 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions(
}
if (!is_interface_not_available && is_key_enabled) {
mobile_apis::VehicleDataType::eType key_type = it->second;
- if (app->IsSubscribedToIVI(key_type)) {
+ const auto is_subscribed =
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .isSubscribedToVehicleInfo(key_type);
+ if (is_subscribed) {
LOG4CXX_DEBUG(logger_,
"App with connection key "
<< connection_key()
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
index c209288f8c..e966a3791c 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/unsubscribe_vehicle_data_request.cc
@@ -145,7 +145,10 @@ void UnsubscribeVehicleDataRequest::Run() {
++items_to_unsubscribe;
mobile_apis::VehicleDataType::eType key_type = it->second;
- if (!app->IsSubscribedToIVI(key_type)) {
+ const auto is_subscribed =
+ VehicleInfoAppExtension::ExtractVIExtension(*app)
+ .isSubscribedToVehicleInfo(key_type);
+ if (!is_subscribed) {
++unsubscribed_items;
vi_already_unsubscribed_by_this_app_.insert(key_type);
response_params[key_name][strings::data_type] = key_type;
@@ -381,7 +384,7 @@ struct SubscribedToIVIPredicate {
bool operator()(const ApplicationSharedPtr app) const {
DCHECK_OR_RETURN(app, false);
auto& ext = VehicleInfoAppExtension::ExtractVIExtension(*app);
- return ext.subscribeToVehicleInfo(
+ return ext.isSubscribedToVehicleInfo(
static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_));
}
};
diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
index bd0dfa9efc..371ea98618 100644
--- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -198,9 +198,6 @@ void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() {
EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
- EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
- .WillRepeatedly(Return(true));
-
EXPECT_CALL(
mock_rpc_service_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
@@ -227,8 +224,6 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
- EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
- .WillRepeatedly(Return(false));
EXPECT_CALL(
mock_rpc_service_,