diff options
author | Andrey Oleynik <aoleynik@luxoft.com> | 2016-01-29 12:39:53 +0200 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2016-02-03 13:05:03 +0200 |
commit | 79cced034150fb73c859f71fb0a67266e9a4dae0 (patch) | |
tree | 8e77164671599a9b685e1d29b0d0e7791171d443 /src/components/application_manager/test/state_controller | |
parent | 46d12c274cbe06074eb49b2fe99a0e5feb876e9e (diff) | |
download | sdl_core-79cced034150fb73c859f71fb0a67266e9a4dae0.tar.gz |
Fixes resume flow for non-media application during phone call and tests.
Non-media applicaton is allowed to be resumed to FULL during phone call
Closes-bug: APPLINK-16662
Conflicts:
src/components/application_manager/test/state_controller/state_controller_test.cc
Diffstat (limited to 'src/components/application_manager/test/state_controller')
-rw-r--r-- | src/components/application_manager/test/state_controller/state_controller_test.cc | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc index 1f6abac437..d9979e6fb6 100644 --- a/src/components/application_manager/test/state_controller/state_controller_test.cc +++ b/src/components/application_manager/test/state_controller/state_controller_test.cc @@ -253,10 +253,9 @@ class StateControllerTest : public ::testing::Test { switch (app_t) { case APP_TYPE_NON_MEDIA: { PrepareCommonStateResults(result_hmi_state); - result_hmi_state.push_back( - createHmiState(HMILevel::HMI_BACKGROUND, - AudioStreamingState::NOT_AUDIBLE, - SystemContext::SYSCTXT_MAIN)); + result_hmi_state.push_back(createHmiState( + HMILevel::HMI_FULL, AudioStreamingState::NOT_AUDIBLE, + SystemContext::SYSCTXT_MAIN)); break; } case APP_TYPE_MEDIA: { @@ -428,16 +427,27 @@ class StateControllerTest : public ::testing::Test { } ApplicationType AppType(uint32_t app_id) { - ApplicationType app_type; - if (simple_app_id_ == app_id) { - app_type = APP_TYPE_NON_MEDIA; - } else if (media_app_id_ == app_id || vc_app_id_ == app_id || - media_vc_app_id_ == app_id) { - app_type = APP_TYPE_MEDIA; - } else { - app_type = APP_TYPE_NAVI; + // TODO(AOleynik): Currently there is ongoing discussion regarding mixed + // application properties, i.e. is_media_application flag from RAI and + // AppHMITypes (NAVIGATION, etc.). Most likely logic should be changed + // after conclusion on APPLINK-20231 + std::vector<am::ApplicationSharedPtr>::iterator app = + std::find_if( + applications_list_.begin(), + applications_list_.end(), + [app_id](am::ApplicationSharedPtr a){return app_id == a->app_id();}); + + if (app == applications_list_.end()) { + return APP_TYPE_NON_MEDIA; + } + + if ((*app)->is_navi()) { + return APP_TYPE_NAVI; + } + if ((*app)->is_media_application()) { + return APP_TYPE_MEDIA; } - return app_type; + return APP_TYPE_NON_MEDIA; } void TestSetState(am::ApplicationSharedPtr app, |