summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kutsan <akutsan@luxoft.com>2017-11-27 18:24:02 +0200
committerAlexander Kutsan <akutsan@luxoft.com>2017-11-27 20:25:42 +0200
commit9ee67118478f2b3ad8ac3504762ad70400ce109f (patch)
treeb326ed34ced97bd82e6d2534e10bcd102b0ebc61
parent7806a8d50caa5081cf1686e465715b1296d3dfe4 (diff)
downloadsdl_core-9ee67118478f2b3ad8ac3504762ad70400ce109f.tar.gz
Use VehicleDataType from MOBILE APi xml imstead of hardcoded values
Delete include of application_manager/vehicle_info_data.h Fix unit tests
-rw-r--r--src/components/application_manager/include/application_manager/application.h4
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h3
-rw-r--r--src/components/application_manager/src/application_impl.cc14
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc4
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc5
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc2
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc77
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc5
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc1
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc12
-rw-r--r--src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc4
-rw-r--r--src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc10
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc3
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h3
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc6
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc4
-rw-r--r--src/components/functional_module/test/include/mock_application.h3
-rw-r--r--src/components/include/application_manager/application_manager.h5
-rw-r--r--src/components/include/application_manager/vehicle_info_data.h71
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h3
-rw-r--r--src/components/remote_control/test/include/mock_application.h3
24 files changed, 105 insertions, 146 deletions
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 3a03cb5343..fdb0c15922 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -161,7 +161,7 @@ typedef std::set<uint32_t> SoftButtonID;
/**
* @brief Defines set of vehicle info types
*/
-typedef std::set<uint32_t> VehicleInfoSubscriptions;
+typedef std::set<mobile_apis::VehicleDataType::eType> VehicleInfoSubscriptions;
/**
* @brief Defines set of buttons subscription
@@ -837,7 +837,7 @@ class Application : public virtual InitialApplicationData,
* @brief Get list of subscriptions to vehicle info notifications
* @return list of subscriptions to vehicle info notifications
*/
- virtual const std::set<uint32_t>& SubscribesIVI() const = 0;
+ virtual const VehicleInfoSubscriptions& SubscribesIVI() const = 0;
#endif // SDL_REMOTE_CONTROL
protected:
diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h
index dc2d8ce528..3304200372 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -331,7 +331,7 @@ class ApplicationImpl : public virtual Application,
* @brief Get list of subscriptions to vehicle info notifications
* @return list of subscriptions to vehicle info notifications
*/
- const std::set<uint32_t>& SubscribesIVI() const OVERRIDE;
+ const VehicleInfoSubscriptions& SubscribesIVI() const OVERRIDE;
/**
* @brief Return pointer to extension by uid
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index 7a26501afc..2f118a7e3f 100644
--- a/src/components/application_manager/include/application_manager/application_manager_impl.h
+++ b/src/components/application_manager/include/application_manager/application_manager_impl.h
@@ -48,7 +48,6 @@
#include "application_manager/message_helper.h"
#include "application_manager/request_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/state_controller_impl.h"
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/application_manager_settings.h"
@@ -349,8 +348,8 @@ class ApplicationManagerImpl
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- std::vector<ApplicationSharedPtr> IviInfoUpdated(VehicleDataType vehicle_info,
- int value) OVERRIDE;
+ std::vector<ApplicationSharedPtr> IviInfoUpdated(
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) OVERRIDE;
void OnApplicationRegistered(ApplicationSharedPtr app) OVERRIDE;
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index c0a3f37c34..a0b70435b0 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -42,7 +42,6 @@
#include "utils/macro.h"
#include "connection_handler/device.h"
#include "application_manager/application.h"
-#include "application_manager/vehicle_info_data.h"
#include "policy/policy_types.h"
#include "protocol_handler/session_observer.h"
#include "application_manager/policies/policy_handler_interface.h"
@@ -61,7 +60,7 @@ namespace mobile_api = mobile_apis;
* @param const char* Name of the parameter in mobile request
* @param VehicleDataType Enum for vehicle data
*/
-typedef std::map<std::string, VehicleDataType> VehicleData;
+typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData;
/**
* @brief MessageHelper class
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 4a752febf8..569880bb56 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -720,19 +720,23 @@ bool ApplicationImpl::UnsubscribeFromButton(
bool ApplicationImpl::SubscribeToIVI(uint32_t vehicle_info_type) {
sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.insert(vehicle_info_type).second;
+ return subscribed_vehicle_info_
+ .insert(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type))
+ .second;
}
bool ApplicationImpl::IsSubscribedToIVI(uint32_t vehicle_info_type) const {
sync_primitives::AutoLock lock(vi_lock_);
- VehicleInfoSubscriptions::const_iterator it =
- subscribed_vehicle_info_.find(vehicle_info_type);
+ VehicleInfoSubscriptions::const_iterator it = subscribed_vehicle_info_.find(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type));
return (subscribed_vehicle_info_.end() != it);
}
bool ApplicationImpl::UnsubscribeFromIVI(uint32_t vehicle_info_type) {
sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.erase(vehicle_info_type);
+ return subscribed_vehicle_info_.erase(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type));
}
UsageStatistics& ApplicationImpl::usage_report() {
@@ -1045,7 +1049,7 @@ void ApplicationImpl::set_hmi_level(
usage_report_.RecordHmiStateChanged(new_hmi_level);
}
-const std::set<uint32_t>& ApplicationImpl::SubscribesIVI() const {
+const VehicleInfoSubscriptions& ApplicationImpl::SubscribesIVI() const {
return subscribed_vehicle_info_;
}
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 9814b4cff8..a2cba5198e 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -354,11 +354,11 @@ struct IsApplication {
};
std::vector<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
- VehicleDataType vehicle_info, int value) {
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) {
// Notify Policy Manager if available about info it's interested in,
// i.e. odometer etc
switch (vehicle_info) {
- case ODOMETER:
+ case mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER:
GetPolicyHandler().KmsChanged(value);
break;
default:
diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
index 5383876714..bba7e2f3ff 100644
--- a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc
@@ -53,8 +53,9 @@ void OnVIVehicleDataNotification::Run() {
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
if (msg_params.keyExists(strings::odometer)) {
- application_manager_.IviInfoUpdated(ODOMETER,
- msg_params[strings::odometer].asInt());
+ application_manager_.IviInfoUpdated(
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER,
+ msg_params[strings::odometer].asInt());
}
SendNotificationToMobile(message_);
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
index f4b7e7c8aa..f529e271b4 100644
--- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
+++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc
@@ -376,7 +376,7 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
++items_to_subscribe;
}
if (!is_interface_not_available && is_key_enabled) {
- VehicleDataType key_type = it->second;
+ mobile_apis::VehicleDataType::eType key_type = it->second;
if (app->IsSubscribedToIVI(key_type)) {
LOG4CXX_DEBUG(logger_,
"App with connection key "
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 037c3fa4a4..f7317d72f9 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
@@ -134,7 +134,7 @@ void UnsubscribeVehicleDataRequest::Run() {
if (is_key_enabled) {
++items_to_unsubscribe;
- VehicleDataType key_type = it->second;
+ mobile_apis::VehicleDataType::eType key_type = it->second;
if (!app->IsSubscribedToIVI(key_type)) {
++unsubscribed_items;
vi_already_unsubscribed_by_this_app_.insert(key_type);
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index 65f4c79fa6..cf64152315 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -158,37 +158,60 @@ struct ExternalConsentStatusAppender
} // namespace
-std::pair<std::string, VehicleDataType> kVehicleDataInitializer[] = {
- std::make_pair(strings::gps, GPS),
- std::make_pair(strings::speed, SPEED),
- std::make_pair(strings::rpm, RPM),
- std::make_pair(strings::fuel_level, FUELLEVEL),
- std::make_pair(strings::fuel_level_state, FUELLEVEL_STATE),
- std::make_pair(strings::instant_fuel_consumption, FUELCONSUMPTION),
- std::make_pair(strings::external_temp, EXTERNTEMP),
- std::make_pair(strings::vin, VIN),
- std::make_pair(strings::prndl, PRNDL),
- std::make_pair(strings::tire_pressure, TIREPRESSURE),
- std::make_pair(strings::odometer, ODOMETER),
- std::make_pair(strings::belt_status, BELTSTATUS),
- std::make_pair(strings::body_information, BODYINFO),
- std::make_pair(strings::device_status, DEVICESTATUS),
- std::make_pair(strings::driver_braking, BRAKING),
- std::make_pair(strings::wiper_status, WIPERSTATUS),
- std::make_pair(strings::head_lamp_status, HEADLAMPSTATUS),
- std::make_pair(strings::e_call_info, ECALLINFO),
- std::make_pair(strings::airbag_status, AIRBAGSTATUS),
- std::make_pair(strings::emergency_event, EMERGENCYEVENT),
- std::make_pair(strings::cluster_mode_status, CLUSTERMODESTATUS),
- std::make_pair(strings::my_key, MYKEY),
+std::pair<std::string,
+ mobile_apis::VehicleDataType::eType> kVehicleDataInitializer[] = {
+ std::make_pair(strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS),
+ std::make_pair(strings::speed,
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED),
+ std::make_pair(strings::rpm, mobile_apis::VehicleDataType::VEHICLEDATA_RPM),
+ std::make_pair(strings::fuel_level,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL),
+ std::make_pair(strings::fuel_level_state,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
+ std::make_pair(strings::instant_fuel_consumption,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
+ std::make_pair(strings::external_temp,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
+ std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
+ std::make_pair(strings::prndl,
+ mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
+ std::make_pair(strings::tire_pressure,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE),
+ std::make_pair(strings::odometer,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
+ std::make_pair(strings::belt_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
+ std::make_pair(strings::body_information,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
+ std::make_pair(strings::device_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS),
+ std::make_pair(strings::driver_braking,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING),
+ std::make_pair(strings::wiper_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS),
+ std::make_pair(strings::head_lamp_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
+ std::make_pair(strings::e_call_info,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
+ std::make_pair(strings::airbag_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS),
+ std::make_pair(strings::emergency_event,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT),
+ std::make_pair(strings::cluster_mode_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS),
+ std::make_pair(strings::my_key,
+ mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY),
/*
NOT DEFINED in mobile API
std::make_pair(strings::gps,
BATTVOLTAGE),
*/
- std::make_pair(strings::engine_torque, ENGINETORQUE),
- std::make_pair(strings::acc_pedal_pos, ACCPEDAL),
- std::make_pair(strings::steering_wheel_angle, STEERINGWHEEL),
+ std::make_pair(strings::engine_torque,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE),
+ std::make_pair(strings::acc_pedal_pos,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
+ std::make_pair(strings::steering_wheel_angle,
+ mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
};
const VehicleData MessageHelper::vehicle_data_(
@@ -829,7 +852,7 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
const VehicleInfoSubscriptions& subscriptions = vi_accessor.GetData();
for (; vehicle_data.end() != ivi_it; ++ivi_it) {
- uint32_t type_id = static_cast<int>(ivi_it->second);
+ mobile_apis::VehicleDataType::eType type_id = ivi_it->second;
if (subscriptions.end() != subscriptions.find(type_id)) {
std::string key_name = ivi_it->first;
msg_params[key_name] = true;
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index e7788bf9ff..c8740227df 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -609,9 +609,10 @@ void ResumeCtrlImpl::AddSubscriptions(
if (subscribtions.keyExists(strings::application_vehicle_info)) {
const smart_objects::SmartObject& subscribtions_ivi =
subscribtions[strings::application_vehicle_info];
- VehicleDataType ivi;
+ mobile_apis::VehicleDataType::eType ivi;
for (size_t i = 0; i < subscribtions_ivi.length(); ++i) {
- ivi = static_cast<VehicleDataType>((subscribtions_ivi[i]).asInt());
+ ivi = static_cast<mobile_apis::VehicleDataType::eType>(
+ (subscribtions_ivi[i]).asInt());
application->SubscribeToIVI(ivi);
}
ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests(
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 273cd5413e..bd5bdbddab 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -33,7 +33,6 @@
#include "application_manager/resumption/resumption_data.h"
#include "utils/logger.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/application_manager_settings.h"
namespace resumption {
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index 1948608b9f..343137b136 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -308,8 +308,8 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(
- am::VehicleData::value_type(kMissedParam, am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMissedParam, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
@@ -425,8 +425,8 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
- am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
@@ -477,8 +477,8 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
TEST_F(CommandRequestImplTest,
SendResponse_AddDisallowedParametersToInfo_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
- am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
diff --git a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
index 41d9ea99c1..588f748fcc 100644
--- a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -201,8 +201,8 @@ TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
CreateCommand<GetVehicleDataRequest>(command_msg));
am::VehicleData vehicle_data;
- vehicle_data.insert(
- am::VehicleData::value_type(kMsgParamKey, am::VehicleDataType::SPEED));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMsgParamKey, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
diff --git a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
index d00e62bcfb..d3e664754c 100644
--- a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -113,7 +113,8 @@ TEST_F(OnVehicleDataNotificationTest,
Run_NotEmptyListOfAppsSubscribedForEvent_SUCCESS) {
am::VehicleData test_vehicle_data;
test_vehicle_data.insert(am::VehicleData::value_type(
- am::strings::fuel_level, am::VehicleDataType::FUELLEVEL));
+ am::strings::fuel_level,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(test_vehicle_data));
@@ -126,9 +127,10 @@ TEST_F(OnVehicleDataNotificationTest,
std::vector<ApplicationSharedPtr> applications;
applications.push_back(mock_app);
- EXPECT_CALL(app_mngr_,
- IviInfoUpdated(am::VehicleDataType::FUELLEVEL, kFuelLevel))
- .WillOnce(Return(applications));
+ EXPECT_CALL(
+ app_mngr_,
+ IviInfoUpdated(mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL,
+ kFuelLevel)).WillOnce(Return(applications));
EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
::utils::custom_string::CustomString dummy_name("test_app");
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
index a3cad29b73..9daf168c25 100644
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -59,7 +59,8 @@ typedef ::utils::SharedPtr<UnsubscribeVehicleDataRequest> CommandPtr;
namespace {
const uint32_t kConnectionKey = 1u;
const std::string kMsgParamKey = "test_key";
-const am::VehicleDataType kVehicleType = am::VehicleDataType::SPEED;
+const mobile_apis::VehicleDataType::eType kVehicleType =
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED;
} // namespace
class UnsubscribeVehicleRequestTest
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index c24e4590f5..9bdfe65cb7 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -313,7 +313,8 @@ class MockApplication : public ::application_manager::Application {
bool(application_manager::AppExtensionPtr extention));
MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
MOCK_METHOD0(RemoveExtensions, void());
- MOCK_CONST_METHOD0(SubscribesIVI, const std::set<uint32_t>&());
+ MOCK_CONST_METHOD0(SubscribesIVI,
+ const application_manager::VehicleInfoSubscriptions&());
#endif // SDL_REMOTE_CONTROL
};
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index f80842e250..f2fc18ca58 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -452,9 +452,9 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
smart_objects::SmartObject test_subscriptions;
smart_objects::SmartObject app_vi;
- int vtype = application_manager::VehicleDataType::GPS;
+ int vtype = mobile_apis::VehicleDataType::VEHICLEDATA_GPS;
uint i = 0;
- for (; vtype < application_manager::VehicleDataType::STEERINGWHEEL;
+ for (; vtype < mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL;
++i, ++vtype) {
app_vi[i] = vtype;
}
@@ -481,7 +481,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
for (size_t i = 0; i < app_vi.length(); ++i) {
EXPECT_CALL(
*app_mock_,
- SubscribeToIVI(static_cast<application_manager::VehicleDataType>(i)));
+ SubscribeToIVI(static_cast<mobile_apis::VehicleDataType::eType>(i)));
}
smart_objects::SmartObjectList requests;
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index 79397f5175..1f13ff78f3 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -539,8 +539,8 @@ void ResumptionDataTest::SetKeyboardProperties() {
void ResumptionDataTest::SetSubscriptions() {
btn_subscr.insert(ButtonName::eType::CUSTOM_BUTTON);
btn_subscr.insert(ButtonName::eType::OK);
- ivi.insert(0);
- ivi.insert(5);
+ ivi.insert(static_cast<mobile_apis::VehicleDataType::eType>(0));
+ ivi.insert(static_cast<mobile_apis::VehicleDataType::eType>(5));
}
} // namespace resumption_test
diff --git a/src/components/functional_module/test/include/mock_application.h b/src/components/functional_module/test/include/mock_application.h
index e73851094e..1192d5ede5 100644
--- a/src/components/functional_module/test/include/mock_application.h
+++ b/src/components/functional_module/test/include/mock_application.h
@@ -132,7 +132,8 @@ class MockApplication : public Application {
MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(SubscribedButtons,
const std::set<mobile_apis::ButtonName::eType>&());
- MOCK_CONST_METHOD0(SubscribesIVI, const std::set<uint32_t>&());
+ MOCK_CONST_METHOD0(SubscribesIVI,
+ const application_manager::VehicleInfoSubscriptions&());
MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index c1a37a24f1..15a9f39348 100644
--- a/src/components/include/application_manager/application_manager.h
+++ b/src/components/include/application_manager/application_manager.h
@@ -36,7 +36,6 @@
#include <string>
#include <vector>
#include <set>
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/application.h"
#include "application_manager/hmi_capabilities.h"
#include "application_manager/commands/command.h"
@@ -374,8 +373,8 @@ class ApplicationManager {
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- virtual AppSharedPtrs IviInfoUpdated(VehicleDataType vehicle_info,
- int value) = 0;
+ virtual AppSharedPtrs IviInfoUpdated(
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) = 0;
virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
smart_objects::SmartObject>& request_for_registration) = 0;
diff --git a/src/components/include/application_manager/vehicle_info_data.h b/src/components/include/application_manager/vehicle_info_data.h
deleted file mode 100644
index 693353abfe..0000000000
--- a/src/components/include/application_manager/vehicle_info_data.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
-#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
-
-namespace application_manager {
-/*
-*@brief Typedef for the vehicle data types that can
-*be published and subscribed to
-*/
-enum VehicleDataType {
- GPS = 0,
- SPEED,
- RPM,
- FUELLEVEL,
- FUELLEVEL_STATE,
- FUELCONSUMPTION,
- EXTERNTEMP,
- VIN,
- PRNDL,
- TIREPRESSURE,
- ODOMETER,
- BELTSTATUS,
- BODYINFO,
- DEVICESTATUS,
- ECALLINFO,
- AIRBAGSTATUS,
- EMERGENCYEVENT,
- CLUSTERMODESTATUS,
- MYKEY,
- BRAKING,
- WIPERSTATUS,
- HEADLAMPSTATUS,
- BATTVOLTAGE,
- ENGINETORQUE,
- ACCPEDAL,
- STEERINGWHEEL
-};
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_VEHICLE_INFO_DATA_H_
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
index e94d9b4b3a..7d1384b7ac 100644
--- a/src/components/include/test/application_manager/mock_application_manager.h
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -43,7 +43,6 @@
#include "application_manager/application_manager_settings.h"
#include "application_manager/commands/command.h"
#include "application_manager/hmi_capabilities.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/state_controller.h"
#include "application_manager/message.h"
#include "resumption/last_state.h"
@@ -167,7 +166,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_CONST_METHOD0(IsHMICooperating, bool());
MOCK_METHOD2(IviInfoUpdated,
std::vector<application_manager::ApplicationSharedPtr>(
- application_manager::VehicleDataType vehicle_info,
+ mobile_apis::VehicleDataType::eType vehicle_info,
int value));
MOCK_METHOD1(RegisterApplication,
application_manager::ApplicationSharedPtr(const utils::SharedPtr<
diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h
index 2c4ce641ee..28f279cdd3 100644
--- a/src/components/remote_control/test/include/mock_application.h
+++ b/src/components/remote_control/test/include/mock_application.h
@@ -323,7 +323,8 @@ class MockApplication : public ::application_manager::Application {
bool(application_manager::AppExtensionPtr extention));
MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
MOCK_METHOD0(RemoveExtensions, void());
- MOCK_CONST_METHOD0(SubscribesIVI, const std::set<uint32_t>&());
+ MOCK_CONST_METHOD0(SubscribesIVI,
+ const application_manager::VehicleInfoSubscriptions&());
#endif // SDL_REMOTE_CONTROL
};