summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Oleynik <aoleynik@luxoft.com>2016-12-13 17:44:31 +0200
committerAndrey Oleynik <aoleynik@luxoft.com>2016-12-13 17:51:42 +0200
commit751fee5c21355846aaf8a437b3516cb933b69f2e (patch)
tree7fc3c5836d71b8b927f64c38f11add771bb1813f
parent0c0d6658ec7ab540bacbdbf225ebf682fd764e9e (diff)
downloadsdl_core-751fee5c21355846aaf8a437b3516cb933b69f2e.tar.gz
Renames EXTENDED_POLICY definition to PROPRIETARY_MODE to avoid confusion
Currently there are three modes HTTP, PROPRIETARY, EXTERNAL_PROPRIETARY for option named like EXTENDED_POLICY, so in order to avoid confusion with option name definition has been renamed. Relates-to: APPLINK-25462
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/get_urls.h4
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h4
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/on_received_policy_update.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc8
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc6
-rw-r--r--src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc4
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc12
10 files changed, 26 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6e778a075..429f793d01 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -290,7 +290,7 @@ if (${EXTENDED_POLICY} STREQUAL "EXTERNAL_PROPRIETARY")
message(STATUS "DEFINED EXTERNAL_PROPRIETARY POLICY")
else()
if (${EXTENDED_POLICY} STREQUAL "PROPRIETARY")
- add_definitions(-DEXTENDED_POLICY)
+ add_definitions(-DPROPRIETARY_MODE)
message(STATUS "DEFINED PROPRIETARY POLICY")
else()
message(STATUS "DEFINED HTTP POLICY")
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
index 765be658f6..f1a733b0f7 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
@@ -63,13 +63,13 @@ class GetUrls : public RequestFromHMI {
void Run() OVERRIDE;
private:
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
/**
* @brief Processes URLs collecting for policy service
* @param endpoints Endpoints section of policy table
*/
void ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints);
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
/**
* @brief Process URLs collecting for service
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
index 957c9ebd43..2d2da06a1c 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
@@ -67,14 +67,14 @@ class OnSystemRequestNotification : public CommandNotificationImpl {
void Run() OVERRIDE;
private:
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
/**
* @brief Adds HTTP header to message
* @param message Message
*/
void AddHeader(BinaryMessage& message) const;
size_t ParsePTString(std::string& pt_string) const;
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
};
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc
index 1285808fbf..64597a5653 100644
--- a/src/components/application_manager/src/commands/hmi/get_urls.cc
+++ b/src/components/application_manager/src/commands/hmi/get_urls.cc
@@ -67,14 +67,14 @@ void GetUrls::Run() {
return;
}
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
const uint32_t policy_service = 7u;
if (policy_service == service_to_check) {
ProcessPolicyServiceURLs(endpoints);
return;
}
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
ProcessServiceURLs(endpoints);
}
@@ -123,7 +123,7 @@ void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
application_manager_.ManageHMICommand(message_);
}
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
struct PolicyAppIdComparator {
PolicyAppIdComparator(const std::string& policy_app_id)
: policy_app_id_(policy_app_id) {}
@@ -219,7 +219,7 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
SendResponseToHMI(Common_Result::SUCCESS);
return;
}
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
index 9d3dde0f84..5d03e21b6f 100644
--- a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
+++ b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc
@@ -47,7 +47,7 @@ OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {}
void OnReceivedPolicyUpdate::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-#if defined(EXTENDED_POLICY) || defined(EXTERNAL_PROPRIETARY)
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY)
const std::string& file_path =
(*message_)[strings::msg_params][hmi_notification::policyfile].asString();
policy::BinaryMessage file_content;
diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
index 6c3001f7a5..27e1cbd422 100644
--- a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
+++ b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc
@@ -44,7 +44,7 @@ SDLPolicyUpdate::~SDLPolicyUpdate() {}
void SDLPolicyUpdate::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-#if defined(EXTENDED_POLICY) || defined(EXTERNAL_PROPRIETARY)
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY)
SendRequest();
#else
LOG4CXX_WARN(logger_,
diff --git a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
index 3b7142fa46..58fd744309 100644
--- a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc
@@ -84,7 +84,7 @@ void OnSystemRequestNotification::Run() {
Also in Genivi SDL we don't save the PT to file - we put it directly in
binary_data */
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
const std::string filename =
(*message_)[strings::msg_params][strings::file_name].asString();
@@ -92,7 +92,7 @@ void OnSystemRequestNotification::Run() {
file_system::ReadBinaryFile(filename, binary_data);
AddHeader(binary_data);
(*message_)[strings::params][strings::binary_data] = binary_data;
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
(*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
} else if (RequestType::HTTP == request_type) {
(*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
@@ -101,7 +101,7 @@ void OnSystemRequestNotification::Run() {
SendNotification();
}
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
LOG4CXX_AUTO_TRACE(logger_);
const int timeout = application_manager_.GetPolicyHandler().TimeoutExchange();
@@ -184,7 +184,7 @@ size_t OnSystemRequestNotification::ParsePTString(
pt_string = result;
return result_length;
}
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
} // namespace mobile
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index ea2e390594..3e6204c2a6 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -1264,7 +1264,7 @@ void PolicyHandler::OnSnapshotCreated(
void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
std::string policy_snapshot_full_path;
if (!SaveSnapshot(pt_string, policy_snapshot_full_path)) {
LOG4CXX_ERROR(logger_, "Snapshot processing skipped.");
@@ -1274,7 +1274,7 @@ void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string) {
policy_manager_->TimeoutExchange(),
policy_manager_->RetrySequenceDelaysSeconds(),
application_manager_);
-#else // EXTENDED_POLICY
+#else // PROPRIETARY_MODE
LOG4CXX_ERROR(logger_, "HTTP policy");
EndpointUrls urls;
policy_manager_->GetUpdateUrls("0x07", urls);
@@ -1284,7 +1284,7 @@ void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string) {
return;
}
SendMessageToSDK(pt_string, urls.front().url.front());
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
// reset update required false
OnUpdateRequestSentToMobile();
}
diff --git a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
index 25f5d0f087..dd85fa5a44 100644
--- a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
@@ -100,12 +100,12 @@ TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
.WillOnce(Return(true));
-#if defined(EXTENDED_POLICY)
+#if defined(PROPRIETARY_MODE)
EXPECT_CALL(app_mngr_, GetPolicyHandler())
.Times(2)
.WillRepeatedly(ReturnRef(mock_policy_handler));
EXPECT_CALL(mock_policy_handler, TimeoutExchange()).WillOnce(Return(5u));
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index b5be5b15ac..44134e3426 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -186,11 +186,11 @@ class PolicyHandlerTest : public ::testing::Test {
.WillOnce(ReturnRef(kSnapshotFile_));
EXPECT_CALL(policy_settings_, system_files_path())
.WillOnce(ReturnRef(kSnapshotStorage_));
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
EXPECT_CALL(*mock_policy_manager_, TimeoutExchange()).WillOnce(Return(1));
EXPECT_CALL(*mock_policy_manager_, RetrySequenceDelaysSeconds())
.WillOnce(Return(retry_sequence_delay_seconds));
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
EXPECT_CALL(mock_message_helper_, SendPolicyUpdate(_, _, _, _));
}
};
@@ -1271,9 +1271,9 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlNotAdded) {
EnablePolicyAndPolicyManagerMock();
BinaryMessage msg;
EndpointUrls test_data;
-#if defined(EXTENDED_POLICY) || defined(EXTERNAL_PROPRIETARY)
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY)
ExtendedPolicyExpectations();
-#endif // EXTENDED_POLICY || EXTERNAL_PROPRIETARY
+#endif // PROPRIETARY_MODE || EXTERNAL_PROPRIETARY
#ifdef EXTERNAL_PROPRIETARY
std::vector<int> retry_delay_seconds;
const int timeout_exchange = 10;
@@ -1333,7 +1333,7 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
EndpointData data("some_data");
test_data.push_back(data);
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
ExtendedPolicyExpectations();
#else
EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls("0x07", _))
@@ -1351,7 +1351,7 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
EXPECT_CALL(app_manager_, application(kAppId_))
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
policy_handler_.OnSnapshotCreated(msg);
}