diff options
4 files changed, 23 insertions, 21 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 39ab4205dd..ac63e95d1a 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 @@ -81,9 +81,7 @@ class PolicyHandler : virtual void OnPermissionsUpdated(const std::string& policy_app_id, const Permissions& permissions); - virtual void OnSnapshotCreated(const BinaryMessage& pt_string, - const std::vector<int>& retry_delay_seconds, - int timeout_exchange); + virtual void OnSnapshotCreated(const BinaryMessage& pt_string); bool GetPriority(const std::string& policy_app_id, std::string* priority); void CheckPermissions(const PTString& app_id, diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 31d8099433..148c8bfbb0 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -670,7 +670,7 @@ void PolicyHandler::OnPendingPermissionChange( app_id, permissions); ApplicationManagerImpl::instance()->SetState<true>(app->app_id(), mobile_apis::HMILevel::HMI_NONE, - mobile_apis::AudioStreamingState::NOT_AUDIBLE); + mobile_apis::AudioStreamingState::NOT_AUDIBLE); policy_manager_->RemovePendingPermissionChanges(policy_app_id); return; } @@ -1018,12 +1018,24 @@ bool PolicyHandler::SaveSnapshot(const BinaryMessage& pt_string, return result; } -void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string, - const std::vector<int>& retry_delay_seconds, - int timeout_exchange) { +void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string) { + LOG4CXX_AUTO_TRACE(logger_); + POLICY_LIB_CHECK_VOID(); +#ifdef EXTENDED_POLICY + std::string policy_snapshot_full_path; + if (!SaveSnapshot(pt_string, policy_snapshot_full_path)) { + LOG4CXX_ERROR(logger_, "Snapshot processing skipped."); + return; + } + MessageHelper::SendPolicyUpdate( + policy_snapshot_full_path, + policy_manager_->TimeoutExchange(), + policy_manager_->RetrySequenceDelaysSeconds()); +#else EndpointUrls urls; policy_manager_->GetServiceUrls("0x07", urls); SendMessageToSDK(pt_string, urls.front().url.front()); +#endif } bool PolicyHandler::GetPriority(const std::string& policy_app_id, diff --git a/src/components/policy/src/policy/include/policy/policy_listener.h b/src/components/policy/src/policy/include/policy/policy_listener.h index 357fb20aed..332b50521d 100644 --- a/src/components/policy/src/policy/include/policy/policy_listener.h +++ b/src/components/policy/src/policy/include/policy/policy_listener.h @@ -69,14 +69,8 @@ class PolicyListener { * when snapshot for PTU has been created. * * @param pt_string the snapshot - * - * @param retry_seconds retry sequence timeouts. - * - * @param timeout_exceed timeout. */ - virtual void OnSnapshotCreated(const BinaryMessage& pt_string, - const std::vector<int>& retry_seconds, - int timeout_exceed) = 0; + virtual void OnSnapshotCreated(const BinaryMessage& pt_string) = 0; /** * @brief Make appropriate changes for related applications permissions and diff --git a/src/components/policy/src/policy/src/policy_manager_impl.cc b/src/components/policy/src/policy/src/policy_manager_impl.cc index 4cfab15060..1489df6e7f 100644 --- a/src/components/policy/src/policy/src/policy_manager_impl.cc +++ b/src/components/policy/src/policy/src/policy_manager_impl.cc @@ -80,7 +80,7 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse( return new policy_table::Table(&value); } else { return utils::SharedPtr<policy_table::Table>(); - } + } } #else @@ -94,7 +94,7 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray( //For PT Update received from SDL Server. if (value["data"].size()!=0) { Json::Value data = value["data"]; - //First Element in + //First Element in return new policy_table::Table(&data[0]); } else { return new policy_table::Table(&value); @@ -131,9 +131,9 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Parse message into table struct utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content); #else - //Message Received from server unecnrypted with PTU in first element + //Message Received from server unecnrypted with PTU in first element //of 'data' array. No Parsing was done by HMI. - utils::SharedPtr<policy_table::Table> pt_update = ParseArray(pt_content); + utils::SharedPtr<policy_table::Table> pt_update = ParseArray(pt_content); #endif if (!pt_update) { LOG4CXX_WARN(logger_, "Parsed table pointer is 0."); @@ -250,9 +250,7 @@ void PolicyManagerImpl::RequestPTUpdate() { BinaryMessage update(message_string.begin(), message_string.end()); - listener_->OnSnapshotCreated(update, - RetrySequenceDelaysSeconds(), - TimeoutExchange()); + listener_->OnSnapshotCreated(update); // Need to reset update schedule since all currenly registered applications // were already added to the snapshot so no update for them required. |