summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin <iCollin@users.noreply.github.com>2022-02-21 13:01:24 -0500
committerGitHub <noreply@github.com>2022-02-21 13:01:24 -0500
commite6a6a45ec0931bef428edf006f77b11ed99de178 (patch)
tree70ea9308e85091d0fdbe2a5042fdb9393565651a
parentb74c738101f282143094394454d20d12aa8e0d05 (diff)
downloadsdl_core-e6a6a45ec0931bef428edf006f77b11ed99de178.tar.gz
Set Last PTU App ID when forwarding on system request in HTTP policy mode (#3863)
* set last_ptu_app_id_ when forwarding on system request in HTTP policy mode * fixup! set last_ptu_app_id_ when forwarding on system request in HTTP policy mode
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h5
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc4
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc6
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h5
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h3
5 files changed, 14 insertions, 9 deletions
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 79b864e650..655cf70336 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
@@ -429,9 +429,10 @@ class PolicyHandler : public PolicyHandlerInterface,
void CacheRetryInfo(const uint32_t app_id = 0,
const std::string url = std::string(),
const std::string snapshot_path = std::string()) OVERRIDE;
-#else // EXTERNAL_PROPRIETARY_MODE
- void UpdateLastPTUApp(const uint32_t app_id) OVERRIDE;
#endif // EXTERNAL_PROPRIETARY_MODE
+#ifndef PROPRIETARY_MODE
+ void UpdateLastPTUApp(const uint32_t app_id) OVERRIDE;
+#endif // PROPRIETARY_MODE
uint32_t GetAppIdForSending() const OVERRIDE;
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
index f9900fd5c1..e19b0441ef 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc
@@ -153,9 +153,9 @@ void OnSystemRequestNotification::Run() {
if (helpers::Compare<RequestType, helpers::EQ, helpers::ONE>(
request_type, RequestType::RT_PROPRIETARY, RequestType::RT_HTTP)) {
policy_handler_.OnSystemRequestReceived();
-#ifdef EXTERNAL_PROPRIETARY_MODE
+#ifndef PROPRIETARY_MODE
policy_handler_.UpdateLastPTUApp(app->app_id());
-#endif
+#endif // PROPRIETARY_MODE
}
SendNotificationToMobile(message_);
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 100a9fe271..20f61032a9 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -491,12 +491,14 @@ void PolicyHandler::CacheRetryInfo(const uint32_t app_id,
retry_update_url_ = url;
policy_snapshot_path_ = snapshot_path;
}
-#else // EXTERNAL_PROPRIETARY_MODE
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+#ifndef PROPRIETARY_MODE
void PolicyHandler::UpdateLastPTUApp(const uint32_t app_id) {
SDL_LOG_DEBUG("UpdateLastPTUApp to " << app_id);
last_ptu_app_id_ = app_id;
}
-#endif // EXTERNAL_PROPRIETARY_MODE
+#endif // PROPRIETARY_MODE
uint32_t PolicyHandler::GetAppIdForSending() const {
SDL_LOG_AUTO_TRACE();
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 0824e90984..40a3fecfba 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -406,9 +406,10 @@ class PolicyHandlerInterface : public VehicleDataItemProvider {
const uint32_t app_id = 0,
const std::string url = std::string(),
const std::string snapshot_path = std::string()) = 0;
-#else
- virtual void UpdateLastPTUApp(const uint32_t app_id) = 0;
#endif // EXTERNAL_PROPRIETARY_MODE
+#ifndef PROPRIETARY_MODE
+ virtual void UpdateLastPTUApp(const uint32_t app_id) = 0;
+#endif // PROPRIETARY_MODE
/**
* @brief Retrieve potential application id to be used for snapshot sending
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index 78667dc6ff..5f752e1a81 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
@@ -200,7 +200,8 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
void(const uint32_t app_id,
const std::string url,
const std::string snapshot_path));
-#else
+#endif
+#ifndef PROPRIETARY_MODE
MOCK_METHOD1(UpdateLastPTUApp, void(const uint32_t app_id));
#endif
MOCK_CONST_METHOD0(GetAppIdForSending, uint32_t());