diff options
Diffstat (limited to 'src/components/application_manager/src/application_manager_impl.cc')
-rw-r--r-- | src/components/application_manager/src/application_manager_impl.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 45a956e104..5dcc5868fa 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -220,6 +220,22 @@ ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor, } template <class UnaryPredicate> +ApplicationSharedPtr FindApp( + DataAccessor<ApplicationManagerImpl::AppsWaitRegistrationSet> accessor, + UnaryPredicate finder) { + ApplicationManagerImpl::AppsWaitRegistrationSet::const_iterator it = + std::find_if( + accessor.GetData().begin(), accessor.GetData().end(), finder); + if (accessor.GetData().end() == it) { + LOGGER_DEBUG(logger_, "Unable to find application"); + return ApplicationSharedPtr(); + } + ApplicationSharedPtr app = *it; + LOGGER_DEBUG(logger_, " Found Application app_id = " << app->app_id()); + return app; +} + +template <class UnaryPredicate> std::vector<ApplicationSharedPtr> FindAllApps( DataAccessor<ApplicationSet> accessor, UnaryPredicate finder) { std::vector<ApplicationSharedPtr> result; @@ -258,6 +274,14 @@ ApplicationSharedPtr ApplicationManagerImpl::application_by_policy_id( return FindApp(accessor, finder); } +ApplicationSharedPtr ApplicationManagerImpl::FindAppToRegister( + const uint32_t app_id) const { + HmiAppIdPredicate finder(app_id); + DataAccessor<AppsWaitRegistrationSet> accessor(apps_to_register_, + apps_to_register_list_lock_); + return FindApp(accessor, finder); +} + bool ActiveAppPredicate(const ApplicationSharedPtr app) { return app ? app->IsFullscreen() : false; } |