remove ref-fusion module, mmi-fusion in mmimgr.
also, remove ref-fusion-tests.
Change-Id: Ic1f734096e34d8fab99a632011b0ce06de013968
subdir('src/mmimgr')
subdir('src/bin')
-subdir('src/modules/ref_fusion')
subdir('src/modules/modality_keyboard')
subdir('src/modules/modality_vision')
subdir('tests')
subdir('tests/keyboard-provider')
subdir('tests/vision-provider')
-subdir('tests/ref-fusion')
%{_datadir}/iu/*
%{_datadir}/mmi-provider/*
%{_libdir}/provider/libmmi*.so
-%{_libdir}/fusion/libmmi*.so
%{_datadir}/packages/%{name}.xml
%files devel
%{_bindir}/mmi-manager-tests
%{_bindir}/modality_keyboard-tests
%{_bindir}/modality_vision-tests
-%{_bindir}/ref_fusion-tests
'mmi-provider.c',
'mmi-provider.h',
'mmi-provider-iface.h',
- 'mmi-fusion.c',
- 'mmi-fusion.h',
- 'mmi-fusion-iface.h',
'mmi-manager-dbg.h',
'mmi_stub.h',
'mmi_stub.c',
'mmi-manager-dbg.h',
'mmi-common.h',
'mmi-provider-iface.h',
- 'mmi-fusion-iface.h'
)
install_data('iu/data/default_rule.json', install_dir : '/usr/share/iu/')
typedef struct _mmi_provider_module mmi_provider_module;
typedef struct _mmi_provider_handle mmi_provider_handle;
-typedef struct _mmi_fusion_module_data mmi_fusion_module_data;
-typedef struct _mmi_fusion_module mmi_fusion_module;
-typedef struct _mmi_fusion_handle mmi_fusion_handle;
-
#define TIZEN_ERROR_MMI -0x030F0000
typedef enum {
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef __MMI_FUSION_IFACE_H__
-#define __MMI_FUSION_IFACE_H__
-
-#include "mmi-common.h"
-
-#define MMI_FUSION_ABI_MAJOR_MASK 0xFFFF0000
-#define MMI_FUSION_ABI_MINOR_MASK 0x0000FFFF
-
-#define MMI_FUSION_GET_ABI_MAJOR(m) (((m) & MMI_FUSION_ABI_MAJOR_MASK) >> 16)
-#define MMI_FUSION_GET_ABI_MINOR(m) ((m) & MMI_FUSION_ABI_MINOR_MASK)
-
-#define MMI_FUSION_SET_ABI_VERSION(major, minor) \
- ((((major) << 16) & MMI_FUSION_ABI_MAJOR_MASK) \
- | ((minor) & MMI_FUSION_ABI_MINOR_MASK))
-
-#define MMI_FUSION_API __attribute__ ((visibility("default")))
-
-struct _mmi_fusion_module
-{
- const char *name; /**< The name of a fusion module */
- const char *so_name; /**< The shared library name of a fusion module */
- unsigned long abi_version; /**< The API version of a fusion module */
-
- mmi_fusion_module_data *(*fusion_init)(void);
- void (*fusion_deinit)(mmi_fusion_module_data *fusion_data);
-};
-
-struct _mmi_fusion_handle
-{
- void *fusion_info;
- mmi_fusion_module *module_info;
- mmi_fusion_module_data *module_data;
- mmi_state state;
-};
-
-struct _mmi_fusion_module_data
-{
- mmi_state (*set_state)(mmi_state state);
- mmi_state (*get_state)(void);
-};
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//APIs for fusions
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__MMI_FUSION_IFACE_H__
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#include "mmi-fusion.h"
-#include "mmi-fusion-iface.h"
-#include "mmi-manager-dbg.h"
-
-#include <Ecore.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <dlfcn.h>
-#include <string.h>
-
-Eina_List *_fusion_list = NULL;
-int _loaded_fusion_cnt = 0;
-mmi_fusion_handle *_cur_fusion = NULL;
-
-int
-_fusion_load_module(const char *fusion_name)
-{
- mmi_fusion_handle *fusion = (mmi_fusion_handle *)calloc(1, sizeof(mmi_fusion_handle));
-
- if (!fusion)
- {
- LOGE("Failed to alloc fusion handle");
- return 0;
- }
-
- void *fusion_info = NULL;
- mmi_fusion_module *mmi_fusion_module_info = NULL;
-
- fusion_info = dlopen(fusion_name, RTLD_LAZY);
-
- if(!fusion_info)
- {
- LOGE("Failed to dlopen(error :%s, path :%s)!\n", dlerror(), fusion_name);
- goto err;
- }
-
- mmi_fusion_module_info = dlsym(fusion_info, "mmi_fusion_module_info");
-
- if(!mmi_fusion_module_info)
- {
- LOGE("Module(%s) dosen't have mmi_fusion_module_info \n", fusion_name);
- goto err;
- }
-
- if(!mmi_fusion_module_info->fusion_init || !mmi_fusion_module_info->fusion_deinit)
- {
- LOGE("Module(%s) doesn't have init/deinit function\n", fusion_name);
- goto err;
- }
-
- ++_loaded_fusion_cnt;
-
- fusion->fusion_info = fusion_info;
- fusion->module_info = mmi_fusion_module_info;
-
- //FIXME: init() of a fusion module needs to be called in mmi-manager
- //Right now, we initiate a fusion module found for the first time.
- if (_loaded_fusion_cnt == 1)
- {
- fusion->module_data = fusion->module_info->fusion_init();
- if (!fusion->module_data)
- {
- LOGE("Failed to init of a fusion module (name:%s) !\n", fusion->module_info->name);
- goto err;
- }
- _cur_fusion = fusion;
- }
-
- _fusion_list = eina_list_append(_fusion_list, fusion);
-
- return 1;
-
-err:
- if(fusion_info)
- dlclose(fusion_info);
-
- if(fusion)
- free(fusion);
- return 0;
-}
-
-int
-_modality_fusions_lookup(void)
-{
- int cnt = 0;
- DIR *dir;
- struct dirent *entry;
-
- dir = opendir(FUSION_PATH);
-
- if(!dir)
- {
- LOGE("no dir = %s\n", FUSION_PATH);
- return -1;
- }
-
- while((entry = readdir(dir)) != NULL)
- {
- char fusion_name[512];
- if(strstr(entry->d_name, "fusion") != NULL)
- {
- snprintf(fusion_name, sizeof(fusion_name), "%s%s", FUSION_PATH, entry->d_name);
- LOGD("Fusion full path = %s\n", fusion_name);
- cnt += _fusion_load_module(fusion_name);
- }
- }
-
- closedir(dir);
-
- return cnt;
-}
-
-mmi_fusion_handle *
-modality_fusions_get_client_fusion(mmi_client *client)
-{
- return _cur_fusion;
-}
-
-mmi_state
-modality_fusion_get_state(mmi_fusion_handle *fusion)
-{
- mmi_state state = MMI_STATE_NONE;
-
- if (!fusion)
- {
- LOGE("Given fusion handle is invalid !\n");
- return state;
- }
-
- state = fusion->module_data->get_state();
- return state;
-}
-
-mmi_state
-modality_fusion_set_state(mmi_fusion_handle *fusion, mmi_state state)
-{
- if (!fusion)
- {
- LOGE("Given fusion handle is invalid !\n");
- return MMI_STATE_NONE;
- }
-
- return fusion->module_data->set_state(state);
-}
-
-
-void
-modality_fusions_init(void)
-{
- int fusion_cnt = -1;
-
- LOGD("FUSION_PATH=%s\n", FUSION_PATH);
-
- fusion_cnt = _modality_fusions_lookup();
-
- if(fusion_cnt < 0)
- {
- LOGE("No find any fusion in path = %s\n", FUSION_PATH);
- return;
- }
-
- LOGD("%d fusion modules have been loaded !\n", fusion_cnt);
-}
-
-void
-modality_fusions_shutdown(void)
-{
- if(!_fusion_list)
- return;
-
- Eina_List *l = NULL;
- mmi_fusion_handle *fusion = NULL;
- EINA_LIST_FOREACH(_fusion_list, l, fusion)
- {
- if(fusion->module_info)
- {
- if(fusion->module_data)
- fusion->module_info->fusion_deinit(fusion->module_data);
- fusion->module_data = NULL;
- fusion->module_info = NULL;
- }
- if(fusion->fusion_info)
- dlclose(fusion->fusion_info);
- }
-
- _fusion_list = eina_list_free(_fusion_list);
- _fusion_list = NULL;
- _loaded_fusion_cnt = 0;
- _cur_fusion = NULL;
-}
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef __MMI_FUSION_H__
-#define __MMI_FUSION_H__
-
-#include "mmi-common.h"
-#include "mmi-client.h"
-
-mmi_fusion_handle *modality_fusions_get_client_fusion(mmi_client *client);
-mmi_state modality_fusion_get_state(mmi_fusion_handle *fusion);
-mmi_state modality_fusion_set_state(mmi_fusion_handle *fusion, mmi_state state);
-
-void modality_fusions_init(void);
-void modality_fusions_shutdown(void);
-
-#endif //__MMI_FUSION_H__
#include "mmi-manager.h"
#include "mmi-core.h"
-#include "mmi-fusion.h"
#include "mmi-provider.h"
#include "mmi-common.h"
#include "mmi-manager-dbg.h"
mmi_core_init();
modality_providers_init();
- modality_fusions_init();
client_manager_init();
mmi_api_handler_initialize();
mmi_api_handler_deinitialize();
client_manager_shutdown();
- modality_fusions_shutdown();
modality_providers_shutdown();
mmi_core_shutdown();
+++ /dev/null
-ref_fusion_srcs = [
- 'mmi-ref-fusion.h',
- 'mmi-ref-fusion.c',
- ]
-
-ref_fusion_include_dirs = include_directories('.')
-
-glib_dep = dependency('glib-2.0', method : 'pkg-config')
-dlog_dep = dependency('dlog', method : 'pkg-config')
-ecore_dep = dependency('ecore', method : 'pkg-config')
-
-ref_fusion_deps = [
- glib_dep,
- dlog_dep,
- ecore_dep,
- mmimgr_declared_dep
- ]
-
-mmi_fusion_prefix_libdir = join_paths(mmi_manager_prefix_libdir, 'fusion')
-
-ref_fusion_shared = shared_library(
- 'mmi_ref_fusion',
- ref_fusion_srcs,
- include_directories : [ref_fusion_include_dirs],
- dependencies : [ref_fusion_deps],
- install_dir : mmi_fusion_prefix_libdir,
- install : true,
- #pie : true
- )
-
-reffusion_declared_dep = declare_dependency(
- link_with : ref_fusion_shared,
- dependencies : [ ref_fusion_deps ],
- include_directories : [ ref_fusion_include_dirs ]
- )
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#include "mmi-ref-fusion.h"
-#include <mmi-client.h>
-#include <mmi-manager.h>
-#include <mmi-provider.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <Ecore.h>
-
-unsigned long long state_caps[MMI_STATE_TERMINATION+1] =
-{
- //MMI_STATE_NONE
- MODALITY_PROVIDER_CAP_NONE,
- //MMI_STATE_INITIATION
- MODALITY_PROVIDER_CAP_KEY_EVENT |
- MODALITY_PROVIDER_CAP_VOICE_EVENT |
- MODALITY_PROVIDER_CAP_GESTURE_EVENT,
- //MMI_STATE_EXPLORATION
- MODALITY_PROVIDER_CAP_KEY_EVENT |
- MODALITY_PROVIDER_CAP_VOICE_EVENT |
- MODALITY_PROVIDER_CAP_GESTURE_EVENT,
- //MMI_STATE_EXECUTION
- MODALITY_PROVIDER_CAP_KEY_EVENT |
- MODALITY_PROVIDER_CAP_VOICE_EVENT |
- MODALITY_PROVIDER_CAP_GESTURE_EVENT,
- //MMI_STATE_FEEDBACK
- MODALITY_PROVIDER_CAP_KEY_EVENT |
- MODALITY_PROVIDER_CAP_VOICE_EVENT |
- MODALITY_PROVIDER_CAP_GESTURE_EVENT,
- //MMI_STATE_OBSERVATION
- MODALITY_PROVIDER_CAP_VOICE_EVENT |
- MODALITY_PROVIDER_CAP_GESTURE_EVENT |
- MODALITY_PROVIDER_CAP_VISION_EVENT,
- //MMI_STATE_TERMINATION
- MODALITY_PROVIDER_CAP_KEY_EVENT |
- MODALITY_PROVIDER_CAP_VOICE_EVENT |
- MODALITY_PROVIDER_CAP_GESTURE_EVENT |
- MODALITY_PROVIDER_CAP_VISION_EVENT
-};
-
-mmi_client *_focus_client = NULL;
-mmi_state _prev_state = MMI_STATE_NONE;
-mmi_state _state = MMI_STATE_NONE;
-static Ecore_Event_Handler *_event_handlers;
-
-static Eina_Bool
-_focus_change_cb(void *data EINA_UNUSED, int type, void *event)
-{
- int r;
- mmi_state state = MMI_STATE_NONE;
- unsigned long long caps = MODALITY_PROVIDER_CAP_NONE;
-
- LOGI("...");
-
- mmi_manager_event_focus_change *ev = (mmi_manager_event_focus_change *)event;
-
- if (ev->cur_focus && ev->cur_focus != _focus_client)
- {
- LOGE("Abnormal situation ! (_focus_client=%p, ev->cur_focus=%p)\n",
- _focus_client, ev->cur_focus);
- return ECORE_CALLBACK_PASS_ON;
- }
-
- if (!ev->cur_focus && !ev->new_focus){
- state = _state;
- _state = MMI_STATE_NONE;
- }
- else if (ev->cur_focus)
- {
- //Set op_mode to MODALITY_PROVIDER_MODE_DROP_EVENT
- //state = client_manager_get_client_state(ev->cur_focus);
- LOGI("state=%d, ev->cur_focus(%p) !\n", state, ev->cur_focus);
- }
-
- if (state != MMI_STATE_NONE)
- {
- caps = state_caps[state];
- LOGI("caps=%llu!\n", caps);
-
- r = mmi_provider_set_op_mode_on_caps(caps, MODALITY_PROVIDER_MODE_DROP_EVENT);
- if (r)
- {
- LOGE("Failed on setting op_mode(%d) on caps(%llu) !\n",
- MODALITY_PROVIDER_MODE_DROP_EVENT, caps);
- return ECORE_CALLBACK_PASS_ON;
- }
- }
-
- _focus_client = ev->new_focus;
-
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static mmi_fusion_module_data *
-ref_fusion_init(void)
-{
- mmi_fusion_module_data *ref_fusion_data = NULL;
- LOGD("ref fusion init \n");
-
- ref_fusion_data = (mmi_fusion_module_data *)calloc(1, sizeof(mmi_fusion_module_data));
- if(!ref_fusion_data)
- {
- LOGE("Failed alloc ref fusion data \n");
- return NULL;
- }
-
- ref_fusion_data->get_state = ref_fusion_get_state;
- ref_fusion_data->set_state = ref_fusion_set_state;
-
- _event_handlers = ecore_event_handler_add(MMI_MANAGER_EVENT_FOCUS_CHANGE,
- _focus_change_cb, NULL);
-
- return ref_fusion_data;
-}
-
-mmi_state
-ref_fusion_set_state(mmi_state state)
-{
- int r;
- unsigned long long caps = MODALITY_PROVIDER_CAP_NONE;
-
- LOGD("ref_fusion_set_state(%d)\n", state);
-
- if (state == _state)
- {
- LOGE("Given state equals to existing state(%d) !\n", _state);
- return _state;
- }
-
- if (_state != MMI_STATE_NONE)
- {
- //Set op_mode to MODALITY_PROVIDER_MODE_DROP_EVENT
- caps = state_caps[_state];
-
- r = mmi_provider_set_op_mode_on_caps(caps, MODALITY_PROVIDER_MODE_DROP_EVENT);
- if (r)
- {
- LOGE("Failed on setting op_mode(%d) on caps(%llu) !\n",
- MODALITY_PROVIDER_MODE_DROP_EVENT, caps);
- }
- }
-
- if (state != MMI_STATE_NONE)
- {
- //Set op_mode to MODALITY_PROVIDER_MODE_PROPAGATE_EVENT
- caps = state_caps[state];
-
- r = mmi_provider_set_op_mode_on_caps(caps, MODALITY_PROVIDER_MODE_PROPAGATE_EVENT);
- if (r)
- {
- LOGE("Failed on setting op_mode(%d) on caps(%llu) !\n",
- MODALITY_PROVIDER_MODE_PROPAGATE_EVENT, caps);
- }
-
- }
-
- _state = state;
- return _state;
-}
-
-mmi_state
-ref_fusion_get_state(void)
-{
- LOGD("ref_fusion_get_state(%d)\n", _state);
- return _state;
-}
-
-static void
-ref_fusion_deinit(mmi_fusion_module_data *module_data)
-{
- if(!module_data)
- {
- LOGE("No have module data\n");
- return;
- }
-
- LOGD("ref_fusion_deinit\n");
-
- ecore_event_handler_del(_event_handlers);
- _event_handlers = NULL;
-
- module_data->get_state = NULL;
- module_data->set_state = NULL;
-
- free(module_data);
- module_data = NULL;
-}
-
-MMI_FUSION_API mmi_fusion_module mmi_fusion_module_info = {
- "ref_fusion",
- "libmmi_ref_fusion.so",
- MMI_FUSION_SET_ABI_VERSION(1,0),
- ref_fusion_init,
- ref_fusion_deinit
-};
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef __MMI_REF_FUSION_H__
-#define __MMI_REF_FUSION_H__
-
-#include <mmi-common.h>
-#include <mmi-fusion-iface.h>
-#include <mmi-manager-dbg.h>
-
-mmi_state ref_fusion_set_state(mmi_state state);
-mmi_state ref_fusion_get_state(void);
-
-#endif //__MMI_REF_FUSION_H__
'mmi-manager-tests.cpp',
'mmi-provider-tests.cpp',
'mmi-client-tests.cpp',
- 'mmi-fusion-tests.cpp',
'mmi-manager-main-tests.cpp',
'ecore-event-dispatcher.cpp',
'iu/intent_understanding_engine_rule_unittests.cpp',
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-#include "mmi-manager-tests.h"
-extern "C" {
-#include "mmi-fusion.h"
-}
-
-#include <Ecore.h>
-#include <dirent.h>
-#include <dlfcn.h>
-
-class MMIFusionTest : public ::testing::Test
-{
-public:
- void SetUp(void) override
- {
- ecore_init();
- }
-
- void TearDown(void) override
- {
- ecore_shutdown();
- }
-};
-
-TEST_F(MMIFusionTest, MMIFusionInitShutdown)
-{
- int res = 0;
- modality_fusions_init();
- res = 1;
-
- EXPECT_EQ(res, 1);
-
- modality_fusions_shutdown();
-}
-
-TEST_F(MMIFusionTest, MMIFusionGetClientFusion)
-{
- mmi_fusion_handle *fusion = NULL;
- mmi_client *client = NULL;
-
- modality_fusions_init();
-
- fusion = modality_fusions_get_client_fusion(client);
- EXPECT_NE(fusion, nullptr);
-
- modality_fusions_shutdown();
-}
-
-TEST_F(MMIFusionTest, MMIFusionSetGetState)
-{
- mmi_state state = MMI_STATE_NONE;
- mmi_fusion_handle *fusion = NULL;
- mmi_client *client = NULL;
-
- modality_fusions_init();
-
- fusion = modality_fusions_get_client_fusion(client);
- EXPECT_NE(fusion, nullptr);
-
- state = modality_fusion_get_state(NULL);
- EXPECT_EQ(state, MMI_STATE_NONE);
-
- //set_state Fail Case
- state = MMI_STATE_NONE;
- state = modality_fusion_set_state(NULL, MMI_STATE_INITIATION);
- EXPECT_EQ(state, MMI_STATE_NONE);
-
- //set_state Success Case
- state = MMI_STATE_NONE;
- state = modality_fusion_set_state(fusion, MMI_STATE_INITIATION);
- EXPECT_EQ(state, MMI_STATE_INITIATION);
-
- //get_state Fail Case
- state = modality_fusion_get_state(NULL);
- EXPECT_EQ(state, MMI_STATE_NONE);
-
- //get_state Success Case
- state = modality_fusion_get_state(fusion);
- EXPECT_EQ(state, MMI_STATE_INITIATION);
-
- modality_fusions_shutdown();
-}
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#include "main.h"
-
-int main(int argc, char **argv)
-{
- auto testResults = false;
-
-#ifdef TIZEN_TEST_GCOV
- setenv("GCOV_PREFIX", "/tmp", 1);
-#endif
- try
- {
- ::testing::InitGoogleMock(&argc, argv);
- ::testing::FLAGS_gtest_death_test_style = "fast";
- }
- catch ( ... )
- {
- PRINT("Error occurred while trying to initialize GoogleTest.\n");
- exit(EXIT_FAILURE);
- }
-
- try
- {
- testResults = (RUN_ALL_TESTS() == 0) ? true : false;
- }
- catch (const ::testing::internal::GoogleTestFailureException &e)
- {
- testResults = false;
- PRINT("GoogleTestFailureException has been thrown: %s\n", e.what());
- }
-
-#ifdef TIZEN_TEST_GCOV
- __gcov_flush();
-#endif
- return testResults;
-}
-
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef __MMI_REF_FUSION_TESTS_H__
-#define __MMI_REF_FUSION_TESTS_H__
-
-#include <stdio.h>
-#include <gmock/gmock.h>
-#include <Ecore.h>
-
-#define PRINT printf
-
-#ifdef TIZEN_TEST_GCOV
-extern "C" void __gcov_flush(void);
-#endif
-
-using ::testing::TestWithParam;
-using ::testing::Bool;
-using ::testing::Values;
-using ::testing::Combine;
-
-#endif //__MMI_REF_FUSION_TESTS_H__
+++ /dev/null
-ref_fusion_tests_srcs = [
- 'main.cpp',
- 'mmi-ref-fusion-tests.cpp'
- ]
-
-gmock_dep = dependency('gmock', method : 'pkg-config')
-ecore_dep = dependency('ecore', method : 'pkg-config')
-
-ref_fusion_tests_rpath = ('/' + get_option('libdir') + '/fusion/')
-
-executable(
- 'ref_fusion-tests',
- ref_fusion_tests_srcs,
- dependencies : [mmimgr_declared_dep, reffusion_declared_dep, gmock_dep, ecore_dep],
- install_rpath: ref_fusion_tests_rpath,
- install_dir : mmi_manager_prefix_bindir,
- install : true
- )
+++ /dev/null
-/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice (including the next
-* paragraph) shall be included in all copies or substantial portions of the
-* Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-* DEALINGS IN THE SOFTWARE.
-*/
-
-#include "main.h"
-
-extern "C" {
-#include "mmi-ref-fusion.h"
-}
-
-#include <Ecore.h>
-#include <string.h>
-#include <gtest/gtest.h>
-
-class MMIRefFusionTest : public ::testing::Test
-{
-public:
- void SetUp(void) override
- {
- ecore_init();
- }
-
- void TearDown(void) override
- {
- ecore_shutdown();
- }
-};
-
-TEST_F(MMIRefFusionTest, MMIRefFusionSetGetMode)
-{
- mmi_state state = MMI_STATE_NONE;
-
- state = ref_fusion_set_state(MMI_STATE_INITIATION);
- EXPECT_EQ(state, MMI_STATE_INITIATION);
-
- state = MMI_STATE_NONE;
- state = ref_fusion_get_state();
- EXPECT_EQ(state, MMI_STATE_INITIATION);
-
- state = ref_fusion_set_state(MMI_STATE_EXPLORATION);
- EXPECT_EQ(state, MMI_STATE_EXPLORATION);
-
- state = ref_fusion_set_state(MMI_STATE_EXPLORATION);
- EXPECT_EQ(state, MMI_STATE_EXPLORATION);
-}