From 77c781d83c0ced94834ec01f13b33e21d97c04f2 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sun, 1 Feb 2015 13:33:28 +0900 Subject: [PATCH] tizen 2.3 release --- CMakeLists.txt | 21 ++- include/appcore-common.h | 4 +- include/appcore-efl.h | 10 +- include/appcore-internal.h | 4 +- packaging/app-core.spec | 48 +++--- src/appcore-X.c | 3 +- src/appcore-efl.c | 359 +++++++++++++++++++++++++++++++++++++++------ src/appcore-i18n.c | 21 +-- src/appcore-rotation.c | 75 +++++----- src/appcore.c | 68 +++++++-- 10 files changed, 471 insertions(+), 142 deletions(-) mode change 100644 => 100755 CMakeLists.txt mode change 100644 => 100755 packaging/app-core.spec diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index bad7798..fb908e8 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,6 @@ SET(VERSION "${VERSION_MAJOR}.1") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") -IF(DEVICE_PROFILE STREQUAL "wearable") - ADD_DEFINITIONS("-DWEARABLE_PROFILE") -ELSEIF(DEVICE_PROFILE STREQUAL "mobile") - ADD_DEFINITIONS("-DMOBILE_PROFILE") -ENDIF() SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall") @@ -36,11 +31,19 @@ SET(HEADERS_common appcore-common.h) INCLUDE(FindPkgConfig) #pkg_check_modules(pkg_common REQUIRED pmapi vconf sensor aul rua dlog x11) -pkg_check_modules(pkg_common REQUIRED vconf sensor aul dlog x11 ecore-x) +pkg_check_modules(pkg_common REQUIRED vconf sensor aul dlog x11 ecore-x ) FOREACH(flag ${pkg_common_CFLAGS}) SET(EXTRA_CFLAGS_common "${EXTRA_CFLAGS_common} ${flag}") ENDFOREACH(flag) +IF(_APPFW_FEATURE_PROCESS_POOL) + ADD_DEFINITIONS("-D_APPFW_FEATURE_PROCESS_POOL") +ENDIF(_APPFW_FEATURE_PROCESS_POOL) + +IF(_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS) + ADD_DEFINITIONS("-D_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS") +ENDIF(_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS) + ADD_LIBRARY(${APPCORE_COMMON} SHARED ${SRCS_common}) SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES VERSION ${VERSION}) @@ -65,11 +68,7 @@ SET(SRCS_efl src/appcore-efl.c src/virtual_canvas.c) SET(HEADERS_efl appcore-efl.h) INCLUDE(FindPkgConfig) -IF(DEVICE_PROFILE STREQUAL "wearable") -pkg_check_modules(pkg_efl REQUIRED elementary dlog ecore ecore-x gobject-2.0 glib-2.0 x11 xcomposite ecore-evas ecore-input aul system-resource) -ELSE() -pkg_check_modules(pkg_efl REQUIRED elementary dlog ecore ecore-x gobject-2.0 glib-2.0 x11 xcomposite ecore-evas ecore-input aul) -ENDIF() +pkg_check_modules(pkg_efl REQUIRED elementary dlog ecore ecore-x gobject-2.0 glib-2.0 x11 xcomposite ecore-evas ecore-input aul evas vconf) FOREACH(flag ${pkg_efl_CFLAGS}) SET(EXTRA_CFLAGS_efl "${EXTRA_CFLAGS_efl} ${flag}") ENDFOREACH(flag) diff --git a/include/appcore-common.h b/include/appcore-common.h index 8559511..f0b5b44 100755 --- a/include/appcore-common.h +++ b/include/appcore-common.h @@ -203,7 +203,7 @@ int add_callbacks(struct appdata *data) * */ int appcore_set_event_callback(enum appcore_event event, - int (*cb)(void *), void *data); + int (*cb)(void *, void *), void *data); /** * @par Description: @@ -257,7 +257,7 @@ static int _rot_cb(enum appcore_rm, void *); * @endcode * */ -int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *), +int appcore_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), void *data); /** diff --git a/include/appcore-efl.h b/include/appcore-efl.h index 794734a..9ffd34b 100755 --- a/include/appcore-efl.h +++ b/include/appcore-efl.h @@ -61,7 +61,7 @@ extern "C" { * To develop an application using EFL on this platform. * * @par Method of function operation: - * Initialize the EFL, internationalization, and notifications + * Initialize the EFL, internationalization, and notifications * for receiving system events such as rotation, low battery, etc.\n * And, start an ecore mainloop. * @@ -158,6 +158,14 @@ int _create(void *data) */ int appcore_set_system_resource_reclaiming(bool enable); +int appcore_efl_goto_pause(); + +int appcore_set_prelaunching(bool value); + +#ifdef _APPFW_FEATURE_PROCESS_POOL +int appcore_set_preinit_window_name(const char* win_name); +#endif + #ifdef __cplusplus } #endif diff --git a/include/appcore-internal.h b/include/appcore-internal.h index d22ddee..cca466b 100755 --- a/include/appcore-internal.h +++ b/include/appcore-internal.h @@ -134,7 +134,7 @@ enum sys_event { * Appcore system event operation */ struct sys_op { - int (*func) (void *); + int (*func) (void *, void *); void *data; }; @@ -172,7 +172,7 @@ int appcore_pause_rotation_cb(void); int appcore_resume_rotation_cb(void); struct ui_wm_rotate { - int (*set_rotation_cb) (int (*cb) (enum appcore_rm, void *), void *data); + int (*set_rotation_cb) (int (*cb) (void *event_info, enum appcore_rm, void *), void *data); int (*unset_rotation_cb) (void); int (*get_rotation_state) (enum appcore_rm *curr); int (*pause_rotation_cb) (void); diff --git a/packaging/app-core.spec b/packaging/app-core.spec old mode 100644 new mode 100755 index e7f79a1..118368c --- a/packaging/app-core.spec +++ b/packaging/app-core.spec @@ -1,9 +1,7 @@ - Name: app-core Summary: Application basic -Version: 1.3.11 +Version: 1.3.40 Release: 1 -VCS: framework/appfw/app-core#app-core_1.2-47-52-ge28693cc5d9eabf1943bc165ba686d9336334e6c Group: TO_BE/FILLED_IN License: Apache License, Version 2.0 Source0: app-core-%{version}.tar.gz @@ -19,16 +17,17 @@ BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(ecore-x) +BuildRequires: pkgconfig(ecore-evas) +BuildRequires: pkgconfig(evas) BuildRequires: pkgconfig(edje) BuildRequires: pkgconfig(eet) BuildRequires: pkgconfig(eina) BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(glib-2.0) -%if %{_repository} == "wearable" +BuildRequires: cmake +%if "%{?tizen_profile_name}" == "wearable" BuildRequires: pkgconfig(system-resource) %endif -BuildRequires: cmake - %description SLP common application basic @@ -70,6 +69,7 @@ Requires: pkgconfig(sensor) Requires: pkgconfig(vconf) Requires: pkgconfig(elementary) Requires: pkgconfig(aul) +Requires: pkgconfig(x11) %description common-devel Application basics common (devel) @@ -82,19 +82,29 @@ Group: Development/Libraries Application basics template +%define appfw_feature_visibility_check_by_lcd_status 1 %prep -%setup -q +%setup -q %build -%if 0%{?sec_build_binary_debug_enable} -export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE" -export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE" -export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE" +export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" +export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" +export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" +%if 0%{?appfw_feature_visibility_check_by_lcd_status} +export CFLAGS="$CFLAGS -D_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS" +#_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS=ON %endif -%if %{_repository} == "wearable" -cmake -DDEVICE_PROFILE=wearable -DCMAKE_INSTALL_PREFIX=%{_prefix} -DENABLE_GTK=OFF . -%else -cmake -DDEVICE_PROFILE=mobile -DCMAKE_INSTALL_PREFIX=%{_prefix} -DENABLE_GTK=OFF . + +#export CFLAGS="$CFLAGS -Wall -Werror -Wno-unused-function" +cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DENABLE_GTK=OFF \ + -D_APPFW_FEATURE_PROCESS_POOL:BOOL=ON \ + -D_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS:BOOL=${_APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS} \ + . + +%if "%{?tizen_profile_name}" == "wearable" +export CFLAGS="$CFLAGS -DWEARABLE" +%elseif "%{?tizen_profile_name}" == "mobile" +export CFLAGS="$CFLAGS -DMOBILE" %endif make %{?jobs:-j%jobs} @@ -112,10 +122,10 @@ cp LICENSE %{buildroot}/usr/share/license/%{name}-common %post efl /sbin/ldconfig -mkdir -p /opt/share/app_capture -chmod 777 /opt/share/app_capture -chsmack -a "system::homedir" /opt/share/app_capture -chsmack -t /opt/share/app_capture +mkdir -p /opt/usr/share/app_capture +chmod 777 /opt/usr/share/app_capture +chsmack -a "system::homedir" /opt/usr/share/app_capture +chsmack -t /opt/usr/share/app_capture %postun efl -p /sbin/ldconfig diff --git a/src/appcore-X.c b/src/appcore-X.c index 8595860..34b987f 100755 --- a/src/appcore-X.c +++ b/src/appcore-X.c @@ -129,7 +129,7 @@ static int __raise_win(Display *d, Window win) return 0; } -int x_raise_win(pid_t pid) +EXPORT_API int x_raise_win(pid_t pid) { int r; @@ -152,7 +152,6 @@ int x_raise_win(pid_t pid) _retv_if(d == NULL, -1); win = XDefaultRootWindow(d); - if (!a_pid) a_pid = XInternAtom(d, "_NET_WM_PID", True); diff --git a/src/appcore-efl.c b/src/appcore-efl.c index 06d4903..13276d3 100755 --- a/src/appcore-efl.c +++ b/src/appcore-efl.c @@ -34,10 +34,14 @@ #include #include #include +#ifdef WEARABLE +#include +#endif #include #include #include +#include #include #include #include @@ -45,17 +49,18 @@ #include #include #include -#ifdef WEARABLE_PROFILE -#include -#endif #include "appcore-internal.h" #include "appcore-efl.h" #include "virtual_canvas.h" +#ifdef _APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS +#include +#endif #define SYSMAN_MAXSTR 100 #define SYSMAN_MAXARG 16 #define SYSNOTI_SOCKET_PATH "/tmp/sn" #define RETRY_READ_COUNT 10 +#define MAX_PACKAGE_STR_SIZE 512 #define PREDEF_BACKGRD "backgrd" #define PREDEF_FOREGRD "foregrd" @@ -77,7 +82,8 @@ struct sysnoti { static pid_t _pid; static bool resource_reclaiming = TRUE; -static int tmp_val = 0; +static bool prelaunching = FALSE; + struct ui_priv { @@ -97,7 +103,7 @@ struct ui_priv { /* WM_ROTATE */ int wm_rot_supported; int rot_started; - int (*rot_cb) (enum appcore_rm, void *); + int (*rot_cb) (void *event_info, enum appcore_rm, void *); void *rot_cb_data; enum appcore_rm rot_mode; }; @@ -123,7 +129,10 @@ static const char *_as_name[] = { [AS_DYING] = "DYING", }; -static bool b_active = 0; +static int b_active = -1; +static bool first_launch = 1; +static int is_legacy_lifecycle = 0; + struct win_node { unsigned int win; bool bfobscured; @@ -211,6 +220,92 @@ static int sysnoti_send(struct sysnoti *msg) return result; } +void __trm_app_info_send_socket(char *write_buf) +{ + const char trm_socket_for_app_info[] = "/dev/socket/app_info"; + int socket_fd = 0; + int ret = 0; + struct sockaddr_un addr; + + _DBG("__trm_app_info_send_socket"); + + if (access(trm_socket_for_app_info, F_OK) != 0) { + _ERR("access"); + goto trm_end; + } + + socket_fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (socket_fd < 0) { + _ERR("socket"); + goto trm_end; + } + + memset(&addr, 0, sizeof(addr)); + sprintf(addr.sun_path, "%s", trm_socket_for_app_info); + addr.sun_family = AF_LOCAL; + + ret = connect(socket_fd, (struct sockaddr *) &addr ,sizeof(sa_family_t) + strlen(trm_socket_for_app_info) ); + if (ret != 0) { + close(socket_fd); + goto trm_end; + } + + send(socket_fd, write_buf, strlen(write_buf), MSG_DONTWAIT | MSG_NOSIGNAL); + _DBG("send"); + + close(socket_fd); +trm_end: + return; +} + +#ifdef _APPFW_FEATURE_CPU_BOOST +static void __stop_cpu_boost(void) +{ + const char trm_sock_for_cpu_boost[] = "/dev/socket/scenario_info"; + int sock_fd = 0; + int ret = 0; + struct sockaddr_un addr; + const char command[] = "AppLaunchUnlock"; + + _DBG("__stop_cpu_boost enter"); + + if (access(trm_sock_for_cpu_boost, F_OK) != 0) { + _ERR("access() failed, errno: %d (%s)", errno, strerror(errno)); + goto error; + } + + sock_fd = socket(AF_LOCAL, SOCK_STREAM, 0); + if (sock_fd < 0) { + _ERR("socket() failed, errno: %d (%s)", errno, strerror(errno)); + goto error; + } + + memset(&addr, 0, sizeof(addr)); + sprintf(addr.sun_path, "%s", trm_sock_for_cpu_boost); + addr.sun_family = AF_LOCAL; + + ret = connect(sock_fd, (struct sockaddr *) &addr, sizeof(sa_family_t) + strlen(trm_sock_for_cpu_boost)); + if (ret != 0) { + _ERR("connect() failed, errno: %d (%s)", errno, strerror(errno)); + close(sock_fd); + goto error; + } + + ret = send(sock_fd, command, strlen(command), MSG_DONTWAIT | MSG_NOSIGNAL); + if (ret < 0) { + _ERR("send() failed, errno: %d (%s)", errno, strerror(errno)); + close(sock_fd); + goto error; + } + + close(sock_fd); + _DBG("__stop_cpu_boost ok"); + +error: + return; +} +#endif + static int _call_predef_action(const char *type, int num, ...) { struct sysnoti *msg; @@ -268,9 +363,14 @@ static int _inform_backgrd(void) char appid[APPID_MAX]; -bool taskmanage; +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER +bool taskmanage; static void _capture_and_make_file(Ecore_X_Window win, int pid, const char *package); +#endif + +static bool __check_skip(Ecore_X_Window xwin); + static int WIN_COMP(gconstpointer data1, gconstpointer data2) { @@ -334,10 +434,36 @@ static void __appcore_efl_memory_flush_cb(void) elm_cache_all_flush(); } +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER +static Eina_Bool __appcore_mimiapp_capture_cb(void *data) +{ + GSList *iter = NULL; + struct win_node *entry = NULL; + + for (iter = g_winnode_list; iter != NULL; iter = g_slist_next(iter)) { + entry = iter->data; + if(__check_skip(entry->win) == FALSE) + break; + } + if(iter) { + entry = iter->data; + if(taskmanage) { + _capture_and_make_file(entry->win, getpid(), appid); + } + } + + return ECORE_CALLBACK_CANCEL; +} +#endif + static void __do_app(enum app_event event, void *data, bundle * b) { int r = -1; struct ui_priv *ui = data; + char trm_buf[MAX_PACKAGE_STR_SIZE]; +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER + const char *miniapp = NULL; +#endif _ret_if(ui == NULL || event >= AE_MAX); _DBG("[APP %d] Event: %s State: %s", _pid, _ae_name[event], @@ -369,12 +495,43 @@ static void __do_app(enum app_event event, void *data, bundle * b) case AE_RESET: _DBG("[APP %d] RESET", _pid); LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:start]", - ui->name); + ui->name); if (ui->ops->reset) r = ui->ops->reset(b, ui->ops->data); + LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]", ui->name); + + if(first_launch) { + first_launch = 0; + is_legacy_lifecycle = aul_get_support_legacy_lifecycle(); + + _INFO("Legacy lifecycle: %d", is_legacy_lifecycle); + if (!is_legacy_lifecycle) { + _INFO("[APP %d] Initial Launching, call the resume_cb", _pid); + if (ui->ops->resume) + r = ui->ops->resume(ui->ops->data); + } + } else { + _INFO("Legacy lifecycle: %d", is_legacy_lifecycle); + if (!is_legacy_lifecycle) { + _INFO("[APP %d] App already running, raise the window", _pid); + x_raise_win(getpid()); + + if (ui->state == AS_PAUSED) { + _INFO("[APP %d] Call the resume_cb", _pid); + if (ui->ops->resume) + r = ui->ops->resume(ui->ops->data); + } + } + } + ui->state = AS_RUNNING; - LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]", - ui->name); + +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER + miniapp = bundle_get_val(b, "http://tizen.org/appcontrol/data/miniapp"); + if(miniapp && strncmp(miniapp, "on", 2) == 0) { + ecore_timer_add(0.5, __appcore_mimiapp_capture_cb, NULL); + } +#endif break; case AE_PAUSE: if (ui->state == AS_RUNNING) { @@ -387,12 +544,13 @@ static void __do_app(enum app_event event, void *data, bundle * b) } /* TODO : rotation stop */ //r = appcore_pause_rotation_cb(); -#ifdef WEARABLE_PROFILE + + snprintf(trm_buf, MAX_PACKAGE_STR_SIZE, "appinfo_pause:[PID]%d", getpid()); + __trm_app_info_send_socket(trm_buf); +#ifdef WEARABLE proc_group_change_status(PROC_CGROUP_SET_BACKGRD, getpid(), NULL); -#else - _inform_backgrd(); #endif - + //_inform_backgrd(); break; case AE_RESUME: LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:resume:start]", @@ -409,11 +567,22 @@ static void __do_app(enum app_event event, void *data, bundle * b) ui->name); LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:Launching:done]", ui->name); -#ifdef WEARABLE_PROFILE + +#ifdef _GATE_TEST_ENABLE + if(strncmp(ui->name, "wrt-client", 10) != 0) { + LOG(LOG_DEBUG, "GATE-M", "APP_FULLY_LOADED_%s", ui->name); + } +#endif + +#ifdef WEARABLE proc_group_change_status(PROC_CGROUP_SET_FOREGRD, getpid(), NULL); -#else - _inform_foregrd(); #endif + snprintf(trm_buf, MAX_PACKAGE_STR_SIZE,"appinfo_resume:[PID]%d", getpid()); + __trm_app_info_send_socket(trm_buf); +#ifdef _APPFW_FEATURE_CPU_BOOST + __stop_cpu_boost(); +#endif + //_inform_foregrd(); break; default: @@ -434,10 +603,10 @@ static bool __check_visible(void) struct win_node *entry = NULL; for (iter = g_winnode_list; iter != NULL; iter = g_slist_next(iter)) { - entry = iter->data; + entry = iter->data; //_DBG("win : %x obscured : %d\n", entry->win, entry->bfobscured); if(entry->bfobscured == FALSE) - return TRUE; + return TRUE; } return FALSE; } @@ -498,7 +667,7 @@ static bool __add_win(unsigned int win) return FALSE; t->win = win; - t->bfobscured = FALSE; + t->bfobscured = TRUE; _DBG("[EVENT_TEST][EVENT] __add_win WIN:%x\n", win); @@ -532,9 +701,8 @@ static bool __delete_win(unsigned int win) return 0; } - g_winnode_list = g_slist_remove_link(g_winnode_list, f); - free(f->data); + g_winnode_list = g_slist_delete_link(g_winnode_list, f); return TRUE; } @@ -559,9 +727,8 @@ static bool __update_win(unsigned int win, bool bfobscured) return FALSE; } - g_winnode_list = g_slist_remove_link(g_winnode_list, f); - free(f->data); + g_winnode_list = g_slist_delete_link(g_winnode_list, f); t = calloc(1, sizeof(struct win_node)); if (t == NULL) @@ -571,7 +738,7 @@ static bool __update_win(unsigned int win, bool bfobscured) t->bfobscured = bfobscured; g_winnode_list = g_slist_append(g_winnode_list, t); - + return TRUE; } @@ -639,6 +806,7 @@ static void __set_wm_rotation_support(unsigned int win, unsigned int set) } Ecore_X_Atom atom_parent; +Ecore_X_Atom xsend_Atom; static Eina_Bool __show_cb(void *data, int type, void *event) { @@ -681,17 +849,19 @@ static Eina_Bool __hide_cb(void *data, int type, void *event) if (__exist_win((unsigned int)ev->win)) { __delete_win((unsigned int)ev->win); - + bvisibility = __check_visible(); - if (!bvisibility && b_active == 1) { + if (!bvisibility && b_active != 0) { _DBG(" Go to Pasue state \n"); b_active = 0; __do_app(AE_PAUSE, data, NULL); +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER if(taskmanage) { _capture_and_make_file(ev->win, getpid(), appid); } else if ( aul_is_subapp() ) { _capture_and_make_file(ev->win, getpid(), appcore_get_caller_appid()); } +#endif } } @@ -702,27 +872,39 @@ static Eina_Bool __visibility_cb(void *data, int type, void *event) { Ecore_X_Event_Window_Visibility_Change *ev; int bvisibility = 0; +#ifdef _APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS + int lcd_status = 0; +#endif ev = event; __update_win((unsigned int)ev->win, ev->fully_obscured); bvisibility = __check_visible(); - if (bvisibility && b_active == 0) { + _DBG("bvisibility %d, b_active %d", bvisibility, b_active); + + if (bvisibility && b_active != 1) { _DBG(" Go to Resume state\n"); b_active = 1; +#ifdef _APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS + vconf_get_int(VCONFKEY_PM_STATE, &lcd_status); + if(lcd_status == VCONFKEY_PM_STATE_LCDOFF) { + return ECORE_CALLBACK_RENEW; + } +#endif __do_app(AE_RESUME, data, NULL); - - } else if (!bvisibility && b_active == 1) { + } else if (!bvisibility && (b_active != 0)) { _DBG(" Go to Pasue state \n"); b_active = 0; __do_app(AE_PAUSE, data, NULL); +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER if(taskmanage) { _capture_and_make_file(ev->win, getpid(), appid); } else if ( aul_is_subapp() ) { _capture_and_make_file(ev->win, getpid(), appcore_get_caller_appid()); } +#endif } else _DBG(" No change state \n"); @@ -736,6 +918,14 @@ static Eina_Bool __cmsg_cb(void *data, int type, void *event) struct ui_priv *ui = (struct ui_priv *)data; Ecore_X_Event_Client_Message *e = event; +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER + if (e->message_type == xsend_Atom) { + _DBG("_E_ILLUME_ATOM_APPCORE_RECAPTURE_REQUEST win(%x)", e->win); + _capture_and_make_file(e->win, getpid(), appid); + return ECORE_CALLBACK_PASS_ON; + } +#endif + if (!ui) return ECORE_CALLBACK_PASS_ON; if (e->format != 32) return ECORE_CALLBACK_PASS_ON; if (e->message_type == _WM_WINDOW_ROTATION_CHANGE_REQUEST) { @@ -758,7 +948,7 @@ static Eina_Bool __cmsg_cb(void *data, int type, void *event) ui->rot_mode = rm; if (APPCORE_RM_UNKNOWN != rm) { - ui->rot_cb(rm, ui->rot_cb_data); + ui->rot_cb((void *)&rm, rm, ui->rot_cb_data); } } @@ -773,21 +963,27 @@ static void __add_climsg_cb(struct ui_priv *ui) if (!atom_parent) { // Do Error Handling + _ERR("atom_parent is NULL"); + } + xsend_Atom = ecore_x_atom_get("_E_ILLUME_ATOM_APPCORE_RECAPTURE_REQUEST"); + if (!xsend_Atom) + { + // Do Error Handling + _ERR("xsend_Atom is NULL"); } - ui->hshow = - ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, __show_cb, ui); - ui->hhide = - ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, __hide_cb, ui); - ui->hvchange = - ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, - __visibility_cb, ui); + ui->hshow = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, __show_cb, ui); + ui->hhide = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, __hide_cb, ui); + ui->hvchange = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, __visibility_cb, ui); + +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER + ui->hcmsg = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __cmsg_cb, ui); +#endif /* Add client message callback for WM_ROTATE */ if(!__check_wm_rotation_support()) { - ui->hcmsg = - ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __cmsg_cb, ui); + //ui->hcmsg = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __cmsg_cb, ui); ui->wm_rot_supported = 1; appcore_set_wm_rotation(&wm_rotate); } @@ -820,7 +1016,7 @@ static int __before_loop(struct ui_priv *ui, int *argc, char ***argv) } else { _DBG("elm_config_preferred_engine_set is not called"); } - +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER tm_tmp = getenv("TASKMANAGE"); if(tm_tmp == NULL) { _DBG("taskmanage is null"); @@ -832,7 +1028,7 @@ static int __before_loop(struct ui_priv *ui, int *argc, char ***argv) _DBG("taskmanage is true %s", tm_tmp); taskmanage = 1; } - +#endif r = appcore_init(ui->name, &efl_ops, *argc, *argv); _retv_if(r == -1, -1); @@ -860,6 +1056,12 @@ static void __after_loop(struct ui_priv *ui) appcore_unset_rotation_cb(); appcore_exit(); + if (ui->state == AS_RUNNING) { + _DBG("[APP %d] PAUSE before termination", _pid); + if (ui->ops && ui->ops->pause) + ui->ops->pause(ui->ops->data); + } + if (ui->ops && ui->ops->terminate) ui->ops->terminate(ui->ops->data); @@ -873,6 +1075,12 @@ static void __after_loop(struct ui_priv *ui) __appcore_timer_del(ui); elm_shutdown(); + +#ifdef _GATE_TEST_ENABLE + if((ui->name) && (strncmp(ui->name, "wrt-client", 10) != 0)) { + LOG(LOG_DEBUG, "GATE-M", "APP_CLOSED_%s", ui->name); + } +#endif } static int __set_data(struct ui_priv *ui, const char *name, @@ -924,7 +1132,7 @@ static void __unset_data(struct ui_priv *ui) } /* WM_ROTATE */ -static int __wm_set_rotation_cb(int (*cb) (enum appcore_rm, void *), void *data) +static int __wm_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), void *data) { if (cb == NULL) { errno = EINVAL; @@ -997,6 +1205,7 @@ static struct ui_wm_rotate wm_rotate = { __wm_resume_rotation_cb }; +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER static Window _get_parent_window(Window id) { Window root; @@ -1175,7 +1384,7 @@ static void _rotate_img(Evas_Object *image_object, int angle, int cx, int cy) } #define EXTENSION_LEN 128 -#define CAPTURE_FILE_PATH "/opt/share/app_capture" +#define CAPTURE_FILE_PATH "/opt/usr/share/app_capture" bool _make_capture_file(const char *package, int width, int height, char *img, int angle) { int len; @@ -1185,6 +1394,7 @@ bool _make_capture_file(const char *package, int width, int height, char *img, i int canvas_width, canvas_height; int cx = 0, cy = 0; int mx = 0; + int r = 0; _retv_if(NULL == package, false); @@ -1234,7 +1444,8 @@ bool _make_capture_file(const char *package, int width, int height, char *img, i evas_object_show(image_object); if (access(CAPTURE_FILE_PATH, F_OK) != 0) { - mkdir(CAPTURE_FILE_PATH, 0777); + r = mkdir(CAPTURE_FILE_PATH, 0777); + goto_if(r < 0, error); } goto_if(false == virtual_canvas_flush_to_file(e, filename, canvas_width, canvas_height), error); @@ -1305,7 +1516,6 @@ int __resize8888(const char* pDataIn, char* pDataOut, int inWidth, int inHeight, return 0; } - static void _capture_and_make_file(Ecore_X_Window win, int pid, const char *package) { Visual *visual; @@ -1344,7 +1554,9 @@ static void _capture_and_make_file(Ecore_X_Window win, int pid, const char *pack free(img); } +#endif +extern int aul_status_update(int status); EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv, struct appcore_ops *ops) @@ -1353,12 +1565,14 @@ EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv, GSList *iter = NULL; struct win_node *entry = NULL; int pid; - int ret; LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:main:done]", name); pid = getpid(); - aul_app_get_appid_bypid(pid, appid, APPID_MAX); + r = aul_app_get_appid_bypid(pid, appid, APPID_MAX); + if( r < 0) { + _ERR("aul_app_get_appid_bypid fail"); + } r = __set_data(&priv, name, ops); _retv_if(r == -1, -1); @@ -1373,6 +1587,7 @@ EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv, aul_status_update(STATUS_DYING); +#ifdef _APPFW_FEATURE_CAPTURE_FOR_TASK_MANAGER for (iter = g_winnode_list; iter != NULL; iter = g_slist_next(iter)) { entry = iter->data; if(__check_skip(entry->win) == FALSE) @@ -1384,6 +1599,7 @@ EXPORT_API int appcore_efl_main(const char *name, int *argc, char ***argv, _capture_and_make_file(entry->win, pid, appid); } } +#endif __after_loop(&priv); @@ -1405,3 +1621,50 @@ EXPORT_API int appcore_set_app_state(int state) return 0; } + +EXPORT_API int appcore_efl_goto_pause() +{ + _DBG(" Go to Pasue state \n"); + b_active = 0; + __do_app(AE_PAUSE, &priv, NULL); + + return 0; +} + +EXPORT_API int appcore_set_prelaunching(bool value) +{ + prelaunching = value; + + return 0; +} + +#ifdef _APPFW_FEATURE_PROCESS_POOL +EXPORT_API int appcore_set_preinit_window_name(const char* win_name) +{ + int ret = -1; + void *preinit_window = NULL; + + if(!win_name) { + _ERR("invalid input param"); + return -1; + } + + preinit_window = aul_get_preinit_window(win_name); + if(!preinit_window) { + _ERR("no preinit window"); + return -1; + } + + const Evas *e = evas_object_evas_get((const Evas_Object *)preinit_window); + if(e) { + Ecore_Evas *ee = ecore_evas_ecore_evas_get(e); + if(ee) { + ecore_evas_name_class_set(ee, win_name, win_name); + _DBG("name class set success : %s", win_name); + ret = 0; + } + } + + return ret; +} +#endif diff --git a/src/appcore-i18n.c b/src/appcore-i18n.c index 6dc1a53..974f81f 100755 --- a/src/appcore-i18n.c +++ b/src/appcore-i18n.c @@ -33,18 +33,16 @@ static int _set; void update_lang(void) { - char *lang; - char *r; - - lang = vconf_get_str(VCONFKEY_LANGSET); + char *lang = vconf_get_str(VCONFKEY_LANGSET); if (lang) { setenv("LANG", lang, 1); setenv("LC_MESSAGES", lang, 1); - r = setlocale(LC_ALL, ""); + char *r = setlocale(LC_ALL, ""); if (r == NULL) { - r = setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET)); - if (r) + r = setlocale(LC_ALL, lang); + if (r) { _DBG("*****appcore setlocale=%s\n", r); + } } free(lang); } @@ -88,9 +86,14 @@ static int __set_i18n(const char *domain, const char *dir) r = setlocale(LC_ALL, ""); /* if locale is not set properly, try again to set as language base */ if (r == NULL) { - r = setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET)); - if (r) + char *lang = vconf_get_str(VCONFKEY_LANGSET); + r = setlocale(LC_ALL, lang); + if (r) { _DBG("*****appcore setlocale=%s\n", r); + } + if (lang) { + free(lang); + } } if (r == NULL) { _ERR("appcore: setlocale() error"); diff --git a/src/appcore-rotation.c b/src/appcore-rotation.c index 5c493d4..2156726 100755 --- a/src/appcore-rotation.c +++ b/src/appcore-rotation.c @@ -24,7 +24,9 @@ #include #include -#include +#include +//#include + #include #include #include @@ -40,13 +42,14 @@ } while(0) #define STR_ATOM_ROTATION_LOCK "_E_ROTATION_LOCK" +#define MAX_LOCAL_BUFSZ 128 static Ecore_X_Atom ATOM_ROTATION_LOCK = 0; static Ecore_X_Window root; struct rot_s { int handle; - int (*callback) (enum appcore_rm, void *); + int (*callback) (void *event_info, enum appcore_rm, void *); enum appcore_rm mode; int lock; void *cbdata; @@ -58,26 +61,26 @@ struct rot_s { static struct rot_s rot; struct rot_evt { - enum accelerometer_rotate_state re; + int re; enum appcore_rm rm; }; static struct rot_evt re_to_rm[] = { { - ROTATION_EVENT_0, - APPCORE_RM_PORTRAIT_NORMAL, + AUTO_ROTATION_DEGREE_0, + APPCORE_RM_PORTRAIT_NORMAL, }, { - ROTATION_EVENT_90, - APPCORE_RM_LANDSCAPE_NORMAL, + AUTO_ROTATION_DEGREE_90, + APPCORE_RM_LANDSCAPE_NORMAL, }, { - ROTATION_EVENT_180, - APPCORE_RM_PORTRAIT_REVERSE, + AUTO_ROTATION_DEGREE_180, + APPCORE_RM_PORTRAIT_REVERSE, }, { - ROTATION_EVENT_270, - APPCORE_RM_LANDSCAPE_REVERSE, + AUTO_ROTATION_DEGREE_270, + APPCORE_RM_LANDSCAPE_REVERSE, }, }; @@ -108,7 +111,7 @@ static void __changed_cb(unsigned int event_type, sensor_event_data_t *event, if (rot.lock) return; - if (event_type != ACCELEROMETER_EVENT_ROTATION_CHECK) { + if (event_type != AUTO_ROTATION_EVENT_CHANGE_STATE) { errno = EINVAL; return; } @@ -118,28 +121,27 @@ static void __changed_cb(unsigned int event_type, sensor_event_data_t *event, m = __get_mode(*cb_event_data); _DBG("[APP %d] Rotation: %d -> %d", getpid(), rot.mode, m); - if (rot.callback) { if (rot.cb_set && rot.mode != m) { _DBG("[APP %d] Rotation: %d -> %d", getpid(), rot.mode, m); - rot.callback(m, data); + rot.callback((void *)&m, m, data); rot.mode = m; } } + } static void __lock_cb(keynode_t *node, void *data) { int r; enum appcore_rm m; - int ret; rot.lock = !vconf_keynode_get_bool(node); if (rot.lock) { m = APPCORE_RM_PORTRAIT_NORMAL; if (rot.mode != m) { - rot.callback(m, data); + rot.callback((void *)&m, m, data); rot.mode = m; } _DBG("[APP %d] Rotation locked", getpid()); @@ -153,7 +155,7 @@ static void __lock_cb(keynode_t *node, void *data) _DBG("[APP %d] Rotmode prev %d -> curr %d", getpid(), rot.mode, m); if (!r && rot.mode != m) { - rot.callback(m, data); + rot.callback((void *)&m, m, data); rot.mode = m; } } @@ -183,13 +185,12 @@ static void __del_rotlock(void) rot.lock = 0; } -EXPORT_API int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *), +EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), void *data) { if (rot.wm_rotate) { return rot.wm_rotate->set_rotation_cb(cb, data); - } - else { + } else { int r; int handle; @@ -203,13 +204,13 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *), return -1; } - handle = sf_connect(ACCELEROMETER_SENSOR); + handle = sf_connect(AUTO_ROTATION_SENSOR); if (handle < 0) { _ERR("sf_connect failed: %d", handle); return -1; } - r = sf_register_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK, + r = sf_register_event(handle, AUTO_ROTATION_EVENT_CHANGE_STATE, NULL, __changed_cb, data); if (r < 0) { _ERR("sf_register_event failed: %d", r); @@ -224,7 +225,7 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *), r = sf_start(handle, 0); if (r < 0) { _ERR("sf_start failed: %d", r); - r = sf_unregister_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK); + r = sf_unregister_event(handle, AUTO_ROTATION_EVENT_CHANGE_STATE); if (r < 0) { _ERR("sf_unregister_event failed: %d", r); } @@ -261,7 +262,7 @@ EXPORT_API int appcore_unset_rotation_cb(void) if (rot.cb_set) { r = sf_unregister_event(rot.handle, - ACCELEROMETER_EVENT_ROTATION_CHECK); + AUTO_ROTATION_EVENT_CHANGE_STATE); if (r < 0) { _ERR("sf_unregister_event failed: %d", r); return -1; @@ -298,15 +299,18 @@ EXPORT_API int appcore_get_rotation_state(enum appcore_rm *curr) else { int r; unsigned long event; + sensor_data_t data; if (curr == NULL) { errno = EINVAL; return -1; } - r = sf_check_rotation(&event); - if (r < 0) { - _ERR("sf_check_rotation failed: %d", r); + r = sf_get_data(rot.handle, AUTO_ROTATION_BASE_DATA_SET, &data); + if (r == 1 && data.value_count > 0) { + event = data.values[0]; + } else { + _ERR("sf_get_data for AUTO_ROTATION_BASE_DATA_SET failed: %d", r); *curr = APPCORE_RM_UNKNOWN; return -1; } @@ -331,7 +335,7 @@ EXPORT_API int appcore_pause_rotation_cb(void) if (rot.cb_set) { r = sf_unregister_event(rot.handle, - ACCELEROMETER_EVENT_ROTATION_CHECK); + AUTO_ROTATION_EVENT_CHANGE_STATE); if (r < 0) { _ERR("sf_unregister_event in appcore_internal_sf_stop failed: %d", r); return -1; @@ -359,7 +363,7 @@ EXPORT_API int appcore_resume_rotation_cb(void) return rot.wm_rotate->resume_rotation_cb(); } else { - int r; + int r,ret; enum appcore_rm m; _retv_if(rot.callback == NULL, 0); @@ -367,7 +371,7 @@ EXPORT_API int appcore_resume_rotation_cb(void) if (rot.cb_set == 0) { r = sf_register_event(rot.handle, - ACCELEROMETER_EVENT_ROTATION_CHECK, NULL, + AUTO_ROTATION_EVENT_CHANGE_STATE, NULL, __changed_cb, rot.cbdata); if (r < 0) { _ERR("sf_register_event in appcore_internal_sf_start failed: %d", r); @@ -381,11 +385,10 @@ EXPORT_API int appcore_resume_rotation_cb(void) if (r < 0) { _ERR("sf_start in appcore_internal_sf_start failed: %d", r); - r = sf_unregister_event(rot.handle, - ACCELEROMETER_EVENT_ROTATION_CHECK); - if (r < 0) { - _ERR("sf_unregister_event failed: %d", r); - } + ret = sf_unregister_event(rot.handle, + AUTO_ROTATION_EVENT_CHANGE_STATE); + if (ret < 0) + _ERR("sf_unregister_event failed: %d", ret); rot.cb_set = 0; return -1; } @@ -397,7 +400,7 @@ EXPORT_API int appcore_resume_rotation_cb(void) r = appcore_get_rotation_state(&m); _DBG("[APP %d] Rotmode prev %d -> curr %d", getpid(), rot.mode, m); if (!r && rot.mode != m && rot.lock == 0) { - rot.callback(m, rot.cbdata); + rot.callback((void *)&m, m, rot.cbdata); rot.mode = m; } } diff --git a/src/appcore.c b/src/appcore.c index c9ae214..9dcc2ed 100755 --- a/src/appcore.c +++ b/src/appcore.c @@ -92,6 +92,10 @@ static struct open_s open; static int __app_terminate(void *data); static int __app_resume(void *data); static int __app_reset(void *data, bundle *k); +#ifdef _APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS +static int __app_resume_lcd_on(void *data); +static int __app_pause_lcd_off(void *data); +#endif static int __sys_lowmem_post(void *data, void *evt); static int __sys_lowmem(void *data, void *evt); @@ -136,7 +140,7 @@ static struct evt_ops evtops[] = { static int __get_dir_name(char *dirname) { - char pkg_name[PKGNAME_MAX]; + char pkgid[PKGNAME_MAX]; int r; int pid; @@ -144,14 +148,14 @@ static int __get_dir_name(char *dirname) if (pid < 0) return -1; - if (aul_app_get_pkgname_bypid(pid, pkg_name, PKGNAME_MAX) != AUL_R_OK) + if (aul_app_get_pkgid_bypid(pid, pkgid, PKGNAME_MAX) != AUL_R_OK) return -1; - r = snprintf(dirname, PATH_MAX, PATH_APP_ROOT "/%s" PATH_RES PATH_LOCALE,pkg_name); + r = snprintf(dirname, PATH_MAX, PATH_APP_ROOT "/%s" PATH_RES PATH_LOCALE,pkgid); if (r < 0) return -1; if (access(dirname, R_OK) == 0) return 0; - r = snprintf(dirname, PATH_MAX, PATH_RO_APP_ROOT "/%s" PATH_RES PATH_LOCALE,pkg_name); + r = snprintf(dirname, PATH_MAX, PATH_RO_APP_ROOT "/%s" PATH_RES PATH_LOCALE,pkgid); if (r < 0) return -1; @@ -200,6 +204,22 @@ static int __app_resume(void *data) return 0; } +#ifdef _APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS +static int __app_resume_lcd_on(void *data) +{ + struct appcore *ac = data; + ac->ops->cb_app(AE_RESUME, ac->ops->data, NULL); + return 0; +} + +static int __app_pause_lcd_off(void *data) +{ + struct appcore *ac = data; + ac->ops->cb_app(AE_PAUSE, ac->ops->data, NULL); + return 0; +} +#endif + static int __sys_do_default(struct appcore *ac, enum sys_event event) { int r; @@ -217,7 +237,7 @@ static int __sys_do_default(struct appcore *ac, enum sys_event event) return r; } -static int __sys_do(struct appcore *ac, enum sys_event event) +static int __sys_do(struct appcore *ac, void *event_info, enum sys_event event) { struct sys_op *op; @@ -228,7 +248,7 @@ static int __sys_do(struct appcore *ac, enum sys_event event) if (op->func == NULL) return __sys_do_default(ac, event); - return op->func(op->data); + return op->func(event_info, op->data); } static int __sys_lowmem_post(void *data, void *evt) @@ -257,7 +277,7 @@ static int __sys_lowmem(void *data, void *evt) val = vconf_keynode_get_int(key); if (val >= VCONFKEY_SYSMAN_LOW_MEMORY_SOFT_WARNING) - return __sys_do(data, SE_LOWMEM); + return __sys_do(data, (void *)&val, SE_LOWMEM); return 0; } @@ -271,7 +291,7 @@ static int __sys_lowbatt(void *data, void *evt) /* VCONFKEY_SYSMAN_BAT_CRITICAL_LOW or VCONFKEY_SYSMAN_POWER_OFF */ if (val <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW) - return __sys_do(data, SE_LOWBAT); + return __sys_do(data, (void *)&val, SE_LOWBAT); return 0; } @@ -284,7 +304,12 @@ static int __sys_langchg_pre(void *data, void *evt) static int __sys_langchg(void *data, void *evt) { - return __sys_do(data, SE_LANGCHG); + keynode_t *key = evt; + char *val; + + val = vconf_keynode_get_str(key); + + return __sys_do(data, (void *)val, SE_LANGCHG); } static int __sys_regionchg_pre(void *data, void *evt) @@ -295,7 +320,15 @@ static int __sys_regionchg_pre(void *data, void *evt) static int __sys_regionchg(void *data, void *evt) { - return __sys_do(data, SE_REGIONCHG); + keynode_t *key = evt; + char *val = NULL; + const char *name; + + name = vconf_keynode_get_name(key); + if (!strcmp(name, VCONFKEY_REGIONFORMAT)) + val = vconf_keynode_get_str(key); + + return __sys_do(data, (void *)val, SE_REGIONCHG); } static void __vconf_do(struct evt_ops *eo, keynode_t * key, void *data) @@ -383,7 +416,7 @@ static int __del_vconf(void) static int __aul_handler(aul_type type, bundle *b, void *data) { int ret; - char *str = NULL; + const char *str = NULL; switch (type) { case AUL_START: @@ -410,6 +443,16 @@ static int __aul_handler(aul_type type, bundle *b, void *data) _DBG("[APP %d] AUL event: AUL_TERMINATE", _pid); __app_terminate(data); break; +#ifdef _APPFW_FEATURE_VISIBILITY_CHECK_BY_LCD_STATUS + case AUL_RESUME_LCD_ON: + _DBG("[APP %d] AUL event: AUL_RESUME_LCD_ON", _pid); + __app_resume_lcd_on(data); + break; + case AUL_PAUSE_LCD_OFF: + _DBG("[APP %d] AUL event: AUL_PAUSE_LCD_OFF", _pid); + __app_pause_lcd_off(data); + break; +#endif default: _DBG("[APP %d] AUL event: %d", _pid, type); /* do nothing */ @@ -440,7 +483,7 @@ EXPORT_API int appcore_set_open_cb(int (*cb) (void *), } EXPORT_API int appcore_set_event_callback(enum appcore_event event, - int (*cb) (void *), void *data) + int (*cb) (void *, void *), void *data) { struct appcore *ac = &core; struct sys_op *op; @@ -486,6 +529,7 @@ EXPORT_API int appcore_init(const char *name, const struct ui_ops *ops, } r = __get_dir_name(dirname); + SECURE_LOGD("dir : %s", dirname); r = set_i18n(name, dirname); _retv_if(r == -1, -1); -- 2.7.4