Skip to content

Commit 41e6f89

Browse files
committed
fixup! Added sending error on PTU retries exceed allowed count
1 parent 335ec9b commit 41e6f89

File tree

5 files changed

+8
-59
lines changed

5 files changed

+8
-59
lines changed

src/components/application_manager/include/application_manager/message_helper.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,6 @@ class MessageHelper {
8888
static smart_objects::SmartObjectSPtr CreateHMINotification(
8989
hmi_apis::FunctionID::eType function_id);
9090

91-
/**
92-
* @brief CreateOnSystemRequestNotificationToMobile creates mobile
93-
* OnSystemRequestNotification
94-
* @param policy_data pt snapshot data
95-
* @param connection_key connection key of application
96-
* @param request_type OnSystemRequest request type
97-
* @return OnSystemRequest notification smart object
98-
*/
99-
static smart_objects::SmartObjectSPtr
100-
CreateOnSystemRequestNotificationToMobile(
101-
const std::vector<uint8_t>& policy_data,
102-
const uint32_t connection_key,
103-
const mobile_apis::RequestType::eType request_type);
104-
10591
/**
10692
* @brief ServiceStatusUpdateNotificationBuilder small utility class used for
10793
* more flexible construction of OnServiceUpdateNotification

src/components/application_manager/src/message_helper/message_helper.cc

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,49 +2370,32 @@ bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) {
23702370
return app_mngr.GetRPCService().ManageHMICommand(result);
23712371
}
23722372

2373-
smart_objects::SmartObjectSPtr
2374-
MessageHelper::CreateOnSystemRequestNotificationToMobile(
2375-
const std::vector<uint8_t>& policy_data,
2376-
const uint32_t app_id,
2377-
const mobile_apis::RequestType::eType request_type) {
2378-
auto notification =
2379-
CreateNotification(mobile_apis::FunctionID::OnSystemRequestID, app_id);
2380-
2381-
(*notification)[strings::params][strings::binary_data] =
2382-
smart_objects::SmartObject(policy_data);
2383-
2384-
(*notification)[strings::msg_params][strings::request_type] = request_type;
2385-
2386-
return notification;
2387-
}
2388-
23892373
void MessageHelper::SendPolicySnapshotNotification(
23902374
uint32_t connection_key,
23912375
const std::vector<uint8_t>& policy_data,
23922376
const std::string& url,
23932377
ApplicationManager& app_mngr) {
2378+
smart_objects::SmartObject content(smart_objects::SmartType_Map);
23942379
const auto request_type =
23952380
#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
23962381
mobile_apis::RequestType::PROPRIETARY;
23972382
#else
23982383
mobile_apis::RequestType::HTTP;
23992384
#endif // PROPRIETARY || EXTERNAL_PROPRIETARY_MODE
2400-
auto notification = CreateOnSystemRequestNotificationToMobile(
2401-
policy_data, connection_key, request_type);
2385+
2386+
content[strings::msg_params][strings::request_type] = request_type;
24022387

24032388
if (!url.empty()) {
2404-
(*notification)[strings::msg_params][strings::url] =
2389+
content[strings::msg_params][strings::url] =
24052390
url; // Doesn't work with mobile_notification::syncp_url ("URL")
24062391
} else {
24072392
LOG4CXX_WARN(logger_, "No service URLs");
24082393
}
24092394

2410-
(*notification)[strings::params][strings::binary_data] =
2395+
content[strings::params][strings::binary_data] =
24112396
smart_objects::SmartObject(policy_data);
24122397

2413-
PrintSmartObject(*notification);
2414-
app_mngr.GetRPCService().ManageMobileCommand(notification,
2415-
commands::Command::SOURCE_SDL);
2398+
SendSystemRequestNotification(connection_key, content, app_mngr);
24162399
}
24172400

24182401
void MessageHelper::SendSystemRequestNotification(

src/components/application_manager/src/policies/policy_handler.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,13 +1477,8 @@ void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string,
14771477
}
14781478

14791479
if (PTUIterationType::RetryIteration == iteration_type) {
1480-
auto on_system_request_notification =
1481-
MessageHelper::CreateOnSystemRequestNotificationToMobile(
1482-
pt_string,
1483-
GetAppIdForSending(),
1484-
mobile_apis::RequestType::PROPRIETARY);
1485-
application_manager_.GetRPCService().ManageMobileCommand(
1486-
on_system_request_notification, commands::Command::SOURCE_SDL);
1480+
MessageHelper::SendPolicySnapshotNotification(
1481+
GetAppIdForSending(), pt_string, std::string(""), application_manager_);
14871482
} else {
14881483
MessageHelper::SendPolicyUpdate(
14891484
policy_snapshot_full_path,

src/components/application_manager/test/include/application_manager/mock_message_helper.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ class MockMessageHelper {
139139
MOCK_METHOD2(SendDecryptCertificateToHMI,
140140
void(const std::string& file_name,
141141
ApplicationManager& app_mngr));
142-
MOCK_METHOD3(CreateOnSystemRequestNotificationToMobile,
143-
smart_objects::SmartObjectSPtr(
144-
const std::vector<uint8_t>& policy_data,
145-
const uint32_t connection_key,
146-
const mobile_apis::RequestType::eType request_type));
147142
#ifdef EXTERNAL_PROPRIETARY_MODE
148143
MOCK_METHOD4(
149144
SendGetListOfPermissionsResponse,

src/components/application_manager/test/mock_message_helper.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -618,16 +618,6 @@ MessageHelper::ServiceStatusUpdateNotificationBuilder::notification() const {
618618
return MockMessageHelper::on_service_update_builder_mock()->notification();
619619
}
620620

621-
smart_objects::SmartObjectSPtr
622-
MessageHelper::CreateOnSystemRequestNotificationToMobile(
623-
const std::vector<uint8_t>& policy_data,
624-
const uint32_t connection_key,
625-
const mobile_apis::RequestType::eType request_type) {
626-
return MockMessageHelper::message_helper_mock()
627-
->CreateOnSystemRequestNotificationToMobile(
628-
policy_data, connection_key, request_type);
629-
}
630-
631621
smart_objects::SmartObject MessageHelper::CreateAppServiceCapabilities(
632622
std::vector<smart_objects::SmartObject>& all_services) {
633623
return MockMessageHelper::message_helper_mock()->CreateAppServiceCapabilities(

0 commit comments

Comments
 (0)