extern int safeStrLen(const char *str);
extern bool get_substring_int(const char **ipStr, int *ipValue, char delim);
extern bool is_ip_string(const char *ipstr);
-extern int setting_invoke_reset_function(char *lib_name, service_h service, void *ext);
+extern int setting_invoke_reset_function(char *ug_name, service_h service, void *ext);
extern int excuteCmd(char* exec_path, int option_num, ...);
extern void create_fontlink(const char *linkpath, const char *linkname,
const char *fontfilepath, const char *fontfilename);
return TRUE;
}
-int setting_invoke_reset_function(char *lib_name, service_h service, void *ext)
+int setting_invoke_reset_function(char *ug_name, service_h service, void *ext)
{
- SETTING_TRACE("Enter %s with lib_name:%s", __FUNCTION__, lib_name);
+ SETTING_TRACE("Enter %s with ug_name:%s", __FUNCTION__, ug_name);
int (*reset) (service_h pair, void *ptr);
int ret = OPERATE_LIB_SUCESS;
- void *handle = dlopen(lib_name, RTLD_LAZY);
+ //1.first do exist-checking in /opt/ug/lib
+ char ug_file[PATH_MAX + 1];
+ snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH, ug_name);
+ struct stat st;
+ if(stat(ug_file, &st) != 0) {
+
+ //2.if it does not exit in /opt/ug/lib, then do exist-checking in /usr/ug/lib
+ memset(ug_file, 0x00, PATH_MAX + 1);
+ snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH_USR, ug_name);
+ if(stat(ug_file, &st) != 0) {
+ //both not exist,skip it
+ SETTING_TRACE_ERROR(" libug-%s.so is *NOT* present, so skip it..\n", ug_name);
+ return OPERATE_LIB_SUCESS;
+ }
+ }
+ //-------------------------------------------------------------------------------------
+ void *handle = dlopen(ug_file, RTLD_LAZY);
if (!handle) {
SETTING_TRACE_ERROR(" >>>>>>>>>>> %s", dlerror());
return LOAD_LIB_FAILED;
SETTING_TRACE_BEGIN;
int ret = 0;
ret += vconf_set_str(VCONFKEY_IDLE_LOCK_BGSET, IMG_DEFAULT_HOME_SCREEN);
- ret += setting_invoke_reset_function("/opt/ug/lib/libug-setting-lock.so", 0, NULL);
+ ret += setting_invoke_reset_function("setting-lock", 0, NULL);
return ret;
}
ret += setting_reset_display_lc_screen();*/
#if SUPPORT_RUN_SYSTEM_COMMAND
ret += excuteCmd(SETTING_POSTINST_FILE, 1, "wallpaper");
- ret += setting_invoke_reset_function("/opt/ug/lib/libug-setting-lock.so", service, NULL);
+ ret += setting_invoke_reset_function("setting-lock", service, NULL);
#else
ret += setting_reset_home_wallpaper();
ret += setting_reset_display_lc_screen();
path = get_ug_path_from_ug_args((void *)ug_args);
svc = get_bundle_from_ug_args((void *)ug_args);
- if (snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH, path) < 0)
- return FALSE;
+ //if (snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH, path) < 0)
+ // return FALSE;
- ret = setting_invoke_reset_function(ug_file, svc, NULL);
+ ret = setting_invoke_reset_function(path, svc, NULL);
//SETTING_TRACE("load %s[plugin_ret:%d]", ug_file, ret);
if (OPERATE_LIB_SUCESS > ret)
{
char *path = get_ug_path_from_ug_args((void *)ug_args);
service_h svc = get_bundle_from_ug_args((void *)ug_args);
- char ug_file[PATH_MAX];
- if (snprintf(ug_file, PATH_MAX,
- "%s/libug-%s.so", SETTING_UG_PATH, path) < 0) return;
- int plugin_ret = setting_invoke_reset_function(ug_file, svc, NULL);
- SETTING_TRACE("load %s[plugin_ret:%d]", ug_file, plugin_ret);
+ int plugin_ret = setting_invoke_reset_function(path, svc, NULL);
+ SETTING_TRACE("load libug-%s.so[plugin_ret:%d]", path, plugin_ret);
if (LOAD_LIB_FAILED == plugin_ret) // -1
{