BuildRequires: meson
BuildRequires: tidl
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(glib-2.0)
#ifndef __MMI_COMMON_H__
#define __MMI_COMMON_H__
+#include <system_info.h>
+
#include "mmi-log.h"
#ifdef __cplusplus
#define MMI_API __attribute__ ((visibility("default")))
+#define MMI_FEATURE_PATH "http://tizen.org/feature/multimodal_interaction"
+
#ifdef __cplusplus
}
#endif
gio_dep = dependency('gio-2.0', method : 'pkg-config')
ecore_dep = dependency('ecore', method : 'pkg-config')
xml_dep = dependency('libxml-2.0', method : 'pkg-config')
+capi_system_info_dep = dependency('capi-system-info', method : 'pkg-config')
mmi_deps = [
ecore_dep,
glib_dep,
gio_dep,
- xml_dep
+ xml_dep,
+ capi_system_info_dep
]
foreach platform_specific_dependency : mmi_platform_specific_dependencies
#include <mmi-attribute.h>
#include "mmi-log.h"
+#include "mmi-common.h"
#include <cstdio>
static constexpr size_t g_unit_size = sizeof(mmi_primitive_value_h);
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
int mmi_attribute_create(mmi_primitive_value_h value, const char *name, mmi_attribute_h *attribute) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == value || nullptr == name || nullptr == attribute) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_set_name(mmi_attribute_h attribute, const char *name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute || nullptr == name) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_get_name(mmi_attribute_h attribute, char **name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute || nullptr == name) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_get_value(mmi_attribute_h attribute, mmi_primitive_value_h *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute || nullptr == value) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_clone(mmi_attribute_h attribute, mmi_attribute_h *cloned) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute || nullptr == cloned) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_destroy(mmi_attribute_h attribute) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute) {
_E("[ERROR] Parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_to_bytes(mmi_attribute_h attribute, unsigned char **bytes, size_t *length) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute || nullptr == bytes || nullptr == length) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_from_bytes(const unsigned char *bytes, size_t length, mmi_attribute_h *attribute) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == bytes || 0 == length || nullptr == attribute) {
_E("[ERROR] Some parameters are null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_attribute_create_string_array(const char *name, const char *strings[], size_t count, mmi_attribute_h *attribute) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == attribute || nullptr == name || nullptr == strings || 0 == count) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
#include <vector>
#include "mmi-log.h"
+#include "mmi-common.h"
#include <mmi-error.h>
#include <mmi-data.h>
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
struct mmi_data_timestamp_s {
bool valid;
}
int mmi_data_create_bool(bool value, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_int(int value, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
int mmi_data_create_float(float value, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_text(const char *value, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_audio(const void *ptr, size_t len, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == ptr || 0 == len) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_video(const void *ptr, size_t len, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == ptr || 0 == len) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_user_identification(const void *ptr, size_t len, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == ptr || 0 == len) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_coordinate(int x, int y, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_bounding_box(int x, int y, int w, int h, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_array(mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_add_array_element(mmi_data_h array, mmi_data_h element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == array || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_create_struct(mmi_data_h *struct_handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == struct_handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_set_struct_element(mmi_data_h struct_handle, const char *name, mmi_data_h element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == struct_handle || nullptr == name || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_type(mmi_data_h data, mmi_data_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == type) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_bool(mmi_data_h data, bool *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_int(mmi_data_h data, int *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_float(mmi_data_h data, float *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_text(mmi_data_h data, const char **text) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == text) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_audio(mmi_data_h data, const void **ptr, size_t *len) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == ptr || nullptr == len) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_video(mmi_data_h data, const void **ptr, size_t *len) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == ptr || nullptr == len) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_user_identification(mmi_data_h data, const void **ptr, size_t *len) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == ptr || nullptr == len) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_coordinate(mmi_data_h data, int *x, int *y) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == x || nullptr == y) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_bounding_box(mmi_data_h data, int *x, int *y, int *w, int *h) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == x || nullptr == y || nullptr == w || nullptr == h) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_array_count(mmi_data_h array, size_t *count) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == array || nullptr == count) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_array_element(mmi_data_h array, size_t index, mmi_data_h *element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == array || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_struct_element(mmi_data_h struct_handle, const char *name, mmi_data_h *element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == struct_handle || nullptr == name || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_struct_count(mmi_data_h struct_handle, size_t *count) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == struct_handle || nullptr == count) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_get_struct_element_name(mmi_data_h struct_handle, size_t index, const char **string) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == struct_handle || nullptr == string) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
int mmi_data_get_struct_element_value(mmi_data_h struct_handle, size_t index, mmi_data_h *element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == struct_handle || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_destroy(mmi_data_h data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_to_bytes(mmi_data_h data, unsigned char **bytes, size_t *length) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == bytes || nullptr == length) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_data_from_bytes(unsigned char *bytes, size_t length, mmi_data_h *data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == data || nullptr == bytes || 0 == length) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
#include "mmi-node-types.h"
#include "mmi-log.h"
+#include "mmi-common.h"
+
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
int mmi_node_create_source(mmi_node_source_type_e type, mmi_node_h *node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_get_source_type(mmi_node_h node, mmi_node_source_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == type || nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_create_processor(mmi_node_processor_type_e type, mmi_node_h *node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_get_processor_type(mmi_node_h node, mmi_node_processor_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == type) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_create_logic(mmi_node_logic_type_e type, mmi_node_h *node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_get_logic_type(mmi_node_h node, mmi_node_logic_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_create_controller(mmi_node_controller_type_e type, mmi_node_h *node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_get_controller_type(mmi_node_h node, mmi_node_controller_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == type) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_create_action(mmi_node_action_type_e type, mmi_node_h *node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_get_action_type(mmi_node_h node, mmi_node_action_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == type) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_create_custom(const char *custom_type_id, mmi_node_h *node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_get_custom_type(mmi_node_h node, const char **custom_type_id) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == custom_type_id) {
return MMI_ERROR_INVALID_PARAMETER;
}
#include "mmi-plugin-storage.h"
#include "mmi-log.h"
+#include "mmi-common.h"
#include <new>
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
+
int mmi_node_add_port(mmi_node_h node, mmi_port_h port) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
// LCOV_EXCL_START
int mmi_node_find_port(mmi_node_h node, mmi_port_type_e port_type, const char *port_name, mmi_port_h *port) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == port_name || nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_link(mmi_node_h from_node, mmi_node_h to_node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == from_node || nullptr == to_node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_link_by_name(mmi_node_h from_node, const char *from_port_name, mmi_node_h to_node, const char *to_port_name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == from_node || nullptr == from_port_name || nullptr == to_node || nullptr == to_port_name) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
// LCOV_EXCL_STOP
int mmi_node_get_type(mmi_node_h node, mmi_node_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == type) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_get_port_count(mmi_node_h node, size_t *port_count) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == port_count) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_get_port(mmi_node_h node, size_t index, mmi_port_h *port) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_get_callbacks(mmi_node_h node, mmi_node_callbacks_s *callbacks) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == callbacks) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_set_initialized_cb(mmi_node_h node, mmi_node_initialized_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_set_deinitialized_cb(mmi_node_h node, mmi_node_deinitialized_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_set_attribute_set_cb(mmi_node_h node, mmi_node_attribute_set_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_set_activated_cb(mmi_node_h node, mmi_node_activated_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_set_deactivated_cb(mmi_node_h node, mmi_node_deactivated_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_set_signal_received_cb(mmi_node_h node, mmi_node_signal_received_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_register(mmi_node_h node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_clone(mmi_node_h node, mmi_node_h *cloned) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node || nullptr == cloned) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_node_destroy(mmi_node_h node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_START
int mmi_node_instance_set_attribute(mmi_node_instance_h instance, mmi_attribute_h attribute) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (instance == NULL || attribute == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_instance_find_port_instance(mmi_node_instance_h node_instance, mmi_port_type_e port_type, const char *port_name, mmi_port_instance_h *port_instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (node_instance == NULL || port_name == NULL || port_instance == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_instance_find_by_port_instance(mmi_port_instance_h port_instance, mmi_node_instance_h *node_instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (port_instance == NULL || node_instance == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_instance_find_sibling_port_instance(mmi_port_instance_h instance, const char *port_name, mmi_port_instance_h *sibling) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (instance == NULL || port_name == NULL || sibling == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_instance_emit_signal(mmi_node_instance_h instance, mmi_signal_h signal) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (instance == NULL || signal == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
int mmi_node_instance_update_pending_activation_result(mmi_node_instance_h instance, mmi_error_e result) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (instance == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_STOP
#include <new>
#include <cstdio>
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
+
MMI_API int mmi_port_create(mmi_port_h *port) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_get_name(mmi_port_h port, char **name, size_t *length) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == name || nullptr == length) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_get_type(mmi_port_h port, mmi_port_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == type) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_get_data_type(mmi_port_h port, mmi_data_type_e *data_type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == data_type) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_get_callbacks(mmi_port_h port, mmi_port_callbacks_s *callbacks) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == callbacks) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_set_name(mmi_port_h port, const char *name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == name) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_set_type(mmi_port_h port, mmi_port_type_e type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_set_data_type(mmi_port_h port, mmi_data_type_e data_type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-MMI_API int mmi_port_set_output_format_requested_cb(mmi_port_h port, mmi_port_output_format_requested_cb callback, void *user_data)
-{
+MMI_API int mmi_port_set_output_format_requested_cb(mmi_port_h port, mmi_port_output_format_requested_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
if (nullptr == port) {
LOGE("[ERROR] Port is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-MMI_API int mmi_port_set_input_data_received_cb(mmi_port_h port, mmi_port_input_data_received_cb callback, void *user_data)
-{
+MMI_API int mmi_port_set_input_data_received_cb(mmi_port_h port, mmi_port_input_data_received_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == callback) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_clone(mmi_port_h port, mmi_port_h *cloned) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port || nullptr == cloned) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_destroy(mmi_port_h port) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
// LCOV_EXCL_START
MMI_API int mmi_port_instance_generate_output(mmi_port_instance_h instance, mmi_data_h data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_port_instance_request_auto_transform(mmi_port_instance_h instance, const char *from_format, const char *to_format) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
return MMI_ERROR_NONE;
}
MMI_API int mmi_port_instance_request_input_data_format(mmi_port_instance_h instance, const char *format) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
return MMI_ERROR_NONE;
}
MMI_API int mmi_port_instance_announce_output_data_format(mmi_port_instance_h instance, const char *format) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
return MMI_ERROR_NONE;
}
// LCOV_EXCL_STOP
#include <mmi-primitive-value.h>
#include "mmi-log.h"
+#include "mmi-common.h"
struct mmi_primitive_value_s {
static const size_t g_unit_size = sizeof(mmi_primitive_value_h);
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
static inline size_t get_array_count(mmi_primitive_value_h array) {
if (nullptr != array) {
}
int mmi_primitive_value_create_int(int data, mmi_primitive_value_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_create_float(float data, mmi_primitive_value_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_create_string(const char *data, mmi_primitive_value_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == data) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_create_bool(bool data, mmi_primitive_value_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_create_array(mmi_primitive_value_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_add_array_element(mmi_primitive_value_h array, mmi_primitive_value_h element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == array || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_type(mmi_primitive_value_h handle, mmi_primitive_value_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == type) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_int(mmi_primitive_value_h handle, int *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_float(mmi_primitive_value_h handle, float *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_string(mmi_primitive_value_h handle, const char **string) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == string) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_bool(mmi_primitive_value_h handle, bool *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == value) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_array_count(mmi_primitive_value_h array, size_t *count) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == array || nullptr == count) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_get_array_element(mmi_primitive_value_h array, size_t index, mmi_primitive_value_h *element) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == array || nullptr == element) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_clone(mmi_primitive_value_h handle, mmi_primitive_value_h *cloned) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == cloned) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
}
int mmi_primitive_value_destroy(mmi_primitive_value_h handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-int mmi_primitive_value_to_bytes(mmi_primitive_value_h handle, unsigned char **bytes, size_t *size)
-{
+int mmi_primitive_value_to_bytes(mmi_primitive_value_h handle, unsigned char **bytes, size_t *size) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == handle || nullptr == bytes || nullptr == size) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-int mmi_primitive_value_from_bytes(unsigned char *bytes, size_t size, mmi_primitive_value_h *handle)
-{
+int mmi_primitive_value_from_bytes(unsigned char *bytes, size_t size, mmi_primitive_value_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == bytes || nullptr == handle) {
_E("[ERROR] Some parameters are invalid");
return MMI_ERROR_INVALID_PARAMETER;
#include <stdio.h>
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
+
MMI_API int mmi_signal_parameter_create(mmi_primitive_value_h value, const char *name, mmi_signal_parameter_h *signal_parameter) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (signal_parameter == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_parameter_get_name(mmi_signal_parameter_h signal_parameter, char **name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (signal_parameter == NULL || name == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_parameter_get_value(mmi_signal_parameter_h signal_parameter, mmi_primitive_value_h *value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (signal_parameter == NULL || value == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_parameter_clone(mmi_signal_parameter_h signal_parameter, mmi_signal_parameter_h *cloned) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (signal_parameter == NULL || cloned == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_parameter_destroy(mmi_signal_parameter_h signal_parameter) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (signal_parameter == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_create(const char *name, mmi_signal_h *handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (handle == NULL || name == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_add_parameter(mmi_signal_h handle, mmi_signal_parameter_h parameter) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (handle == NULL || parameter == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_get_name(mmi_signal_h handle, char **name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (handle == NULL || name == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_get_parameter_count(mmi_signal_h handle, int *count) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (handle == NULL || count == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_get_parameter(mmi_signal_h handle, int index, mmi_signal_parameter_h *parameter) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (handle == NULL || parameter == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_signal_destroy(mmi_signal_h handle) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (handle == NULL) {
return MMI_ERROR_INVALID_PARAMETER;
}
extern ClientManager g_mmi_client_manager;
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
+
MMI_API int mmi_standard_workflow_instance_create(mmi_standard_workflow_type_e type, mmi_workflow_instance_h *instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-MMI_API int mmi_custom_workflow_instance_create(mmi_workflow_h workflow, mmi_workflow_instance_h *instance)
-{
+MMI_API int mmi_custom_workflow_instance_create(mmi_workflow_h workflow, mmi_workflow_instance_h *instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_START
MMI_API int mmi_workflow_instance_destroy(mmi_workflow_instance_h instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_STOP
MMI_API int mmi_workflow_instance_activate(mmi_workflow_instance_h instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_START
MMI_API int mmi_workflow_instance_deactivate(mmi_workflow_instance_h instance) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_STOP
MMI_API int mmi_workflow_instance_set_attribute(mmi_workflow_instance_h instance, mmi_attribute_h attribute) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_instance_emit_signal(mmi_workflow_instance_h instance, mmi_signal_h signal) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_instance_feed_data(mmi_workflow_instance_h instance, const char *node_name, const char *port_name, mmi_data_h data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance || nullptr == node_name || nullptr == port_name) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_START
MMI_API int mmi_workflow_instance_set_output_cb(mmi_workflow_instance_h instance, const char *name, mmi_workflow_output_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
return MMI_ERROR_NONE;
}
-// LCOV_EXCL_STOP
MMI_API int mmi_workflow_instance_unset_output_cb(mmi_workflow_instance_h instance, mmi_workflow_output_cb callback) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == instance) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
#include <fstream>
#include <sstream>
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
+
+
MMI_API int mmi_workflow_create_from_script(const char *script, mmi_workflow_h *workflow) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (script == nullptr || workflow == nullptr) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
MMI_API int mmi_workflow_create_from_script_file(const char *script_path, mmi_workflow_h *workflow) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (script_path == nullptr || workflow == nullptr) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_generate_script(mmi_workflow_h workflow, const char **script) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (workflow == nullptr || script == nullptr) {
LOGE("[ERROR] Invalid parameter");
return MMI_ERROR_INVALID_PARAMETER;
#include "mmi-common.h"
#include "mmi-workflow-internal.h"
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
+
MMI_API int mmi_workflow_create(mmi_workflow_h *workflow) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_set_type(mmi_workflow_h workflow, mmi_standard_workflow_type_e type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_get_type(mmi_workflow_h workflow, mmi_standard_workflow_type_e *type) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == type) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_node_add(mmi_workflow_h workflow, const char *node_name, mmi_node_h node) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == node_name || nullptr == node) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
MMI_API int mmi_workflow_link_nodes_by_names(mmi_workflow_h workflow,
const char *from_node_name, const char *from_port_name, const char *to_node_name, const char *to_port_name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_attribute_assign(mmi_workflow_h workflow, const char *attribute_name, const char *target_node_name, const char *target_attribute_name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == attribute_name || nullptr == target_node_name || nullptr == target_attribute_name) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_attribute_set_default_value(mmi_workflow_h workflow, mmi_attribute_h default_value) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == default_value) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_signal_assign(mmi_workflow_h workflow, const char *signal_name, const char *target_node_name, const char *target_signal_name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == signal_name || nullptr == target_node_name || nullptr == target_signal_name) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_output_assign(mmi_workflow_h workflow, const char *workflow_output, const char *out_node_name, const char *node_out_port_name) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == workflow_output || nullptr == out_node_name || nullptr == node_out_port_name) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_output_assign_by_port(mmi_workflow_h workflow, const char *workflow_output, mmi_port_h port) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == workflow_output || nullptr == port) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_standard_workflow_register(mmi_workflow_h workflow) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_clone(mmi_workflow_h workflow, mmi_workflow_h *cloned) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow || nullptr == cloned) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
}
MMI_API int mmi_workflow_destroy(mmi_workflow_h workflow) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (nullptr == workflow) {
LOGE("[ERROR] parameter is null");
return MMI_ERROR_INVALID_PARAMETER;
};
static bool g_initialized = false;
+static int g_feature_enabled = -1;
+
+static int mmi_get_feature_enabled() {
+ if (0 == g_feature_enabled) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ } else if (-1 == g_feature_enabled) {
+ bool supported = false;
+ if (0 == system_info_get_platform_bool(MMI_FEATURE_PATH, &supported)) {
+ if (false == supported) {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] MMI feature NOT supported");
+ g_feature_enabled = 0;
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+
+ g_feature_enabled = 1;
+ } else {
+ //LCOV_EXCL_START
+ LOGE("[ERROR] Fail to get feature value");
+ return MMI_ERROR_NOT_SUPPORTED;
+ //LCOV_EXCL_STOP
+ }
+ }
+ return 0;
+}
MMI_API int mmi_initialize() {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (g_initialized) {
return MMI_ERROR_OPERATION_FAILED;
}
}
MMI_API int mmi_deinitialize() {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (!g_initialized) {
return MMI_ERROR_OPERATION_FAILED;
}
}
MMI_API int mmi_set_state_changed_cb(mmi_state_changed_cb callback, void *user_data) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (callback == nullptr) {
return MMI_ERROR_INVALID_PARAMETER;
}
}
MMI_API int mmi_unset_state_changed_cb(mmi_state_changed_cb callback) {
+ if (0 != mmi_get_feature_enabled()) {
+ return MMI_ERROR_NOT_SUPPORTED; //LCOV_EXCL_LINE
+ }
+
if (callback == nullptr) {
return MMI_ERROR_INVALID_PARAMETER;
}