summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozoriz <kozorizandriy@gmail.com>2016-04-20 17:54:47 +0300
committerKozoriz <kozorizandriy@gmail.com>2016-04-25 16:35:16 +0300
commit72723be0357114617d87be396baba7a244a32b6e (patch)
tree07e3df82351c73f53291255bf18bcea09cf44935
parent48f4d233ec6ee321292187df48f0adbfe1e3a52e (diff)
downloadsdl_core-72723be0357114617d87be396baba7a244a32b6e.tar.gz
Correctives after review
-rw-r--r--src/appMain/life_cycle.cc6
-rw-r--r--src/appMain/life_cycle.h4
-rw-r--r--src/components/application_manager/include/application_manager/application.h4
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h5
-rw-r--r--src/components/application_manager/include/application_manager/application_manager.h2
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h9
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h23
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h6
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h8
-rw-r--r--src/components/application_manager/include/application_manager/hmi_command_factory.h1
-rw-r--r--src/components/application_manager/include/application_manager/mobile_command_factory.h1
-rw-r--r--src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h1
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_event_observer.h6
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h4
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h60
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_db.h2
-rw-r--r--src/components/application_manager/src/application_impl.cc12
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc6
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc5
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_request.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_request.cc.autosave140
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_response.cc.autosave56
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc14
-rw-r--r--src/components/application_manager/src/event_engine/event_observer.cc6
-rw-r--r--src/components/application_manager/src/policies/delegates/app_permission_delegate.cc1
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc6
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc2
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc20
-rw-r--r--src/components/application_manager/test/application_impl_test.cc2
-rw-r--r--src/components/application_manager/test/event_engine_test.cc4
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application_manager.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h6
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h3
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc2
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc18
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc2
-rw-r--r--src/components/application_manager/test/resumption_sql_queries_test.cc2
-rw-r--r--src/components/application_manager/test/state_controller/include/application_mock.h2
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc2
-rw-r--r--src/components/dbus/test/test_dbus_message_controller.cc2
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc2
-rw-r--r--src/components/include/application_manager/application_manager_settings.h40
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h8
-rw-r--r--src/components/include/application_manager/request_controller_settings.h41
-rw-r--r--src/components/include/policy/usage_statistics/statistics_manager.h64
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h1
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h2
-rw-r--r--src/components/include/transport_manager/transport_manager_mme_settings.h40
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h41
-rw-r--r--src/components/include/utils/shared_ptr.h4
-rw-r--r--src/components/policy/test/sql_pt_representation_test.cc6
-rw-r--r--src/components/policy/test/update_status_manager_test.cc2
-rw-r--r--src/components/resumption/test/last_state_test.cc22
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc4
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc19
61 files changed, 355 insertions, 415 deletions
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc
index 7e542d119b..18de370018 100644
--- a/src/appMain/life_cycle.cc
+++ b/src/appMain/life_cycle.cc
@@ -68,7 +68,7 @@ void StopThread(System::Thread* thread) {
}
} // namespace
-LifeCycle::LifeCycle(profile::Profile& profile)
+LifeCycle::LifeCycle(const profile::Profile& profile)
: transport_manager_(NULL)
, protocol_handler_(NULL)
, connection_handler_(NULL)
@@ -361,8 +361,10 @@ void LifeCycle::StopComponents() {
security_manager_->RemoveListener(app_manager_);
LOG4CXX_INFO(logger_, "Destroying Crypto Manager");
delete crypto_manager_;
+ crypto_manager_ = NULL;
LOG4CXX_INFO(logger_, "Destroying Security Manager");
delete security_manager_;
+ security_manager_ = NULL;
}
#endif // ENABLE_SECURITY
protocol_handler_->Stop();
@@ -378,6 +380,7 @@ void LifeCycle::StopComponents() {
transport_manager_->Visibility(false);
transport_manager_->Stop();
delete transport_manager_;
+ transport_manager_ = NULL;
LOG4CXX_INFO(logger_, "Stopping Connection Handler.");
DCHECK_OR_RETURN_VOID(connection_handler_);
@@ -400,6 +403,7 @@ void LifeCycle::StopComponents() {
LOG4CXX_INFO(logger_, "Destroying Application Manager.");
DCHECK(app_manager_);
delete app_manager_;
+ app_manager_ = NULL;
LOG4CXX_INFO(logger_, "Destroying HMI Message Handler and MB adapter.");
diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h
index 3fbdbb7ab3..83651451e8 100644
--- a/src/appMain/life_cycle.h
+++ b/src/appMain/life_cycle.h
@@ -74,7 +74,7 @@ class SecurityManagerImpl;
namespace main_namespace {
class LifeCycle {
public:
- LifeCycle(profile::Profile& profile);
+ LifeCycle(const profile::Profile& profile);
bool StartComponents();
/**
@@ -120,7 +120,7 @@ class LifeCycle {
#endif // MESSAGEBROKER_HMIADAPTER
- profile::Profile& profile_;
+ const profile::Profile& profile_;
DISALLOW_COPY_AND_ASSIGN(LifeCycle);
};
} // namespace main_namespace
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index c40ebe68cd..fb48bddb70 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -486,7 +486,7 @@ class Application : public virtual InitialApplicationData,
virtual const std::string folder_name() const = 0;
virtual bool is_media_application() const = 0;
virtual bool is_foreground() const = 0;
- virtual void set_foreground(bool is_foreground) = 0;
+ virtual void set_foreground(const bool is_foreground) = 0;
virtual const mobile_api::HMILevel::eType hmi_level() const = 0;
virtual const uint32_t put_file_in_none_count() const = 0;
virtual const uint32_t delete_file_in_none_count() const = 0;
@@ -530,7 +530,7 @@ class Application : public virtual InitialApplicationData,
virtual void increment_delete_file_in_none_count() = 0;
virtual void increment_list_files_in_none_count() = 0;
virtual bool set_app_icon_path(const std::string& file_name) = 0;
- virtual void set_app_allowed(const bool& allowed) = 0;
+ virtual void set_app_allowed(const bool allowed) = 0;
virtual void set_device(connection_handler::DeviceHandle device) = 0;
virtual uint32_t get_grammar_id() const = 0;
virtual void set_grammar_id(uint32_t value) = 0;
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 bdef552c0b..6400b2b3ca 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -38,6 +38,7 @@
#include <vector>
#include <utility>
#include <list>
+#include <stdint.h>
#include "utils/date_time.h"
#include "application_manager/application_data_impl.h"
@@ -132,7 +133,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
const std::string folder_name() const;
bool is_media_application() const;
bool is_foreground() const OVERRIDE;
- void set_foreground(bool is_foreground) OVERRIDE;
+ void set_foreground(const bool is_foreground) OVERRIDE;
const mobile_apis::HMILevel::eType hmi_level() const;
const uint32_t put_file_in_none_count() const;
const uint32_t delete_file_in_none_count() const;
@@ -154,7 +155,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
void increment_delete_file_in_none_count();
void increment_list_files_in_none_count();
bool set_app_icon_path(const std::string& path);
- void set_app_allowed(const bool& allowed);
+ void set_app_allowed(const bool allowed);
void set_device(connection_handler::DeviceHandle device);
virtual uint32_t get_grammar_id() const;
virtual void set_grammar_id(uint32_t value);
diff --git a/src/components/application_manager/include/application_manager/application_manager.h b/src/components/application_manager/include/application_manager/application_manager.h
index 298abcca59..30240b744d 100644
--- a/src/components/application_manager/include/application_manager/application_manager.h
+++ b/src/components/application_manager/include/application_manager/application_manager.h
@@ -343,7 +343,7 @@ class ApplicationManager {
*
* @param allowed SDL access to all mobile apps
*/
- virtual void SetAllAppsAllowed(const bool& allowed) = 0;
+ virtual void SetAllAppsAllowed(const bool allowed) = 0;
/*
* @brief Sets state for driver distraction
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 6b286e5af6..6da96306d1 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
@@ -433,7 +433,7 @@ class ApplicationManagerImpl
*
* @param state New state to be set
*/
- void set_driver_distraction(bool is_distracting) OVERRIDE;
+ void set_driver_distraction(const bool is_distracting) OVERRIDE;
/*
* @brief Retrieves if VR session has started
@@ -447,7 +447,7 @@ class ApplicationManagerImpl
*
* @param state Current HMI VR session state
*/
- void set_vr_session_started(const bool& state);
+ void set_vr_session_started(const bool state);
/*
* @brief Retrieves SDL access to all mobile apps
@@ -461,7 +461,7 @@ class ApplicationManagerImpl
*
* @param allowed SDL access to all mobile apps
*/
- void SetAllAppsAllowed(const bool& allowed) OVERRIDE;
+ void SetAllAppsAllowed(const bool allowed) OVERRIDE;
/**
* @brief CreateRegularState create regular HMI state for application
@@ -993,6 +993,9 @@ class ApplicationManagerImpl
struct ApplicationsPolicyAppIdSorter {
bool operator()(const ApplicationSharedPtr lhs,
const ApplicationSharedPtr rhs) {
+ if (lhs->policy_app_id() == rhs->policy_app_id()) {
+ return lhs->device() < rhs->device();
+ }
return lhs->policy_app_id() < rhs->policy_app_id();
}
};
diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h
index 4932fa1ddb..17c9bcb64b 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -39,7 +39,6 @@
namespace application_manager {
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-class ApplicationManager;
namespace commands {
/**
@@ -113,7 +112,7 @@ class Command {
* @brief SetAllowedToTerminate set up allowed to terminate flag.
* If true, request controller will terminate request on response
*/
- virtual void SetAllowedToTerminate(bool allowed) = 0;
+ virtual void SetAllowedToTerminate(const bool allowed) = 0;
enum CommandOrigin {
diff --git a/src/components/application_manager/include/application_manager/commands/command_impl.h b/src/components/application_manager/include/application_manager/commands/command_impl.h
index 03f03a6a50..894f31e5c5 100644
--- a/src/components/application_manager/include/application_manager/commands/command_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_impl.h
@@ -74,52 +74,51 @@ class CommandImpl : public Command {
/**
* @brief Checks command permissions according to policy table
*/
- virtual bool CheckPermissions();
+ bool CheckPermissions() OVERRIDE;
/**
* @brief Init required by command resources
**/
- virtual bool Init();
+ bool Init() OVERRIDE;
/**
* @brief Cleanup all resources used by command
**/
- virtual bool CleanUp();
+ bool CleanUp() OVERRIDE;
/**
* @brief Execute corresponding command by calling the action on reciever
**/
- virtual void Run();
-
+ void Run() OVERRIDE;
/**
* @brief Retrieves request default timeout.
* If request has a custom timeout, request_timeout_ should be reassign to it
*
* @return Request default timeout
*/
- virtual uint32_t default_timeout() const;
+ uint32_t default_timeout() const OVERRIDE;
/*
* @brief Retrieves correlation ID
*/
- virtual uint32_t correlation_id() const;
+ uint32_t correlation_id() const OVERRIDE;
/*
* @brief Retrieves connection key
*/
- virtual uint32_t connection_key() const;
+ uint32_t connection_key() const OVERRIDE;
/*
* @brief Retrieves request ID
*/
- virtual int32_t function_id() const;
+ int32_t function_id() const OVERRIDE;
/*
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
*
*/
- virtual void onTimeOut();
+ void onTimeOut() OVERRIDE;
/**
* @brief AllowedToTerminate tells request Controller if it can terminate this
@@ -128,13 +127,13 @@ class CommandImpl : public Command {
* If request need to terminate itself, it should override this function false
* @return allowed_to_terminate_ value
*/
- virtual bool AllowedToTerminate();
+ bool AllowedToTerminate() OVERRIDE;
/**
* @brief SetAllowedToTerminate set up allowed to terminate flag.
* If true, request controller will terminate request on response
*/
- virtual void SetAllowedToTerminate(bool allowed);
+ void SetAllowedToTerminate(const bool allowed) OVERRIDE;
// members
static const int32_t hmi_protocol_type_;
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
index 2b7ea2f400..39ffef24a8 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
@@ -52,7 +52,7 @@ class AddCommandRequest : public CommandRequestImpl {
*
* @param message Incoming SmartObject message
**/
- explicit AddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager);
+ AddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager);
/**
* @brief AddCommandRequest class destructor
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
index 1af42898be..89e1fd3daf 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h
@@ -60,7 +60,7 @@ class EventDispatcher {
*/
virtual void add_observer(const Event::EventID& event_id,
int32_t hmi_correlation_id,
- EventObserver* const observer) = 0;
+ EventObserver& observer) = 0;
/*
* @brief Unsubscribes the observer from specific event
@@ -69,14 +69,14 @@ class EventDispatcher {
* @param observer The observer to be unsubscribed
*/
virtual void remove_observer(const Event::EventID& event_id,
- EventObserver* const observer) = 0;
+ EventObserver& observer) = 0;
/*
* @brief Unsubscribes the observer from all events
*
* @param observer The observer to be unsubscribed
*/
- virtual void remove_observer(EventObserver* const observer) = 0;
+ virtual void remove_observer(EventObserver& observer) = 0;
/*
* @brief Destructor
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
index 0a58e329b3..a36544c945 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
@@ -83,7 +83,7 @@ class EventDispatcherImpl : public EventDispatcher {
*/
void add_observer(const Event::EventID& event_id,
int32_t hmi_correlation_id,
- EventObserver* const observer) OVERRIDE;
+ EventObserver& observer) OVERRIDE;
/*
* @brief Unsubscribes the observer from specific event
@@ -92,14 +92,14 @@ class EventDispatcherImpl : public EventDispatcher {
* @param observer The observer to be unsubscribed
*/
void remove_observer(const Event::EventID& event_id,
- EventObserver* const observer) OVERRIDE;
+ EventObserver& observer) OVERRIDE;
/*
* @brief Unsubscribes the observer from all events
*
* @param observer The observer to be unsubscribed
*/
- void remove_observer(EventObserver* const observer) OVERRIDE;
+ void remove_observer(EventObserver& observer) OVERRIDE;
private:
@@ -108,7 +108,7 @@ class EventDispatcherImpl : public EventDispatcher {
* when occurs unsubscribe from event
* @param observer to be removed
*/
- void remove_observer_from_vector(EventObserver* const observer);
+ void remove_observer_from_vector(EventObserver& observer);
DISALLOW_COPY_AND_ASSIGN(EventDispatcherImpl);
diff --git a/src/components/application_manager/include/application_manager/hmi_command_factory.h b/src/components/application_manager/include/application_manager/hmi_command_factory.h
index 0b37c54ea2..6603563c6d 100644
--- a/src/components/application_manager/include/application_manager/hmi_command_factory.h
+++ b/src/components/application_manager/include/application_manager/hmi_command_factory.h
@@ -38,6 +38,7 @@
namespace application_manager {
typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+class ApplicationManager;
/**
* @brief Factory class for command creation
**/
diff --git a/src/components/application_manager/include/application_manager/mobile_command_factory.h b/src/components/application_manager/include/application_manager/mobile_command_factory.h
index f8097a83ef..1f270b28db 100644
--- a/src/components/application_manager/include/application_manager/mobile_command_factory.h
+++ b/src/components/application_manager/include/application_manager/mobile_command_factory.h
@@ -39,6 +39,7 @@
namespace application_manager {
typedef utils::SharedPtr<commands::Command> CommandSharedPtr;
+class ApplicationManager;
/**
* @brief Factory class for command creation
diff --git a/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h
index ecd3d0e707..9acd258b67 100644
--- a/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h
@@ -42,7 +42,6 @@
#include "application_manager/policies/policy_handler_interface.h"
namespace policy {
-class PolicyHandler;
/**
* @brief The AppPermissionDelegate class allows to call OnAppPermissionConsent
* in async way.
diff --git a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
index 3c2aa5125c..b2de2fde36 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
#include "application_manager/event_engine/event_observer.h"
#include "utils/lock.h"
@@ -59,4 +59,4 @@ class PolicyEventObserver :
};
} // namespace policy
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_EVENT_OBSERVER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h
index 1ec3e47081..26872a5af5 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h
@@ -38,6 +38,8 @@
#include <set>
#include <vector>
#include <list>
+#include <stdint.h>
+
#include "policy/policy_manager.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_event_observer.h"
@@ -294,7 +296,7 @@ class PolicyHandler
virtual bool CanUpdate() OVERRIDE;
virtual void OnDeviceConsentChanged(const std::string& device_id,
- bool is_allowed) OVERRIDE;
+ const bool is_allowed) OVERRIDE;
virtual void SendOnAppPermissionsChanged(
const AppPermissions& permissions,
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
index 50cf784485..92dbc0e3f0 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
@@ -61,7 +61,7 @@ class LastState;
* @brief Contains logic for storage/restore data of applications.
*/
-class ResumeCtrl: public app_mngr::event_engine::EventObserver {
+class ResumeCtrl: public application_manager::event_engine::EventObserver {
public:
@@ -79,7 +79,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @brief Event, that raised if application get resumption response from HMI
* @param event : event object, that contains smart_object with HMI message
*/
- virtual void on_event(const app_mngr::event_engine::Event& event);
+ virtual void on_event(const application_manager::event_engine::Event& event);
/**
* @brief Save all applications info to the file system
@@ -90,21 +90,21 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @brief Save application persistent info for future resuming
* @param application is application witch need to be saved
*/
- void SaveApplication(app_mngr::ApplicationSharedPtr application);
+ void SaveApplication(application_manager::ApplicationSharedPtr application);
/**
* @brief Set application HMI Level and ausio_state as saved
* @param application is application witch HMI Level is need to restore
* @return true if success, otherwise return false
*/
- bool RestoreAppHMIState(app_mngr::ApplicationSharedPtr application);
+ bool RestoreAppHMIState(application_manager::ApplicationSharedPtr application);
/**
* @brief Set application HMI Level as stored in policy
* @param application is application witch HMI Level is need to setup
* @return true if success, otherwise return false
*/
- bool SetupDefaultHMILevel(app_mngr::ApplicationSharedPtr application);
+ bool SetupDefaultHMILevel(application_manager::ApplicationSharedPtr application);
/**
* @brief Setup HmiLevel for application
@@ -115,7 +115,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param check_policy indicate if policy data consent must be verified
* @return true if success, otherwise return false
*/
- bool SetAppHMIState(app_mngr::ApplicationSharedPtr application,
+ bool SetAppHMIState(application_manager::ApplicationSharedPtr application,
const mobile_apis::HMILevel::eType hmi_level,
bool check_policy = true);
@@ -124,7 +124,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application is application witch need to be checked
* @return true if exist, false otherwise
*/
- bool ApplicationIsSaved(app_mngr::ApplicationConstSharedPtr application);
+ bool ApplicationIsSaved(application_manager::ApplicationConstSharedPtr application);
/**
* @brief Remove application from list of saved applications
@@ -132,7 +132,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @return return true, if success, otherwise return false
*/
bool RemoveApplicationFromSaved(
- app_mngr::ApplicationConstSharedPtr application);
+ application_manager::ApplicationConstSharedPtr application);
/**
* @brief Increments ignition counter for all registered applications
@@ -170,7 +170,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool StartResumption(app_mngr::ApplicationSharedPtr application,
+ bool StartResumption(application_manager::ApplicationSharedPtr application,
const std::string& hash);
/**
@@ -179,7 +179,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool StartResumptionOnlyHMILevel(app_mngr::ApplicationSharedPtr application);
+ bool StartResumptionOnlyHMILevel(application_manager::ApplicationSharedPtr application);
/**
* @brief Check if there are all files need for resumption
@@ -187,14 +187,14 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @return true if it all files exist, otherwise return false
*/
bool CheckPersistenceFilesForResumption(
- app_mngr::ApplicationSharedPtr application);
+ application_manager::ApplicationSharedPtr application);
/**
* @brief Check application hash
* @param application that is need to be restored
* @return true if it was saved, otherwise return false
*/
- bool CheckApplicationHash(app_mngr::ApplicationSharedPtr application,
+ bool CheckApplicationHash(application_manager::ApplicationSharedPtr application,
const std::string& hash);
/**
@@ -242,7 +242,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application - application to restore hmi level
* and audio streaming state
*/
- void StartAppHmiStateResumption(app_mngr::ApplicationSharedPtr application);
+ void StartAppHmiStateResumption(application_manager::ApplicationSharedPtr application);
/**
* @brief Update launch_time_ to current
@@ -260,7 +260,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
*
* @param application application witch need to be removed from resumption
*/
- void OnAppActivated(app_mngr::ApplicationSharedPtr application);
+ void OnAppActivated(application_manager::ApplicationSharedPtr application);
/**
* @brief Removes app from resumption list
@@ -298,7 +298,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application contains application for which restores data
* @return true if success, otherwise return false
*/
- bool RestoreApplicationData(app_mngr::ApplicationSharedPtr application);
+ bool RestoreApplicationData(application_manager::ApplicationSharedPtr application);
/**
* @brief AddFiles allows to add files for the application
@@ -306,7 +306,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void AddFiles(app_mngr::ApplicationSharedPtr application,
+ void AddFiles(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -315,7 +315,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void AddSubmenues(app_mngr::ApplicationSharedPtr application,
+ void AddSubmenues(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -324,7 +324,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void AddCommands(app_mngr::ApplicationSharedPtr application,
+ void AddCommands(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -333,7 +333,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void AddChoicesets(app_mngr::ApplicationSharedPtr application,
+ void AddChoicesets(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -341,7 +341,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void SetGlobalProperties(app_mngr::ApplicationSharedPtr application,
+ void SetGlobalProperties(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -349,7 +349,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void AddSubscriptions(app_mngr::ApplicationSharedPtr application,
+ void AddSubscriptions(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -358,7 +358,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param application application which will be resumed
* @param saved_app application specific section from backup file
*/
- void AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application,
+ void AddWayPointsSubscription(application_manager::ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app);
bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app);
@@ -366,7 +366,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
bool DisconnectedJustBeforeIgnOff(
const smart_objects::SmartObject& saved_app);
- bool CheckAppRestrictions(app_mngr::ApplicationConstSharedPtr application,
+ bool CheckAppRestrictions(application_manager::ApplicationConstSharedPtr application,
const smart_objects::SmartObject& saved_app);
/**
@@ -375,7 +375,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param json_object
* @return true in case icons exists, false otherwise
*/
- bool CheckIcons(app_mngr::ApplicationSharedPtr application,
+ bool CheckIcons(application_manager::ApplicationSharedPtr application,
smart_objects::SmartObject& obj);
/**
@@ -385,9 +385,9 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
*/
bool CheckDelayAfterIgnOn();
- typedef std::pair<uint32_t, uint32_t> application_timestamp;
+ typedef std::pair<uint32_t, uint32_t> ApplicationTimestamp;
- std::set<app_mngr::ApplicationSharedPtr> retrieve_application();
+ std::set<application_manager::ApplicationSharedPtr> retrieve_application();
/**
* @brief This struct need to map
@@ -395,12 +395,12 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
*/
struct ResumingApp {
uint32_t old_session_key; // session key is the same as app_id
- app_mngr::ApplicationSharedPtr app;
+ application_manager::ApplicationSharedPtr app;
};
struct TimeStampComparator {
- bool operator()(const application_timestamp& lhs,
- const application_timestamp& rhs) const {
+ bool operator()(const ApplicationTimestamp& lhs,
+ const ApplicationTimestamp& rhs) const {
return lhs.second < rhs.second;
}
};
@@ -417,7 +417,7 @@ class ResumeCtrl: public app_mngr::event_engine::EventObserver {
* @param saved_device_mac Saved device MAC address
* @return TRUE on success, otherwise FALSE
*/
- bool IsDeviceMacAddressEqual(app_mngr::ApplicationSharedPtr application,
+ bool IsDeviceMacAddressEqual(application_manager::ApplicationSharedPtr application,
const std::string& saved_device_mac);
/**
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
index 962b164134..7554f1359c 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
@@ -310,7 +310,7 @@ class ResumptionDataDB : public ResumptionData {
*/
bool CheckExistenceApplication(const std::string& policy_app_id,
const std::string& device_id,
- bool& application_exist) const;
+ bool application_exist) const;
/**
* @brief Retrieves data from saved application
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 9ed9e120f5..4fb8a0e5a5 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -287,11 +287,11 @@ const mobile_api::HMILevel::eType ApplicationImpl::hmi_level() const {
return hmi_state ? hmi_state->hmi_level() : HMILevel::INVALID_ENUM;
}
-bool application_manager::ApplicationImpl::is_foreground() const {
+bool ApplicationImpl::is_foreground() const {
return is_foreground_;
}
-void application_manager::ApplicationImpl::set_foreground(bool is_foreground) {
+void ApplicationImpl::set_foreground(const bool is_foreground) {
is_foreground_ = is_foreground;
}
@@ -557,7 +557,7 @@ bool ApplicationImpl::set_app_icon_path(const std::string& path) {
return false;
}
-void ApplicationImpl::set_app_allowed(const bool& allowed) {
+void ApplicationImpl::set_app_allowed(const bool allowed) {
is_app_allowed_ = allowed;
}
@@ -926,12 +926,10 @@ uint32_t ApplicationImpl::GetAvailableDiskSpace() {
if (current_app_quota > available_disk_space) {
return available_disk_space;
- } else {
- return current_app_quota;
}
- } else {
- return app_quota;
+ return current_app_quota;
}
+ return app_quota;
}
void ApplicationImpl::SubscribeToSoftButtons(
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 378af9ac0a..c021203304 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -701,15 +701,15 @@ bool ApplicationManagerImpl::EndAudioPassThrough() {
}
}
-void ApplicationManagerImpl::set_driver_distraction(bool is_distracting) {
+void ApplicationManagerImpl::set_driver_distraction(const bool is_distracting) {
is_distracting_driver_ = is_distracting;
}
-void ApplicationManagerImpl::set_vr_session_started(const bool& state) {
+void ApplicationManagerImpl::set_vr_session_started(const bool state) {
is_vr_session_strated_ = state;
}
-void ApplicationManagerImpl::SetAllAppsAllowed(const bool& allowed) {
+void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
is_all_apps_allowed_ = allowed;
}
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 1cdca1ffd9..651432752e 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -94,7 +94,7 @@ bool CommandImpl::AllowedToTerminate() {
return allowed_to_terminate_;
}
-void CommandImpl::SetAllowedToTerminate(bool allowed) {
+void CommandImpl::SetAllowedToTerminate(const bool allowed) {
allowed_to_terminate_ = allowed;
}
diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
index 4c0fe88f46..4745587fe6 100644
--- a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
+++ b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc
@@ -677,7 +677,6 @@ bool PerformInteractionRequest::CheckChoiceSetMenuNames(
bool PerformInteractionRequest::CheckChoiceSetVRSynonyms(
application_manager::ApplicationSharedPtr const app) {
LOG4CXX_AUTO_TRACE(logger_);
- std::set<uint32_t> vr_command_set;
smart_objects::SmartObject& choice_list =
(*message_)[strings::msg_params][strings::interaction_choice_set_id_list];
@@ -980,10 +979,10 @@ void PerformInteractionRequest::SendBothModeResponse(
result = false;
}
- const bool is_success_code = (SUCCESS != perform_interaction_result_code ||
+ const bool is_error_code = (SUCCESS != perform_interaction_result_code ||
WARNINGS != perform_interaction_result_code);
- if (vr_resultCode_ == ui_resultCode_ && is_success_code) {
+ if (vr_resultCode_ == ui_resultCode_ && is_error_code) {
result = false;
}
diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
index b0f4f73216..cbacbef612 100644
--- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
+++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc
@@ -247,8 +247,8 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) {
application_manager_.application(connection_key());
if (!message_.valid() || !app.valid()) {
- LOG4CXX_ERROR(logger_, "NULL pointer.");
- return;
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
}
const std::string& path = (*message_)[strings::msg_params]
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc.autosave b/src/components/application_manager/src/commands/mobile/set_icon_request.cc.autosave
deleted file mode 100644
index 93912ea156..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_icon_request.cc.autosave
+++ /dev/null
@@ -1,140 +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.
- */
-
-#include "application_manager/commands/mobile/set_icon_request.h"
-#include "application_manager/application_impl.h"
-#include "config_profile/profile.h"
-#include "interfaces/MOBILE_API.h"
-#include "interfaces/HMI_API.h"
-#include "utils/file_system.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetIconRequest::SetIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {
-}
-
-SetIconRequest::~SetIconRequest() {
-}
-
-void SetIconRequest::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- if (!app) {
- LOG4CXX_ERROR(logger_, "Application is not registered");
- SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
- return;
- }
-
- const std::string& sync_file_name =
- (*message_)[strings::msg_params][strings::sync_file_name].asString();
-
- std::string full_file_path =
- application_manager_.get_settings().app_storage_folder() + "/";
- full_file_path += app->folder_name();
- full_file_path += "/";
- full_file_path += sync_file_name;
-
- if (!file_system::FileExists(full_file_path)) {
- LOG4CXX_ERROR(logger_, "No such file " << full_file_path);
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
- return;
- }
-
- smart_objects::SmartObject msg_params = smart_objects::SmartObject(
- smart_objects::SmartType_Map);
-
- msg_params[strings::app_id] = app->app_id();
- msg_params[strings::sync_file_name] = smart_objects::SmartObject(
- smart_objects::SmartType_Map);
-
-// Panasonic requres unchanged path value without encoded special characters
- const std::string full_file_path_for_hmi = file_system::ConvertPathForURL(
- full_file_path);
-
- msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi;
-
- // TODO(VS): research why is image_type hardcoded
- msg_params[strings::sync_file_name][strings::image_type] =
- static_cast<int32_t> (SetIconRequest::ImageType::DYNAMIC);
-
- // for further use in on_event function
- (*message_)[strings::msg_params][strings::sync_file_name] =
- msg_params[strings::sync_file_name];
-
- SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
-}
-
-void SetIconRequest::on_event(const event_engine::Event& event) {
- LOG4CXX_AUTO_TRACE(logger_);
- const smart_objects::SmartObject& message = event.smart_object();
-
- switch (event.id()) {
- case hmi_apis::FunctionID::UI_SetAppIcon: {
- mobile_apis::Result::eType result_code =
- static_cast<mobile_apis::Result::eType>(
- message[strings::params][hmi_response::code].asInt());
-
- bool result = mobile_apis::Result::SUCCESS == result_code;
-
- if (result) {
- ApplicationSharedPtr app =
- application_manager_.application(connection_key());
-
- const std::string path = (*message_)[strings::msg_params]
- [strings::sync_file_name]
- [strings::value].asString();
- app->set_app_icon_path(path);
-
- LOG4CXX_INFO(logger_,
- "Icon path was set to '" << app->app_icon_path() << "'");
- }
-
- SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
- break;
- }
- default: {
- LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
- return;
- }
- }
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_response.cc.autosave b/src/components/application_manager/src/commands/mobile/set_icon_response.cc.autosave
deleted file mode 100644
index 7b4c848fc1..0000000000
--- a/src/components/application_manager/src/commands/mobile/set_icon_response.cc.autosave
+++ /dev/null
@@ -1,56 +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.
- */
-
-#include "application_manager/commands/mobile/set_icon_response.h"
-
-namespace application_manager {
-
-namespace commands {
-
-SetIconResponse::SetIconResponse(const MessageSharedPtr& message,
- ApplicationManager& app_man)
- : CommandResponseImpl(message, app_man) {
-}
-
-SetIconResponse::~SetIconResponse() {
-}
-
-void SetIconResponse::Run() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- application_manager_.SendMessageToMobile(message_);
-}
-
-} // namespace commands
-
-} // namespace application_manager
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
index f00dc06c00..860df6f8a2 100644
--- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
+++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
@@ -72,9 +72,9 @@ void EventDispatcherImpl::raise_event(const Event& event) {
void EventDispatcherImpl::add_observer(const Event::EventID& event_id,
int32_t hmi_correlation_id,
- EventObserver* observer) {
+ EventObserver& observer) {
AutoLock auto_lock(state_lock_);
- observers_event_[event_id][hmi_correlation_id].push_back(observer);
+ observers_event_[event_id][hmi_correlation_id].push_back(&observer);
}
struct IdCheckFunctor {
@@ -89,7 +89,7 @@ struct IdCheckFunctor {
};
void EventDispatcherImpl::remove_observer(const Event::EventID& event_id,
- EventObserver* const observer) {
+ EventObserver& observer) {
remove_observer_from_vector(observer);
AutoLock auto_lock(state_lock_);
ObserversMap::iterator it = observers_event_[event_id].begin();
@@ -98,12 +98,12 @@ void EventDispatcherImpl::remove_observer(const Event::EventID& event_id,
ObserverVector& obs_vec = it->second;
const ObserverVector::iterator obs_vec_it = obs_vec.end();
obs_vec.erase(
- std::remove_if(obs_vec.begin(), obs_vec_it, IdCheckFunctor(observer->id())),
+ std::remove_if(obs_vec.begin(), obs_vec_it, IdCheckFunctor(observer.id())),
obs_vec_it);
}
}
-void EventDispatcherImpl::remove_observer(EventObserver* const observer) {
+void EventDispatcherImpl::remove_observer(EventObserver& observer) {
remove_observer_from_vector(observer);
EventObserverMap::iterator event_map = observers_event_.begin();
@@ -113,12 +113,12 @@ void EventDispatcherImpl::remove_observer(EventObserver* const observer) {
}
void EventDispatcherImpl::remove_observer_from_vector(
- EventObserver* const observer) {
+ EventObserver& observer) {
AutoLock auto_lock(observer_lock_);
observers_.erase(
std::remove_if(observers_.begin(), observers_.end(),
- IdCheckFunctor(observer->id())),
+ IdCheckFunctor(observer.id())),
observers_.end());
}
diff --git a/src/components/application_manager/src/event_engine/event_observer.cc b/src/components/application_manager/src/event_engine/event_observer.cc
index 9e6e0a1fed..cfb8cc6718 100644
--- a/src/components/application_manager/src/event_engine/event_observer.cc
+++ b/src/components/application_manager/src/event_engine/event_observer.cc
@@ -48,15 +48,15 @@ EventObserver::~EventObserver() { unsubscribe_from_all_events(); }
void EventObserver::subscribe_on_event(const Event::EventID& event_id,
int32_t hmi_correlation_id) {
event_dispatcher_.add_observer(event_id, hmi_correlation_id,
- this);
+ *this);
}
void EventObserver::unsubscribe_from_event(const Event::EventID& event_id) {
- event_dispatcher_.remove_observer(event_id, this);
+ event_dispatcher_.remove_observer(event_id, *this);
}
void EventObserver::unsubscribe_from_all_events() {
- event_dispatcher_.remove_observer(this);
+ event_dispatcher_.remove_observer(*this);
}
} // namespace event_engine
diff --git a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
index ceff36c00a..fa242962d4 100644
--- a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
+++ b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
@@ -32,7 +32,6 @@
#include "application_manager/policies/delegates/app_permission_delegate.h"
#include "application_manager/application_manager.h"
-#include "application_manager/policies/policy_handler_interface.h"
namespace policy {
CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index adfbd2aa53..1961369d9b 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -174,8 +174,8 @@ struct DeactivateApplication {
StateController& state_ctrl_;
};
-struct SDLAlowedNotification {
- SDLAlowedNotification(const connection_handler::DeviceHandle& device_id,
+struct SDLAllowedNotification {
+ SDLAllowedNotification(const connection_handler::DeviceHandle& device_id,
PolicyManager* policy_manager,
StateController& state_controller)
: device_id_(device_id)
@@ -415,7 +415,7 @@ void PolicyHandler::OnAppPermissionConsent(
}
void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
- bool is_allowed) {
+ const bool is_allowed) {
POLICY_LIB_CHECK_VOID();
connection_handler::DeviceHandle device_handle;
application_manager_.connection_handler().GetDeviceID(
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index 19d26dc249..b493001c45 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -551,7 +551,7 @@ uint32_t ResumptionDataDB::SelectIgnOffTime() const {
bool ResumptionDataDB::CheckExistenceApplication(
const std::string& policy_app_id,
const std::string& device_id,
- bool& application_exist) const {
+ bool application_exist) const {
LOG4CXX_AUTO_TRACE(logger_);
bool result = false;
utils::dbms::SQLQuery query(db());
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 2460005397..a01672a545 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -62,7 +62,7 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr)
}
-void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr state, const bool SendActivateApp) {
+void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr state, const bool send_activate_app) {
CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
if (!app) {
@@ -94,10 +94,10 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
- const bool is_full_allowed = hmi_apis::Common_HMILevel::FULL == hmi_level;
+ const bool is_full_allowed = (hmi_apis::Common_HMILevel::FULL == hmi_level);
- if (SendActivateApp && is_full_allowed) {
- int64_t corr_id = SendBCActivateApp(app, hmi_level, true);
+ if (send_activate_app && is_full_allowed) {
+ const int64_t corr_id = SendBCActivateApp(app, hmi_level, true);
if (-1 != corr_id) {
subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
corr_id);
@@ -113,7 +113,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
- const bool SendActivateApp) {
+ const bool send_activate_app) {
CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
if (!app) {
@@ -128,12 +128,12 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_system_context(prev_regular->system_context());
- SetRegularState(app, hmi_state, SendActivateApp);
+ SetRegularState(app, hmi_state, send_activate_app);
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
- const bool SendActivateApp) {
+ const bool send_activate_app) {
using namespace mobile_apis;
using namespace helpers;
CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
@@ -149,14 +149,14 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
hmi_state->set_system_context(SystemContext::SYSCTXT_MAIN);
- SetRegularState(app, hmi_state, SendActivateApp);
+ SetRegularState(app, hmi_state, send_activate_app);
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
const mobile_apis::HMILevel::eType hmi_level,
const mobile_apis::AudioStreamingState::eType audio_state,
const mobile_apis::SystemContext::eType system_context,
- const bool SendActivateApp) {
+ const bool send_activate_app) {
CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl");
LOG4CXX_AUTO_TRACE(logger_);
if (!app) {
@@ -169,7 +169,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
hmi_state->set_system_context(system_context);
- SetRegularState(app, hmi_state, SendActivateApp);
+ SetRegularState(app, hmi_state, send_activate_app);
}
void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index 62d7b70a3f..a128f9c4fc 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -96,7 +96,7 @@ class ApplicationImplTest : public ::testing::Test {
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
delete app_impl;
}
HmiStatePtr CreateTestHmiState();
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index b203374e46..c3ab82f016 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -110,7 +110,7 @@ class EventEngineTest : public testing::Test {
hmi_apis::FunctionID::eType::VR_IsReady;
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
delete event_dispatcher_instance_;
delete event_;
}
@@ -120,7 +120,7 @@ class EventEngineTest : public testing::Test {
const smart_objects::SmartObject& so) {
// Arrange
event_dispatcher_instance_->add_observer(event_id, correlation_id,
- &event_observer_mock_);
+ event_observer_mock_);
event_->set_smart_object(so);
EXPECT_CALL(event_observer_mock_, on_event(_)).Times(calls_number);
event_dispatcher_instance_->raise_event(*event_);
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index 5321ac62f1..3f40ae9ab2 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -72,7 +72,7 @@ class HMICapabilitiesTest : public ::testing::Test {
hmi_capabilities_test->Init(&last_state_);
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
hmi_capabilities_test.reset();
}
static void TearDownTestCase() {
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 7f24c07793..03d0fdc4bd 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
@@ -112,7 +112,7 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD0(increment_delete_file_in_none_count, void());
MOCK_METHOD0(increment_list_files_in_none_count, void());
MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
- MOCK_METHOD1(set_app_allowed, void(const bool& allowed));
+ MOCK_METHOD1(set_app_allowed, void(const bool allowed));
MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
MOCK_METHOD1(set_grammar_id, void(uint32_t value));
diff --git a/src/components/application_manager/test/include/application_manager/mock_application_manager.h b/src/components/application_manager/test/include/application_manager/mock_application_manager.h
index 04289ebbe9..9fe15b169e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application_manager.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application_manager.h
@@ -154,7 +154,7 @@ class MockApplicationManager : public application_manager::ApplicationManager {
MOCK_METHOD4(SaveBinary,
mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data, const std::string& file_path, const std::string& file_name, const int64_t offset));
MOCK_METHOD1(SetAllAppsAllowed,
- void(const bool& allowed));
+ void(const bool allowed));
MOCK_METHOD1(set_driver_distraction,
void(bool is_distracting));
MOCK_METHOD6(StartAudioPassThruThread,
diff --git a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
index 2ea0cb60a9..c92f78c29e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
+++ b/src/components/application_manager/test/include/application_manager/mock_event_dispatcher.h
@@ -50,12 +50,12 @@ class MockEventDispatcher : public ::application_manager::event_engine::EventDis
MOCK_METHOD3(add_observer,
void(const ::application_manager::event_engine::Event::EventID& event_id,
int32_t hmi_correlation_id,
- ::application_manager::event_engine::EventObserver* const observer));
+ ::application_manager::event_engine::EventObserver& observer));
MOCK_METHOD2(remove_observer,
void(const ::application_manager::event_engine::Event::EventID& event_id,
- ::application_manager::event_engine::EventObserver* const observer));
+ ::application_manager::event_engine::EventObserver& observer));
MOCK_METHOD1(remove_observer,
- void(::application_manager::event_engine::EventObserver* const observer));
+ void(::application_manager::event_engine::EventObserver& observer));
};
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index 799d59f003..d58213bb02 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -102,8 +102,7 @@ class MockMessageHelper {
uint32_t correlation_id,
ApplicationManager &app_mngr));
MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager &app_mngr));
-// MOCK_METHOD2(SendDecryptCertificateToHMI, void(const std::string& file_name,
-// ApplicationManager &app_mngr));
+
MOCK_METHOD4(SendPolicyUpdate,
void(const std::string& file_path,
int timeout,
diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc
index 4bc7f6a1e6..c58f903c57 100644
--- a/src/components/application_manager/test/policy_event_observer_test.cc
+++ b/src/components/application_manager/test/policy_event_observer_test.cc
@@ -70,7 +70,7 @@ class PolicyEventObserverTest : public ::testing::Test {
mock_event_dispatcher_);
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
delete policy_event_observer_;
DeleteEvent();
}
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index c61d4a1546..aa338f9000 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -89,8 +89,8 @@ class PolicyHandlerTest : public ::testing::Test {
rpc_("fake_rpc"),
priority_("fake_priority"),
default_hmi_("fake_hmi")
- ,kPreloadPTFile("sdl_preloaded_pt.json")
- ,kAppStorageFolder("storage") {}
+ ,kPreloadPTFile_("sdl_preloaded_pt.json")
+ ,kAppStorageFolder_("storage") {}
protected:
NiceMock<MockPolicySettings> policy_settings_;
@@ -105,8 +105,8 @@ class PolicyHandlerTest : public ::testing::Test {
const std::string rpc_;
std::string priority_;
std::string default_hmi_;
- const std::string kPreloadPTFile;
- const std::string kAppStorageFolder;
+ const std::string kPreloadPTFile_;
+ const std::string kAppStorageFolder_;
virtual void SetUp() OVERRIDE {
@@ -118,7 +118,7 @@ class PolicyHandlerTest : public ::testing::Test {
ASSERT_TRUE(pm_.valid());
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
ON_CALL(mock_event_dispatcher_, remove_observer(_,_));
}
@@ -126,8 +126,8 @@ class PolicyHandlerTest : public ::testing::Test {
void EnablePolicy() {
ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
- ON_CALL(policy_settings_, preloaded_pt_file()).WillByDefault(ReturnRef(kPreloadPTFile));
- ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, preloaded_pt_file()).WillByDefault(ReturnRef(kPreloadPTFile_));
+ ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder_));
}
void EnablePolicyAndPolicyManagerMock() {
@@ -504,8 +504,8 @@ TEST_F(PolicyHandlerTest, Test_OnPendingPermissionChange_method) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- uint32_t app_id = 123;
- std::string policy_app_id("mobile_app_id");
+ const uint32_t app_id = 123;
+ const std::string policy_app_id("mobile_app_id");
utils::SharedPtr<application_manager_test::MockApplication> application =
utils::MakeShared<application_manager_test::MockApplication>();
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index adc5447beb..df4adb53ad 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -74,7 +74,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
grammar_id_ = 16;
}
- virtual void TearDown() {
+ void TearDown() OVERRIDE {
utils::dbms::SQLQuery query(test_db());
EXPECT_TRUE(query.Prepare(remove_all_tables));
EXPECT_TRUE(query.Exec());
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc
index 46402b3a80..1136651d11 100644
--- a/src/components/application_manager/test/resumption_sql_queries_test.cc
+++ b/src/components/application_manager/test/resumption_sql_queries_test.cc
@@ -128,7 +128,7 @@ class ResumptionSqlQueriesTest : public ::testing::Test {
string file_to_delete = kDatabaseName + ".sqlite";
file_system::DeleteFile(file_to_delete);
}
- void TearDown() { DeleteTablesData(); }
+ void TearDown() OVERRIDE { DeleteTablesData(); }
void CheckDeleteQuery(const string& count_query, const string& query_to_check,
pair<int, string> app_info, pair<int, string> dev_info,
diff --git a/src/components/application_manager/test/state_controller/include/application_mock.h b/src/components/application_manager/test/state_controller/include/application_mock.h
index 3f1e96bb24..8d01795fe8 100644
--- a/src/components/application_manager/test/state_controller/include/application_mock.h
+++ b/src/components/application_manager/test/state_controller/include/application_mock.h
@@ -304,7 +304,7 @@ class MockApplication : public application_manager::Application {
MOCK_METHOD1(set_app_icon_path,
bool(const std::string& file_name));
MOCK_METHOD1(set_app_allowed,
- void(const bool& allowed));
+ void(const bool allowed));
MOCK_METHOD1(set_device,
void(connection_handler::DeviceHandle device));
MOCK_CONST_METHOD0(get_grammar_id,
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
index e442a144bf..331a83c8d4 100644
--- a/src/components/connection_handler/test/heart_beat_monitor_test.cc
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -67,7 +67,7 @@ class HeartBeatMonitorTest : public testing::Test {
kConnectionHandle, 0, &connection_handler_mock, kTimeout);
}
- virtual void TearDown() { delete conn; }
+ void TearDown() OVERRIDE { delete conn; }
};
ACTION_P2(RemoveSession, conn, session_id) { conn->RemoveSession(session_id); }
diff --git a/src/components/dbus/test/test_dbus_message_controller.cc b/src/components/dbus/test/test_dbus_message_controller.cc
index f0056db4c9..a81817e80b 100644
--- a/src/components/dbus/test/test_dbus_message_controller.cc
+++ b/src/components/dbus/test/test_dbus_message_controller.cc
@@ -83,7 +83,7 @@ class DBusMessageControllerTest : public ::testing::Test {
ASSERT_TRUE(subscriber_->Start());
}
- virtual void TearDown() {
+ void TearDown() OVERRIDE {
delete controller_;
delete subscriber_;
}
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index bf259f80e9..ff33bbef9b 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -70,7 +70,7 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
EXPECT_TRUE(NULL != hmi_handler_->observer());
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
hmi_handler_->set_message_observer(NULL);
delete mock_hmi_message_observer_;
delete hmi_handler_;
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index ae6f6930c1..b429da88c2 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -1,5 +1,37 @@
-#ifndef APPLICATION_MANAGER_SETTINGS
-#define APPLICATION_MANAGER_SETTINGS
+/*
+ * Copyright (c) 2016, 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_APPLICATION_MANAGER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_SETTINGS_H_
#include "application_manager/request_controller_settings.h"
@@ -62,6 +94,6 @@ class ApplicationManagerSettings : public RequestControlerSettings {
virtual const uint32_t& app_icons_amount_to_remove() const = 0;
virtual const uint32_t& list_files_response_size() const = 0;
};
-}
+} // namespace application_manager
-#endif // APPLICATION_MANAGER_SETTINGS
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_SETTINGS_H_
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index 197a4cc0a7..9bf9fccb78 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_INTERFACE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_INTERFACE_H_
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_INTERFACE_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_INTERFACE_H_
#include <string>
#include <map>
@@ -282,7 +282,7 @@ class PolicyHandlerInterface {
virtual bool CanUpdate() = 0;
virtual void OnDeviceConsentChanged(const std::string& device_id,
- bool is_allowed) = 0;
+ const bool is_allowed) = 0;
virtual void OnPTExchangeNeeded() = 0;
@@ -383,4 +383,4 @@ class PolicyHandlerInterface {
} // namespace policy
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_INTERFACE_H_
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_INTERFACE_H_
diff --git a/src/components/include/application_manager/request_controller_settings.h b/src/components/include/application_manager/request_controller_settings.h
index 45871f6ca2..420ffd8aaf 100644
--- a/src/components/include/application_manager/request_controller_settings.h
+++ b/src/components/include/application_manager/request_controller_settings.h
@@ -1,5 +1,38 @@
-#ifndef REQUEST_CONTROLLER_SETTINGS_H
-#define REQUEST_CONTROLLER_SETTINGS_H
+/*
+ * Copyright (c) 2016, 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_REQUEST_CONTROLLER_SETTINGS_H
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H
+
namespace application_manager {
class RequestControlerSettings {
public:
@@ -11,5 +44,5 @@ public:
virtual const uint32_t& app_time_scale_max_requests() const = 0;
virtual const uint32_t& pending_requests_amount() const = 0;
};
-}
-#endif // REQUEST_CONTROLLER_SETTINGS_H
+} // namespace application_manager
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H
diff --git a/src/components/include/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/usage_statistics/statistics_manager.h
index 4226cb7dca..38d93377c7 100644
--- a/src/components/include/policy/usage_statistics/statistics_manager.h
+++ b/src/components/include/policy/usage_statistics/statistics_manager.h
@@ -1,37 +1,37 @@
/*
- 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.
+ * Copyright (c) 2016, 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_POLICY_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
#include <stdint.h>
#include <string>
@@ -82,4 +82,4 @@ class StatisticsManager {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index b41eda27ef..02e33e2c7f 100644
--- a/src/components/include/test/application_manager/mock_application_manager_settings.h
+++ b/src/components/include/test/application_manager/mock_application_manager_settings.h
@@ -40,7 +40,6 @@
namespace test {
namespace components {
namespace application_manager_test {
-typedef std::pair<uint32_t, int32_t> returnPair;
class MockApplicationManagerSettings
: public application_manager::ApplicationManagerSettings {
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h
index 812c60689f..bb6fa6dd61 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h
@@ -32,7 +32,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H
#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H
-#include <gmock/gmock.h>
+#include "gmock/gmock.h"
#include "protocol_handler/protocol_handler.h"
#include "transport_manager/transport_manager_mme_settings.h"
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index 100f1cbf37..feba0c4fbe 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -32,7 +32,7 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H
#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H
-#include <gmock/gmock.h>
+#include "gmock/gmock.h"
#include "protocol_handler/protocol_handler.h"
#include "transport_manager/transport_manager_settings.h"
#include "mock_transport_manager_mme_settings.h"
diff --git a/src/components/include/transport_manager/transport_manager_mme_settings.h b/src/components/include/transport_manager/transport_manager_mme_settings.h
index 7ab120d4a1..efe26468ab 100644
--- a/src/components/include/transport_manager/transport_manager_mme_settings.h
+++ b/src/components/include/transport_manager/transport_manager_mme_settings.h
@@ -1,5 +1,38 @@
-#ifndef TRANSPORT_MANAGER_MME_SETTINGS_H
-#define TRANSPORT_MANAGER_MME_SETTINGS_H
+/*
+ * Copyright (c) 2016, 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_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MME_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MME_SETTINGS_H_
+
#include <stdint.h>
#include <string>
#include <vector>
@@ -28,4 +61,5 @@ class TransportManagerMMESettings {
virtual uint32_t iap_hub_connection_wait_timeout() const = 0;
};
}
-#endif // TRANSPORT_MANAGER_MME_SETTINGS_H
+
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_MME_SETTINGS_H_
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index b48684953c..f33c5344e0 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -1,5 +1,38 @@
-#ifndef TRANSPORT_MANAGER_SETTINGS
-#define TRANSPORT_MANAGER_SETTINGS
+/*
+ * Copyright (c) 2016, 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_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
+
#include "transport_manager/transport_manager_mme_settings.h"
namespace transport_manager {
class TransportManagerSettings : public TransportManagerMMESettings {
@@ -19,5 +52,5 @@ class TransportManagerSettings : public TransportManagerMMESettings {
*/
virtual uint16_t transport_manager_tcp_adapter_port() const = 0;
};
-}
-#endif // TRANSPORT_MANAGER_SETTINGS
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h
index a8afd93d19..11464488e1 100644
--- a/src/components/include/utils/shared_ptr.h
+++ b/src/components/include/utils/shared_ptr.h
@@ -55,8 +55,8 @@ namespace utils {
**/
template<typename ObjectType>
class SharedPtr {
- static void DummyDeleter(ObjectType* t) {
- delete t;
+ static void DummyDeleter(ObjectType* object_to_delete) {
+ delete object_to_delete;
}
public:
//std smart pointer compatibility
diff --git a/src/components/policy/test/sql_pt_representation_test.cc b/src/components/policy/test/sql_pt_representation_test.cc
index a80efbc4fa..3fa56d8eb8 100644
--- a/src/components/policy/test/sql_pt_representation_test.cc
+++ b/src/components/policy/test/sql_pt_representation_test.cc
@@ -93,7 +93,7 @@ class SQLPTRepresentationTest : public SQLPTRepresentation,
EXPECT_TRUE(dbms->Open());
}
- void TearDown() { EXPECT_TRUE(reps->Clear()); }
+ void TearDown() OVERRIDE { EXPECT_TRUE(reps->Clear()); }
static void TearDownTestCase() {
EXPECT_TRUE(reps->Drop());
@@ -331,7 +331,7 @@ class SQLPTRepresentationTest2 : public ::testing::Test {
, kOpenAttemptTimeoutMs(700u)
, kAttemptsToOpenPolicyDB(8u) {}
- virtual void SetUp() {
+ void SetUp() OVERRIDE {
file_system::CreateDirectory(kAppStorageFolder);
chmod(kAppStorageFolder.c_str(), 00000);
ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder));
@@ -340,7 +340,7 @@ class SQLPTRepresentationTest2 : public ::testing::Test {
reps = new SQLPTRepresentation;
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
file_system::RemoveDirectory(kAppStorageFolder,true);
delete reps;
}
diff --git a/src/components/policy/test/update_status_manager_test.cc b/src/components/policy/test/update_status_manager_test.cc
index 85550ebc1d..2c948ae207 100644
--- a/src/components/policy/test/update_status_manager_test.cc
+++ b/src/components/policy/test/update_status_manager_test.cc
@@ -54,7 +54,7 @@ class UpdateStatusManagerTest : public ::testing::Test {
void SetUp() { manager_ = new UpdateStatusManager(); }
- void TearDown() { delete manager_; }
+ void TearDown() OVERRIDE { delete manager_; }
};
TEST_F(UpdateStatusManagerTest,
diff --git a/src/components/resumption/test/last_state_test.cc b/src/components/resumption/test/last_state_test.cc
index 1dca8bf57b..7e4d1376c9 100644
--- a/src/components/resumption/test/last_state_test.cc
+++ b/src/components/resumption/test/last_state_test.cc
@@ -58,11 +58,11 @@ class LastStateTest : public ::testing::Test {
file_system::RemoveDirectory(kAppStorageFolder);
}
- virtual void SetUp() {
+ void SetUp() OVERRIDE {
ASSERT_TRUE(file_system::CreateFile(app_info_dat_file_));
}
- virtual void TearDown() {
+ void TearDown() OVERRIDE {
EXPECT_TRUE(file_system::DeleteFile((app_info_dat_file_)));
}
@@ -73,24 +73,24 @@ class LastStateTest : public ::testing::Test {
};
TEST_F(LastStateTest, Basic) {
- Value& dictionary = last_state_.dictionary;
+ const Value& dictionary = last_state_.dictionary;
EXPECT_EQ(empty_dictionary_, dictionary.toStyledString());
}
TEST_F(LastStateTest, SetGetData) {
{
- Value& dictionary = last_state_.dictionary;
- Value& bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"];
+ const Value& dictionary = last_state_.dictionary;
+ const Value& bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"];
EXPECT_EQ(empty_dictionary_, bluetooth_info.toStyledString());
- Value& tcp_adapter_info =
+ const Value& tcp_adapter_info =
dictionary["TransportManager"]["TcpAdapter"]["devices"];
EXPECT_EQ(empty_dictionary_, tcp_adapter_info.toStyledString());
- Value& resumption_time = dictionary["resumption"]["last_ign_off_time"];
+ const Value& resumption_time = dictionary["resumption"]["last_ign_off_time"];
EXPECT_EQ("null\n", resumption_time.toStyledString());
- Value& resumption_list = dictionary["resumption"]["resume_app_list"];
+ const Value& resumption_list = dictionary["resumption"]["resume_app_list"];
EXPECT_EQ("null\n", resumption_list.toStyledString());
Value test_value;
@@ -104,10 +104,10 @@ TEST_F(LastStateTest, SetGetData) {
last_state_.SaveToFileSystem();
}
- Value& dictionary = last_state_.dictionary;
+ const Value& dictionary = last_state_.dictionary;
- Value& bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"];
- Value& tcp_adapter_info = dictionary["TransportManager"]["TcpAdapter"];
+ const Value& bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"];
+ const Value& tcp_adapter_info = dictionary["TransportManager"]["TcpAdapter"];
EXPECT_EQ("{\n \"devices\" : \"bluetooth_device\"\n}\n",
bluetooth_info.toStyledString());
EXPECT_EQ(
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index 89c119b68b..1f4db577ce 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -170,7 +170,7 @@ class SSLTest : public testing::Test {
client_buf_len = 0u;
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
crypto_manager_->ReleaseSSLContext(server_ctx);
client_manager_->ReleaseSSLContext(client_ctx);
@@ -249,7 +249,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
client_buf_len = 0u;
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() OVERRIDE {
crypto_manager->ReleaseSSLContext(server_ctx);
client_manager->ReleaseSSLContext(client_ctx);
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index b022a72bf0..fa3b69e1b9 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -64,6 +64,7 @@ namespace transport_manager_test {
const std::string kAppStorageFolder = "app_storage_folder";
const std::string kAppInfoFolder = "app_info_folder";
+const int kAsyncExpectationsTimeout = 10000;
class TransportManagerImplTest : public ::testing::Test {
protected:
@@ -497,7 +498,7 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice) {
#endif // TELEMETRY_MONITOR
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_SendingFailed) {
@@ -518,7 +519,7 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice_SendingFailed) {
EXPECT_CALL(*mock_metric_observer, StopRawMsg(_)).Times(0);
delete mock_metric_observer;
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_StartTimeObserver) {
@@ -534,7 +535,7 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice_StartTimeObserver) {
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
delete mock_metric_observer;
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_SendDone) {
@@ -549,7 +550,7 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice_SendDone) {
HandleSendDone();
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, SendMessageFailed_GetHandleSendFailed) {
@@ -564,7 +565,7 @@ TEST_F(TransportManagerImplTest, SendMessageFailed_GetHandleSendFailed) {
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
HandleSendFailed();
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, RemoveDevice_DeviceWasAdded) {
@@ -665,7 +666,7 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
EXPECT_CALL(*tm_listener_, OnScanDevicesFinished());
tm_.ReceiveEventFromDevice(test_event);
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
@@ -678,7 +679,7 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
EXPECT_CALL(*tm_listener_, OnScanDevicesFailed(_));
tm_.ReceiveEventFromDevice(test_event);
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
@@ -707,7 +708,7 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
tm_.ReceiveEventFromDevice(test_event);
device_list_.pop_back();
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, CheckEvents) {
@@ -866,7 +867,7 @@ TEST_F(TransportManagerImplTest, HandleMessage_ConnectionNotExist) {
EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_));
tm_.TestHandle(test_message_);
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
}
TEST_F(TransportManagerImplTest, SearchDevices_TMIsNotInitialized) {