Eina_List *_provider_list = NULL;
int
-mmi_provider_register_caps(mmi_provider_handle provider, int caps)
+mmi_provider_set_op_mode_on_caps(unsigned long long caps, mmi_provider_op_mode mode)
{
- (void) provider;
- (void) caps;
+ Eina_List *l = NULL;
+ mmi_provider_handle *provider = NULL;
+
+ if (!caps)
+ {
+ LOGE("Given caps in empty !\n");
+ return -1;
+ }
+
+ EINA_LIST_FOREACH(_provider_list, l, provider)
+ {
+ if (provider->capabilities & caps)
+ {
+ LOGD("Set op_mode(%d) on provider(%s) !\n", mode, provider->module_info->name);
+ provider->module_data->set_mode(mode);
+ }
+ }
+
+ return 0;
+}
+
+int
+mmi_provider_register_caps(mmi_provider_handle *provider, unsigned long long caps)
+{
+ if (!provider)
+ {
+ LOGE("Given provider is invalid !\n");
+ return -1;
+ }
+
+ if (!caps)
+ {
+ LOGE("Given caps is invalid ! (caps=%lld)\n", caps);
+ return -1;
+ }
+ /* Right now, we add the given caps to the existing caps. */
+ provider->capabilities |= caps;
return 0;
}
#ifndef __MMI_PROVIDER_H__
#define __MMI_PROVIDER_H__
+#include "mmi-common.h"
+
+int mmi_provider_set_op_mode_on_caps(unsigned long long caps, mmi_provider_op_mode mode);
+
void modality_providers_init(void);
void modality_providers_shutdown(void);