summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Hrytsevich <AHrytsevich@luxoft.com>2016-04-07 09:31:27 +0300
committerAnton Hrytsevich <AHrytsevich@luxoft.com>2016-04-11 12:21:36 +0300
commit780024cf25e39de01e38966ead80ca6590251a53 (patch)
tree4bef82eadb37a8d45c18943227f5f7063157a060 /src
parentd4d40322cfb33783d0fb0e8aad10c4a8e3f18a20 (diff)
downloadsdl_core-780024cf25e39de01e38966ead80ca6590251a53.tar.gz
Fix send send LAUNCH_APP to background app
After CRQ this feature was lose. Create additional sequence in case register v4 apps to fing foregraund app and send to it OnSystemRequest(LAUNCH_APP). (bug-fixes) [APPLINK-11308](https://adc.luxoft.com/jira/browse/APPLINK-11308).
Diffstat (limited to 'src')
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
index 88341d9ba3..cb2cd0b881 100644
--- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
+++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,8 @@
*/
#include "application_manager/commands/hmi/sdl_activate_app_request.h"
-#include "application_manager/application_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
namespace application_manager {
@@ -67,16 +68,17 @@ void SDLActivateAppRequest::Run() {
}
}
+ DevicesApps devices_apps = FindAllAppOnParticularDevice(app->device());
+ if (!devices_apps.first && devices_apps.second.empty()) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find regular foreground app with the same "
+ "connection id:"
+ << app->device());
+ SendResponse(correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED);
+ return;
+ }
+
if (!app->IsRegistered()) {
- DevicesApps devices_apps = FindAllAppOnParticularDevice(app->device());
- if (!devices_apps.first && devices_apps.second.empty()) {
- LOG4CXX_ERROR(logger_,
- "Can't find regular foreground app with the same "
- "connection id:"
- << app->device());
- SendResponse(correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED);
- return;
- }
if (devices_apps.first) {
MessageHelper::SendLaunchApp(
devices_apps.first->app_id(), app->SchemaUrl(), app->PackageName());
@@ -90,10 +92,14 @@ void SDLActivateAppRequest::Run() {
}
subscribe_on_event(BasicCommunication_OnAppRegistered);
} else {
- const uint32_t application_id = app_id();
- application_manager::ApplicationManagerImpl::instance()
- ->GetPolicyHandler().OnActivateApp(application_id,
- correlation_id());
+ if (devices_apps.first) {
+ MessageHelper::SendLaunchApp(
+ devices_apps.first->app_id(), app->SchemaUrl(), app->PackageName());
+ } else {
+ application_manager::ApplicationManagerImpl::instance()
+ ->GetPolicyHandler()
+ .OnActivateApp(application_id, correlation_id());
+ }
}
}
@@ -125,7 +131,8 @@ void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
logger_, "Application not found by HMI app id: " << hmi_application_id);
return;
}
- application_manager::ApplicationManagerImpl::instance()->GetPolicyHandler()
+ application_manager::ApplicationManagerImpl::instance()
+ ->GetPolicyHandler()
.OnActivateApp(app->app_id(), correlation_id());
}