Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdl passenger mode without ut implementation #2792

Conversation

LuxoftAKutsan
Copy link
Contributor

@LuxoftAKutsan LuxoftAKutsan commented Dec 21, 2018

Contains implementation of feature #2134

Do not contains Unit tests for the feature

All scripts from Ford-Luxoft/sdl_atf_test_scripts#1 passed

Feature overview :

Add optional lockScreenDismissalEnabled parameter to OnDriverDistraction notification to mobile.
Add lockScreenDismissalEnabled parameter to Policy (module_meta table).

In case if lockScreenDismissalEnabled is not available in policy table, SDL should not add lockScreenDismissalEnabled parameter to OnDriverDistraction notification to mobile.

In case if lockScreenDismissalEnabled is available in policy table, SDL should add it to OnDriverDistraction notification to mobile.

In case if SDL received OnDriverDistraction with DriverDistractionState = DD_OFF, SDL should not add lockScreenDismissalEnabled to OnDriverDistraction notification to mobile.

@@ -127,6 +127,14 @@ void OnDriverDistractionNotification::Run() {
(*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
state;

auto lock_screen_dismissal = application_manager_.GetPolicyHandler().LockScreenDismissalEnabledState();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan can be const

@@ -3387,6 +3387,14 @@ void ApplicationManagerImpl::SendDriverDistractionState(
mobile_api::FunctionID::OnDriverDistractionID;
(*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
driver_distraction_state();
auto lock_screen_dismissal = policy_handler_->LockScreenDismissalEnabledState();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan can be const

@@ -1600,6 +1600,11 @@ void PolicyHandler::OnSystemReady() {
policy_manager_->OnSystemReady();
}

const utils::OptionalVal<bool> PolicyHandler::LockScreenDismissalEnabledState() const {
POLICY_LIB_CHECK(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan probably return empty Value if policy library not available

@@ -6775,6 +6775,13 @@
<param name="state" type="DriverDistractionState" mandatory="true">
<description>Current State of Driver Distraction</description>
</param>
<param name="lockScreenDismissalEnabled" type="Boolean" mandatory="false">
<description>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan formating of xml should be fixed

@@ -148,6 +148,14 @@ class PolicyManagerImpl : public PolicyManager {
*/
void KmsChanged(int kilometers) OVERRIDE;

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan avoid description in overridings of the functions

if (module_config.lock_screen_dismissal_enabled.is_initialized()) {
return utils::OptionalVal<bool>(*module_config.lock_screen_dismissal_enabled);
}
return utils::OptionalVal<bool>(utils::OptionalVal<bool>::EMPTY);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan would be better to create initial empty variable and return it in CACHE_MANAGER_CHECK and outside the if. If it is possible to use this variable inside of, wold be wonderful

@@ -1267,6 +1270,17 @@ bool SQLPTRepresentation::SaveModuleConfig(
: query.Bind(8);
config.certificate.is_initialized() ? query.Bind(9, *(config.certificate))
: query.Bind(9);
LOG4CXX_WARN(logger_,
"AKUTSAN isi ninted "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan remove debug log

<< config.lock_screen_dismissal_enabled.is_initialized());

if (config.lock_screen_dismissal_enabled.is_initialized()) {
LOG4CXX_WARN(logger_, "AKUTSAN bind val");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan remove debug log

LOG4CXX_WARN(logger_, "AKUTSAN bind val");
query.Bind(10, *(config.lock_screen_dismissal_enabled));
} else {
LOG4CXX_WARN(logger_, "AKUTSAN bind null");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan remove debug log

@@ -41,6 +41,7 @@
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LuxoftAKutsan redundant emptyline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant