summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/policies
diff options
context:
space:
mode:
authorShobhit Adlakha <ShobhitAd@users.noreply.github.com>2020-09-21 13:56:27 -0400
committerGitHub <noreply@github.com>2020-09-21 13:56:27 -0400
commit93202c39ac25d6bd6ccd1c9df948106dab38acfa (patch)
tree421e7f7d619195801be9c8feafa921eb3e7cf79d /src/components/application_manager/src/policies
parent1f52a0ef360475ba268c49e1eec8b0a93050f132 (diff)
downloadsdl_core-93202c39ac25d6bd6ccd1c9df948106dab38acfa.tar.gz
Fix/Delay OnHMIStatus until RAI response is sent (#3506)
* Add is_ready flag to apps and handle sending OnHMIStatus after RAI response * Add mock functions * Address review comments * Only send delayed onHMIStatus if RAI was a success * Prevent secondary hmi level none to cloud apps * Move enabled check to last when init new cloud app Co-authored-by: JackLivio <jack@livio.io>
Diffstat (limited to 'src/components/application_manager/src/policies')
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 6a7c9abb33..8ec21660a8 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -2331,12 +2331,6 @@ void PolicyHandler::OnSetCloudAppProperties(
policy_manager_->InitCloudApp(policy_app_id);
bool auth_token_update = false;
- if (properties.keyExists(strings::enabled)) {
- bool enabled = properties[strings::enabled].asBool();
- policy_manager_->SetCloudAppEnabled(policy_app_id, enabled);
- auth_token_update = enabled;
- application_manager_.RefreshCloudAppInformation();
- }
if (properties.keyExists(strings::auth_token)) {
std::string auth_token = properties[strings::auth_token].asString();
policy_manager_->SetAppAuthToken(policy_app_id, auth_token);
@@ -2370,6 +2364,14 @@ void PolicyHandler::OnSetCloudAppProperties(
policy_manager_->SetHybridAppPreference(policy_app_id,
hybrid_app_preference);
}
+ if (properties.keyExists(strings::enabled)) {
+ bool enabled = properties[strings::enabled].asBool();
+ policy_manager_->SetCloudAppEnabled(policy_app_id, enabled);
+ if (!auth_token_update) {
+ auth_token_update = enabled;
+ }
+ application_manager_.RefreshCloudAppInformation();
+ }
if (auth_token_update) {
AppProperties app_properties;