Merge "[Bug] Fix N_SE-13906, N_SE-13353, N_SE-13514, N_SE-14415, N_SE-13999, N_SE...
[apps/core/preloaded/settings.git] / setting-common / src / setting-common-general-func.c
index e76c7ca..4dbc53b 100755 (executable)
@@ -45,23 +45,6 @@ char *setting_file_basename(char *path)
        return (char *)g_strdup(p + 1);
 }
 
        return (char *)g_strdup(p + 1);
 }
 
-char *get_pa_usb_connect_mode_str()
-{
-       int ret = SETTING_RETURN_FAIL;
-       int value;
-
-       ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &value);
-       setting_retvm_if(SETTING_RETURN_FAIL == ret, NULL, "Failed to get vconf value");        /* file system exceptional handle */
-
-       switch (value)
-       {
-       case SETTING_USB_DEBUG_MODE:
-               return (char*)g_strdup(_("IDS_ST_BODY_USB_DEBUGGING"));
-       default:
-               return (char*)g_strdup(_("IDS_COM_POP_DISCONNECTED"));
-       }
-}
-
 char *get_brightness_mode_str()
 {
        int value, err;
 char *get_brightness_mode_str()
 {
        int value, err;
@@ -481,10 +464,17 @@ char *remove_first_substring(const char *parent, const char *pat)
        return str;
 }
 
        return str;
 }
 
-
-//NULL, "", "  ", "     " etc.. are all empty strings
+//return True just when NULL or '\0'
 bool isEmptyStr(const char *str)
 {
 bool isEmptyStr(const char *str)
 {
+       if (NULL == str || '\0' == str[0])
+               return TRUE;
+       return FALSE;
+}
+
+//return True just when str is NULL, '\0' or all strings made up of spaces
+bool isSpaceStr(const char *str)
+{
        //if (NULL == str)
        //      return TRUE;
        while (str)
        //if (NULL == str)
        //      return TRUE;
        while (str)
@@ -1426,3 +1416,25 @@ int setting_set_i18n(char* pkgname, char* localedir)
 #endif
 }
 
 #endif
 }
 
+
+void app_launcher(char* pkg_name)
+{
+       service_h service;
+       service_create(&service);
+       service_set_operation(service, SERVICE_OPERATION_DEFAULT);
+       service_set_package(service, pkg_name);
+       int launch_ret = service_send_launch_request(service, NULL, NULL);
+       SETTING_TRACE("after app_service_create - %s : %d ", pkg_name, launch_ret);
+       if (launch_ret == SERVICE_ERROR_NONE)
+       {
+               // on success
+               SETTING_TRACE("on success");
+
+       } else {
+               // on error
+               SETTING_TRACE("on error");
+       }
+       service_destroy(service);
+       service = NULL;
+}
+