diff options
author | Alexander Kutsan <AKutsan@luxoft.com> | 2015-03-06 14:24:47 +0200 |
---|---|---|
committer | Aleksandr Galiuzov <AGaliuzov@luxoft.com> | 2015-04-15 14:12:50 +0300 |
commit | e40cfdb836d3dc00d6c6b3c42a43c88823bf3473 (patch) | |
tree | d84a04981b883e46d741ca7d451c5aa12b1aff7e /src/components/application_manager/src/state_context.cc | |
parent | ff5b7a59411fee50eac83274eb73c9477fcdf8df (diff) | |
download | sdl_core-e40cfdb836d3dc00d6c6b3c42a43c88823bf3473.tar.gz |
APPLINK-8555 Add State context
Add states list to StateController
If App is registered and there are some active states, app should get HMI status according to active HMIstates
Conflicts:
src/components/application_manager/src/application_manager_impl.cc
src/components/application_manager/src/request_info.cc
Diffstat (limited to 'src/components/application_manager/src/state_context.cc')
-rw-r--r-- | src/components/application_manager/src/state_context.cc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/components/application_manager/src/state_context.cc b/src/components/application_manager/src/state_context.cc new file mode 100644 index 0000000000..37f53977df --- /dev/null +++ b/src/components/application_manager/src/state_context.cc @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include "application_manager/state_context.h" +#include "application_manager/application_manager_impl.h" +namespace application_manager { + + +bool StateContext::is_navi_app(const uint32_t app_id) const { + ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id); + DCHECK_OR_RETURN(app, false); + return app ? app->is_navi() : false; +} + +bool StateContext::is_meida_app(const uint32_t app_id) const { + ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id); + return app ? app->is_media_application() : false; +} + +bool StateContext::is_voice_comunication_app(const uint32_t app_id) const { + ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application(app_id); + return app ? app->is_voice_communication_supported() : false; +} + +bool StateContext::is_attenuated_supported() const{ + const HMICapabilities& hmi_capabilities = + ApplicationManagerImpl::instance()->hmi_capabilities(); + return hmi_capabilities.attenuated_supported(); +} + +} |