From ee15e2b63e3d9a84b179181b5c46215c59202c51 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Fri, 10 Jul 2015 13:36:50 +0900 Subject: [PATCH] Sync with the latest tizen 2.4 Change-Id: Ia0aa6d9d67fe7943be729cb24610ff5cda758234 --- CMakeLists.txt | 28 ++------------- packaging/org.tizen.data-provider-slave.spec | 4 +-- src/fault.c | 3 +- src/main.c | 12 +++---- src/so_handler.c | 2 +- src/widget.c | 51 +++++++++++++++++++++++----- svc_src/main.c | 9 +++-- 7 files changed, 60 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ecb6ff6..03a53b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,9 @@ PROJECT(data-provider-slave C) INCLUDE(FindPkgConfig) pkg_check_modules(pkg REQUIRED - dlog capi-appfw-application capi-appfw-app-manager + dlog aul vconf sqlite3 @@ -26,7 +26,6 @@ pkg_check_modules(pkg REQUIRED json-glib-1.0 ) -IF (SERVICE_APP_ENABLED) pkg_check_modules(svc_pkg REQUIRED capi-appfw-service-application capi-appfw-app-manager @@ -50,29 +49,23 @@ pkg_check_modules(svc_pkg REQUIRED shortcut json-glib-1.0 ) -ENDIF (SERVICE_APP_ENABLED) IF (X11_SUPPORT) pkg_check_modules(pkg_extra REQUIRED ecore-x ) - -IF (SERVICE_APP_ENABLED) pkg_check_modules(svc_pkg_extra REQUIRED ecore-x ) -ENDIF (SERVICE_APP_ENABLED) ENDIF (X11_SUPPORT) IF (WAYLAND_SUPPORT) pkg_check_modules(pkg_extra REQUIRED ecore-wayland ) -IF (SERVICE_APP_ENABLED) pkg_check_modules(svc_pkg_extra REQUIRED ecore-wayland ) -ENDIF (SERVICE_APP_ENABLED) ENDIF (WAYLAND_SUPPORT) SET(PACKAGE "${PROJECT_NAME}") @@ -108,10 +101,8 @@ ADD_DEFINITIONS(${pkg_CFLAGS}) ADD_DEFINITIONS(${pkg_LDFLAGS}) ADD_DEFINITIONS(${pkg_extra_CFLAGS}) ADD_DEFINITIONS(${pkg_extra_LDFLAGS}) -IF (SERVICE_APP_ENABLED) ADD_DEFINITIONS(${svc_pkg_extra_CFLAGS}) ADD_DEFINITIONS(${svc_pkg_CFLAGS}) -ENDIF (SERVICE_APP_ENABLED) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Winline -Werror -g -fno-builtin-malloc -fpie") @@ -129,7 +120,6 @@ SET(BUILD_SOURCE src/theme_loader.c ) -IF (SERVICE_APP_ENABLED) SET(SVC_BUILD_SOURCE svc_src/main.c # Service App Main code src/so_handler.c @@ -142,7 +132,6 @@ SET(SVC_BUILD_SOURCE src/connection.c src/theme_loader.c ) -ENDIF (SERVICE_APP_ENABLED) IF (WAYLAND_SUPPORT) ADD_DEFINITIONS("-DHAVE_WAYLAND") @@ -150,12 +139,10 @@ IF (WAYLAND_SUPPORT) ${BUILD_SOURCE} src/util_wayland.c ) -IF (SERVICE_APP_ENABLED) SET(SVC_BUILD_SOURCE ${SVC_BUILD_SOURCE} src/util_wayland.c ) -ENDIF (SERVICE_APP_ENABLED) ENDIF (WAYLAND_SUPPORT) IF (X11_SUPPORT) @@ -164,44 +151,35 @@ IF (X11_SUPPORT) ${BUILD_SOURCE} src/util_x11.c ) -IF (SERVICE_APP_ENABLED) SET(SVC_BUILD_SOURCE ${SVC_BUILD_SOURCE} src/util_x11.c ) -ENDIF (SERVICE_APP_ENABLED) ENDIF (X11_SUPPORT) -STRING(REPLACE "-L-l" "-l" pkg_fixed_LDFLAGS ${pkg_LDFLAGS}) -STRING(REPLACE "-l" " -l" pkg_LDFLAGS ${pkg_fixed_LDFLAGS}) - ADD_EXECUTABLE("${PROJECT_NAME}" ${BUILD_SOURCE} ) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} "-ldl -pie ${pkg_LDFLAGS}" ${pkg_extra_LDFLAGS}) +TARGET_LINK_LIBRARIES(${PROJECT_NAME} "-ldl -pie" ${pkg_extra_LDFLAGS} ${pkg_LDFLAGS}) -IF (SERVICE_APP_ENABLED) ADD_EXECUTABLE(${SVC_PROVIDER} ${SVC_BUILD_SOURCE} ) TARGET_LINK_LIBRARIES(${SVC_PROVIDER} "-ldl -pie" ${svc_pkg_extra_LDFLAGS} ${svc_pkg_LDFLAGS}) -ENDIF (SERVICE_APP_ENABLED) ADD_EXECUTABLE(${ICON_PROVIDER} icon_src/main.c icon_src/script_handler.c src/util.c ) -TARGET_LINK_LIBRARIES(${ICON_PROVIDER} "-ldl -pie ${pkg_LDFLAGS}" ${pkg_extra_LDFLAGS}) +TARGET_LINK_LIBRARIES(${ICON_PROVIDER} "-ldl -pie" ${pkg_extra_LDFLAGS} ${pkg_LDFLAGS}) #INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.data-provider-slave.desktop DESTINATION /usr/share/applications) INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.data-provider-slave.xml DESTINATION /usr/share/packages) INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "org.tizen.${PROJECT_NAME}") INSTALL(TARGETS ${ICON_PROVIDER} DESTINATION /usr/apps/org.tizen.${PROJECT_NAME}/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) INSTALL(TARGETS ${EXE_LOADER} DESTINATION /usr/apps/org.tizen.${PROJECT_NAME}/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -IF (SERVICE_APP_ENABLED) INSTALL(TARGETS ${SVC_PROVIDER} DESTINATION /usr/apps/org.tizen.${PROJECT_NAME}/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -ENDIF (SERVICE_APP_ENABLED) # INCLUDE FOR BUILD & INSTALL .PO FILES ADD_SUBDIRECTORY(res) diff --git a/packaging/org.tizen.data-provider-slave.spec b/packaging/org.tizen.data-provider-slave.spec index 8122922..5d8a7d4 100644 --- a/packaging/org.tizen.data-provider-slave.spec +++ b/packaging/org.tizen.data-provider-slave.spec @@ -6,7 +6,7 @@ Summary: Plugin type widget service provider Version: 1.0.0 Release: 1 Group: Applications/Core Applications -License: Flora License, Version 1.1 +License: Flora-1.1 Source0: %{name}-%{version}.tar.gz Source1001: %{name}.manifest BuildRequires: cmake, gettext-tools, coreutils, edje-bin @@ -22,7 +22,7 @@ BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(widget_provider) BuildRequires: pkgconfig(widget_service) BuildRequires: pkgconfig(capi-appfw-application) -#BuildRequires: pkgconfig(capi-appfw-service-application) +BuildRequires: pkgconfig(capi-appfw-service-application) BuildRequires: pkgconfig(capi-appfw-app-manager) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(edje) diff --git a/src/fault.c b/src/fault.c index bb60b25..0f8e51f 100644 --- a/src/fault.c +++ b/src/fault.c @@ -32,7 +32,6 @@ #include #include -#include #include #include @@ -75,6 +74,7 @@ static void signal_handler(int signum, siginfo_t *info, void *unused) if (!s_info.marked) { DbgPrint("Ignore false alarm signal [false]\n"); free(so_fname); + free(symbol); return; } @@ -84,6 +84,7 @@ static void signal_handler(int signum, siginfo_t *info, void *unused) if (tv - s_info.alarm_tv < DEFAULT_LIFE_TIMER) { DbgPrint("Ignore false alarm signal [%lf]\n", tv - s_info.alarm_tv); free(so_fname); + free(symbol); return; } diff --git a/src/main.c b/src/main.c index cbac738..116cc82 100644 --- a/src/main.c +++ b/src/main.c @@ -39,13 +39,11 @@ #include #include -#include #include -#include #include #include #include -#include /* Conflict with local widget.h */ +#include #include #include @@ -363,7 +361,7 @@ static bool app_create(void *argv) DbgPrint("System time changed event callback added: %d\n", ret); } - ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb, NULL); + ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_DEVICE_CHANGED, mmc_changed_cb, NULL); if (ret < 0) { DbgPrint("MMC status changed event callback added: %d\n", ret); } @@ -421,7 +419,7 @@ static void app_terminate(void *data) DbgPrint("Remove time changed callback: %d\n", ret); } - ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb); + ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_DEVICE_CHANGED, mmc_changed_cb); if (ret < 0) { DbgPrint("Remove MMC status changed callback: %d\n", ret); } @@ -531,8 +529,8 @@ static void app_control(app_control_h service, void *data) ret = client_init(name, abi, hw_acceleration, widget_is_secured()); if (hw_acceleration && !strcasecmp(hw_acceleration, "use-gl")) { - DbgPrint("Turn on: opengl_x11\n"); - elm_config_accel_preference_set("opengl"); + DbgPrint("Turn on: 3d acceleration\n"); + elm_config_accel_preference_set("3d"); } free(name); diff --git a/src/so_handler.c b/src/so_handler.c index 55709cb..c7a91e8 100644 --- a/src/so_handler.c +++ b/src/so_handler.c @@ -22,10 +22,10 @@ #include #include -#include #include #include #include +#include #include #include diff --git a/src/widget.c b/src/widget.c index 9d2a7d3..322b829 100644 --- a/src/widget.c +++ b/src/widget.c @@ -23,15 +23,16 @@ #include #include -#include #include #include #include #include +#include #include #include #include #include +#include #include "critical_log.h" #include "debug.h" @@ -73,6 +74,7 @@ enum state { struct item { Ecore_Timer *timer; + int timer_is_freezed; struct instance *inst; int monitor_cnt; Ecore_Timer *monitor; @@ -811,7 +813,12 @@ static inline int timer_thaw(struct item *item) return 0; } + if (!item->timer_is_freezed) { + return 0; + } + ecore_timer_thaw(item->timer); + item->timer_is_freezed = 0; period = ecore_timer_interval_get(item->timer); pending = ecore_timer_pending_get(item->timer); delay = util_time_delay_for_compensation(period) - pending; @@ -849,7 +856,16 @@ static void timer_freeze(struct item *item) return; } + if (item->timer_is_freezed) { + return; + } + + if (WIDGET_CONF_UPDATE_ON_PAUSE) { + return; + } + ecore_timer_freeze(item->timer); + item->timer_is_freezed = 1; if (ecore_timer_interval_get(item->timer) <= 1.0f) { return; @@ -1090,7 +1106,7 @@ static Eina_Bool updator_cb(void *data) return ECORE_CALLBACK_RENEW; } - if (item->state != STATE_RESUMED) { + if (item->state != STATE_RESUMED && !WIDGET_CONF_UPDATE_ON_PAUSE) { item->updated_in_pause++; DbgPrint("%s is paused[%d]. make delay for updating\n", item->inst->item->pkgname, item->updated_in_pause); return ECORE_CALLBACK_RENEW; @@ -1215,15 +1231,22 @@ static inline int add_desc_update_monitor(const char *id, struct item *item) char *filename; int len; int ret; + const char *path; - len = strlen(util_uri_to_path(id)) + strlen(".desc") + 1; + path = util_uri_to_path(id); + if (!path) { + ErrPrint("id: [%s]\n", id); + return WIDGET_ERROR_INVALID_PARAMETER; + } + + len = strlen(path) + strlen(".desc") + 1; filename = malloc(len); if (!filename) { - ErrPrint("malloc: %d (%s.desc)\n", errno, util_uri_to_path(id)); + ErrPrint("malloc: %d (%s.desc)\n", errno, path); return WIDGET_ERROR_OUT_OF_MEMORY; } - snprintf(filename, len, "%s.desc", util_uri_to_path(id)); + snprintf(filename, len, "%s.desc", path); ret = update_monitor_add_update_cb(filename, desc_updated_cb, item); free(filename); return ret; @@ -1231,7 +1254,15 @@ static inline int add_desc_update_monitor(const char *id, struct item *item) static inline int add_file_update_monitor(const char *id, struct item *item) { - return update_monitor_add_update_cb(util_uri_to_path(id), file_updated_cb, item); + const char *path; + + path = util_uri_to_path(id); + if (!path) { + ErrPrint("id: [%s]\n", id); + return WIDGET_ERROR_INVALID_PARAMETER; + } + + return update_monitor_add_update_cb(path, file_updated_cb, item); } static inline int update_monitor_add(const char *id, struct item *item) @@ -2033,10 +2064,14 @@ HAPI int widget_script_event(const char *pkgname, const char *id, const char *si if (!strcmp(signal_name, "gbar,show")) { item->is_gbar_show = 1; - source = util_uri_to_path(source); + if (source) { /* source can be touched at LINE 2030 */ + source = util_uri_to_path(source); + } } else if (!strcmp(signal_name, "gbar,hide")) { item->is_gbar_show = 0; - source = util_uri_to_path(source); + if (source) { /* source can be touched at LINE 2030 */ + source = util_uri_to_path(source); + } } } diff --git a/svc_src/main.c b/svc_src/main.c index 87d5fb5..3dfc637 100644 --- a/svc_src/main.c +++ b/svc_src/main.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -362,7 +361,7 @@ static bool app_create(void *argv) DbgPrint("System time changed event callback added: %d\n", ret); } - ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb, NULL); + ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_DEVICE_CHANGED, mmc_changed_cb, NULL); if (ret < 0) { DbgPrint("MMC status changed event callback added: %d\n", ret); } @@ -419,7 +418,7 @@ static void app_terminate(void *data) DbgPrint("Remove time changed callback: %d\n", ret); } - ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb); + ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_DEVICE_CHANGED, mmc_changed_cb); if (ret < 0) { DbgPrint("Remove MMC status changed callback: %d\n", ret); } @@ -517,8 +516,8 @@ static void app_control(app_control_h service, void *data) ret = client_init(name, abi, hw_acceleration, widget_is_secured()); if (hw_acceleration && !strcasecmp(hw_acceleration, "use-gl")) { - DbgPrint("Turn on: opengl_x11\n"); - elm_config_preferred_engine_set("opengl_x11"); + DbgPrint("Turn on: 3d acceleration\n"); + elm_config_accel_preference_set("3d"); } free(name); -- 2.7.4