summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/core_service.cc
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-08-12 14:45:25 +0300
committerAndrey Oleynik <aoleynik@luxoft.com>2017-08-16 22:56:22 +0300
commitc586d53a95d36558cd93342d0777590b03ed6e26 (patch)
tree5483949867c9f967c662ae1dcc7cff27434efe14 /src/components/application_manager/src/core_service.cc
parente343289acf819ae846a4766fe4f1da8097354799 (diff)
downloadsdl_core-c586d53a95d36558cd93342d0777590b03ed6e26.tar.gz
Fix UNSUPPORTED_RESOURCE response in case HMI RC interface is not available
There was no checks that RC interface is not ready on HMI side so SDL sends RC RPCs all time. Following changes were done: - Added IsInterfaceAvailable function to core service to check HMI interfaces availability - Added check of RC interface availability in base command request - Fixed unit tests due to changes in implementation
Diffstat (limited to 'src/components/application_manager/src/core_service.cc')
-rw-r--r--src/components/application_manager/src/core_service.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc
index cb49ff641a..b2dacefa7d 100644
--- a/src/components/application_manager/src/core_service.cc
+++ b/src/components/application_manager/src/core_service.cc
@@ -193,6 +193,17 @@ bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const {
return false;
}
+bool CoreService::IsInterfaceAvailable(
+ const HmiInterfaces::InterfaceID interface) const {
+#ifdef SDL_REMOTE_CONTROL
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceState state =
+ hmi_interfaces.GetInterfaceState(interface);
+ return HmiInterfaces::STATE_NOT_AVAILABLE != state;
+#endif // SDL_REMOTE_CONTROL
+ return false;
+}
+
void CoreService::RemoveHMIFakeParameters(
application_manager::MessagePtr& message) {
application_manager_.RemoveHMIFakeParameters(message);