From 616abf28021b22acc2adb82fa8e2672b6a64fdac Mon Sep 17 00:00:00 2001 From: Collin Date: Thu, 30 Apr 2020 13:47:37 -0700 Subject: do not retry ptu if no apps are connected (#3350) * do not retry ptu if no apps are connected * no URL should be returned if there is no app to do PTU --- src/components/application_manager/src/policies/policy_handler.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index cee33b229b..11decf45c3 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1656,6 +1656,10 @@ std::string PolicyHandler::GetNextUpdateUrl( POLICY_LIB_CHECK_OR_RETURN(std::string()); app_id = ChoosePTUApplication(iteration_type); + if (0 == app_id) { + return std::string(); + } + // Use cached URL for retries if it was provided by the HMI if (PTUIterationType::RetryIteration == iteration_type && !retry_update_url_.empty()) { -- cgit v1.2.1 From 6255b4fae6359f84fc2150b603faabb2187913dc Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 30 Apr 2020 13:49:38 -0700 Subject: Init usage_and_error_counts on startup (#3349) --- src/components/policy/policy_regular/src/cache_manager.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 8227090f5f..28ceec3ccb 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -1412,6 +1412,10 @@ std::shared_ptr CacheManager::GenerateSnapshot() { snapshot_->policy_table.module_meta = pt_->policy_table.module_meta; snapshot_->policy_table.usage_and_error_counts = pt_->policy_table.usage_and_error_counts; + snapshot_->policy_table.usage_and_error_counts->app_level = + pt_->policy_table.usage_and_error_counts->app_level; + snapshot_->policy_table.usage_and_error_counts->mark_initialized(); + snapshot_->policy_table.usage_and_error_counts->app_level->mark_initialized(); snapshot_->policy_table.device_data = pt_->policy_table.device_data; if (pt_->policy_table.vehicle_data.is_initialized()) { -- cgit v1.2.1