summaryrefslogtreecommitdiff
path: root/src/components/application_manager
diff options
context:
space:
mode:
authorIra Lytvynenko (GitHub) <ILytvynenko@luxoft.com>2020-04-03 18:24:01 +0300
committerGitHub <noreply@github.com>2020-04-03 11:24:01 -0400
commitddcd97db9cdc5455550ebc20bc64b068c610b32b (patch)
tree52c9e328167ae533813c5a82b26702618a4ca595 /src/components/application_manager
parent2d00adcb3c469e6cdb962cf7c4e384c568444b8b (diff)
downloadsdl_core-ddcd97db9cdc5455550ebc20bc64b068c610b32b.tar.gz
Remove redundant GetSystemInfo sending (#3305)
Diffstat (limited to 'src/components/application_manager')
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h6
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc5
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc15
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc11
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc18
5 files changed, 0 insertions, 55 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 daf87f3c36..4525433b8b 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
@@ -222,7 +222,6 @@ class PolicyHandler : public PolicyHandlerInterface,
*/
uint32_t TimeoutExchangeMSec() const OVERRIDE;
void OnExceededTimeout() OVERRIDE;
- void OnSystemReady() OVERRIDE;
const boost::optional<bool> LockScreenDismissalEnabledState() const OVERRIDE;
const boost::optional<std::string> LockScreenDismissalWarningMessage(
const std::string& language) const OVERRIDE;
@@ -383,11 +382,6 @@ class PolicyHandler : public PolicyHandlerInterface,
const std::string& language) OVERRIDE;
/**
- * @brief Send request to HMI to get update on system parameters
- */
- virtual void OnSystemInfoUpdateRequired() OVERRIDE;
-
- /**
* @brief Sends GetVehicleData request in case when Vechicle info is ready.
*/
virtual void OnVIIsReady() OVERRIDE;
diff --git a/src/components/application_manager/src/policies/policy_event_observer.cc b/src/components/application_manager/src/policies/policy_event_observer.cc
index afe909fee4..7ca4d7b5b8 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -70,11 +70,6 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) {
unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
break;
}
- case hmi_apis::FunctionID::BasicCommunication_OnReady: {
- policy_handler_->OnSystemReady();
- unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady);
- break;
- }
default: { break; }
}
}
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 9c0f5da73c..f41bb45dbf 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -376,10 +376,6 @@ const PolicySettings& PolicyHandler::get_settings() const {
bool PolicyHandler::InitPolicyTable() {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_OR_RETURN(false);
- // Subscribing to notification for system readiness to be able to get system
- // info necessary for policy table
- event_observer_->subscribe_on_event(
- hmi_apis::FunctionID::BasicCommunication_OnReady);
std::string preloaded_file = get_settings().preloaded_pt_file();
if (file_system::FileExists(preloaded_file)) {
const bool pt_inited =
@@ -987,12 +983,6 @@ void PolicyHandler::OnGetSystemInfo(const std::string& ccpu_version,
policy_manager_->SetSystemInfo(ccpu_version, wers_country_code, language);
}
-void PolicyHandler::OnSystemInfoUpdateRequired() {
- LOG4CXX_AUTO_TRACE(logger_);
- POLICY_LIB_CHECK_VOID();
- MessageHelper::SendGetSystemInfoRequest(application_manager_);
-}
-
void PolicyHandler::OnVIIsReady() {
LOG4CXX_AUTO_TRACE(logger_);
const uint32_t correlation_id =
@@ -1765,11 +1755,6 @@ void PolicyHandler::OnExceededTimeout() {
policy_manager_->OnExceededTimeout();
}
-void PolicyHandler::OnSystemReady() {
- POLICY_LIB_CHECK_VOID();
- policy_manager_->OnSystemReady();
-}
-
const boost::optional<bool> PolicyHandler::LockScreenDismissalEnabledState()
const {
POLICY_LIB_CHECK_OR_RETURN(boost::optional<bool>());
diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc
index a74b12071c..22d7a8cfa0 100644
--- a/src/components/application_manager/test/policy_event_observer_test.cc
+++ b/src/components/application_manager/test/policy_event_observer_test.cc
@@ -89,8 +89,6 @@ class PolicyEventObserverTest : public ::testing::Test {
EXPECT_CALL(policy_handler_mock_,
PTUpdatedAt(Counters::KILOMETERS, field_value))
.Times(pt_updated_calls_number);
- EXPECT_CALL(policy_handler_mock_, OnSystemReady())
- .Times(on_system_ready_calls_number);
policy_event_observer_->on_event(*event_);
}
@@ -125,15 +123,6 @@ TEST_F(PolicyEventObserverTest,
CheckResultsOnEvent(1u, 0u);
}
-TEST_F(PolicyEventObserverTest,
- OnEvent_EventBasicCommunication_OnReady_ExpectOnSystemReady) {
- // Arrange
- CreateEvent(Event::EventID::BasicCommunication_OnReady);
- CookSmartObject(hmi_apis::Common_Result::SUCCESS, field_name, field_value);
- // Check
- CheckResultsOnEvent(0u, 1u);
-}
-
} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 2b1fc6de1d..7a49431440 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -811,15 +811,6 @@ TEST_F(PolicyHandlerTest, OnExceededTimeout) {
policy_handler_.OnExceededTimeout();
}
-TEST_F(PolicyHandlerTest, OnSystemReady) {
- // Arrange
- EnablePolicyAndPolicyManagerMock();
- // Check expectations
- EXPECT_CALL(*mock_policy_manager_, OnSystemReady());
- // Act
- policy_handler_.OnSystemReady();
-}
-
TEST_F(PolicyHandlerTest, PTUpdatedAt_method_UseCounter_KILOMETERS) {
// Arrange
EnablePolicyAndPolicyManagerMock();
@@ -1366,15 +1357,6 @@ TEST_F(PolicyHandlerTest, IsApplicationRevoked) {
policy_handler_.IsApplicationRevoked(kPolicyAppId_);
}
-TEST_F(PolicyHandlerTest, OnSystemInfoUpdateRequired) {
- // Arrange
- ChangePolicyManagerToMock();
- // Check expectations
- EXPECT_CALL(mock_message_helper_, SendGetSystemInfoRequest(_));
- // Act
- policy_handler_.OnSystemInfoUpdateRequired();
-}
-
TEST_F(PolicyHandlerTest, GetAppRequestTypes) {
// Arrange
EnablePolicy();