From 4c5097d5c48a603ea1e5f25ec64b94d524e0668b Mon Sep 17 00:00:00 2001 From: Kyuho Jo Date: Tue, 8 Nov 2016 08:46:41 +0900 Subject: Remove temp codes Change-Id: I5c0fe480431e4488fb5aca8d8822f04673a0e481 Signed-off-by: Kyuho Jo --- clock-viewer/src/clock-viewer.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/clock-viewer/src/clock-viewer.c b/clock-viewer/src/clock-viewer.c index 67a5899..1550354 100644 --- a/clock-viewer/src/clock-viewer.c +++ b/clock-viewer/src/clock-viewer.c @@ -252,7 +252,7 @@ static void __clock_viewer_lcdoff_cb(void *data, DBusMessage *msg) #endif ret = vconf_set_int(CLOCK_VIEWER_VCONF_CLOCK_VIEWER_CLOCK_VISIBILITY, s_info.home_clock_visibitity); if (ret != 0) { - _ERR("Failed to set clock visibility"); + _ERR("Failed to set clock visibility. ret[%d] home_clock_visibitity[%d]", ret, s_info.home_clock_visibitity); } else { _DBG("Clock visibility set to [%d]", s_info.home_clock_visibitity); } @@ -268,13 +268,15 @@ static void __clock_viewer_lcdoff_cb(void *data, DBusMessage *msg) } char *clock_signal[1] = { "clockstart" }; - _WARN("clock start >>"); + _DBG("clock start >>"); device_power_request_lock(POWER_LOCK_CPU, 0); clock_viewer_util_dbus_broadcast_signal(clock_viewer, DEVICED_PATH, DEVICED_INTERFACE, "HomeScreen", "s", &clock_signal[0]); + _DBG("ambient_type[%d] clock_viewer->current_type[%d]", s_info.ambient_type, clock_viewer->current_type); + if (s_info.ambient_type == CLOCK_VIEWER_AMBIENT_TYPE_MANUAL) { char *clock_begin_signal[1] = { "clockbegin" }; - _WARN("clock begin >>"); + _DBG("clock begin >>"); clock_viewer_util_dbus_broadcast_signal(clock_viewer, DEVICED_PATH, DEVICED_INTERFACE, "HomeScreen", "s", &clock_begin_signal[0]); } @@ -283,6 +285,7 @@ static void __clock_viewer_lcdoff_cb(void *data, DBusMessage *msg) s_info.render_first_timer = ecore_timer_add(1.0, __clock_viewer_render_first_timer_cb, clock_viewer); } + _DBG("clock_visibitity[%d]", s_info.clock_visibitity); if (!s_info.clock_visibitity) { clock_viewer_show(clock_viewer, 0); } @@ -368,10 +371,6 @@ static void _clock_viewer_set_current_clock(clock_viewer_s *clock_viewer) ambient_type = clock_viewer_util_pkginfo_get_ambient_type(pkgname); _DBG("package[%s] ambient type[%d]", pkgname, ambient_type); - /* Force to set built-in clock temporally - * TODO: remove the below line for external watch app */ - ambient_type = 0; - /* unload old clock */ clock_viewer_default_clock_fini(clock_viewer); clock_viewer_widget_fini(clock_viewer); -- cgit v1.2.3 From 3c1a3b69e845adff0bfe3000db136ab47b73ba41 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Fri, 2 Dec 2016 14:03:53 +0900 Subject: [Clock viewer] Set the clock object using clock's resource id Change-Id: I54e70a90f2882a9e1569af32b59c455c73b1b1df --- clock-viewer/include/clock-viewer-util-pkginfo.h | 1 + clock-viewer/include/clock-viewer-widget.h | 2 +- clock-viewer/src/clock-viewer-util-pkginfo.c | 9 ++++++++- clock-viewer/src/clock-viewer-widget.c | 6 +++++- clock-viewer/src/clock-viewer.c | 9 ++++++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/clock-viewer/include/clock-viewer-util-pkginfo.h b/clock-viewer/include/clock-viewer-util-pkginfo.h index 550792c..e8e98bd 100644 --- a/clock-viewer/include/clock-viewer-util-pkginfo.h +++ b/clock-viewer/include/clock-viewer-util-pkginfo.h @@ -28,6 +28,7 @@ extern void clock_viewer_util_pkginfo_init_clock_package_event(void *data, vconf extern void clock_viewer_util_pkginfo_fini_clock_package_event(vconf_callback_fn cb); extern char *clock_viewer_util_pkginfo_get_clock_package(void); +extern int clock_viewer_util_pkginfo_get_clock_resource_id(void); extern clock_viewer_ambient_type clock_viewer_util_pkginfo_get_ambient_type(char *appid); diff --git a/clock-viewer/include/clock-viewer-widget.h b/clock-viewer/include/clock-viewer-widget.h index 867f41a..3ad1eaa 100644 --- a/clock-viewer/include/clock-viewer-widget.h +++ b/clock-viewer/include/clock-viewer-widget.h @@ -24,7 +24,7 @@ #include "clock-viewer.h" -extern void clock_viewer_widget_init(void *data, Evas_Object *parent, char *pkgname); +extern void clock_viewer_widget_init(void *data, Evas_Object *parent, char *pkgname, int resource_id); extern void clock_viewer_widget_fini(void *data); extern void clock_viewer_widget_pause(void); extern void clock_viewer_widget_resume(void); diff --git a/clock-viewer/src/clock-viewer-util-pkginfo.c b/clock-viewer/src/clock-viewer-util-pkginfo.c index b77ad04..efebc3b 100644 --- a/clock-viewer/src/clock-viewer-util-pkginfo.c +++ b/clock-viewer/src/clock-viewer-util-pkginfo.c @@ -27,7 +27,7 @@ HAPI void clock_viewer_util_pkginfo_init_clock_package_event(void *data, vconf_c { int ret = 0; - ret = vconf_notify_key_changed(VCONFKEY_WMS_CLOCKS_SET_IDLE, cb, data); + ret = vconf_notify_key_changed("memory/homescreen/watch_resource_id", cb, data); if (ret != 0) { _ERR("Failed to notify clock set"); } @@ -48,6 +48,13 @@ HAPI char *clock_viewer_util_pkginfo_get_clock_package(void) return vconf_get_str(VCONFKEY_WMS_CLOCKS_SET_IDLE); } +HAPI int clock_viewer_util_pkginfo_get_clock_resource_id(void) +{ + int resource_id = 0; + vconf_get_int("memory/homescreen/watch_resource_id", &resource_id); + return resource_id; +} + static inline char *pkgmgr_get_mainapp(const char *pkgid) { pkgmgrinfo_pkginfo_h handle; diff --git a/clock-viewer/src/clock-viewer-widget.c b/clock-viewer/src/clock-viewer-widget.c index ec7c7e8..66dd465 100644 --- a/clock-viewer/src/clock-viewer-widget.c +++ b/clock-viewer/src/clock-viewer-widget.c @@ -41,6 +41,7 @@ static struct _widget_info int view_pos; int view_pos_timestamp; + int resource_id; } s_widget_info = { .win = NULL, .layout = NULL, @@ -53,6 +54,7 @@ static struct _widget_info .view_pos = 0, .view_pos_timestamp = 0, + .resource_id = 0, }; @@ -97,7 +99,7 @@ static void _watch_removed_cb(void *data, Evas_Object *obj, void *event_info) } -HAPI void clock_viewer_widget_init(void *data, Evas_Object *win, char *pkgname) +HAPI void clock_viewer_widget_init(void *data, Evas_Object *win, char *pkgname, int resource_id) { if (s_widget_info.is_widget_init) { _DBG("widget already initialized"); @@ -121,6 +123,8 @@ HAPI void clock_viewer_widget_init(void *data, Evas_Object *win, char *pkgname) watch_manager_init(win); + watch_manager_set_resource_id(resource_id); + evas_object_smart_callback_add(win, WATCH_SMART_SIGNAL_ADDED, _watch_added_cb, data); evas_object_smart_callback_add(win, WATCH_SMART_SIGNAL_REMOVED, _watch_removed_cb, data); diff --git a/clock-viewer/src/clock-viewer.c b/clock-viewer/src/clock-viewer.c index 1550354..24f365d 100644 --- a/clock-viewer/src/clock-viewer.c +++ b/clock-viewer/src/clock-viewer.c @@ -351,6 +351,7 @@ static void _clock_viewer_set_current_clock(clock_viewer_s *clock_viewer) { clock_viewer_ambient_type ambient_type; char *pkgname; + int resource_id = 0; pkgname = clock_viewer_util_pkginfo_get_clock_package(); if (!pkgname) { @@ -358,6 +359,12 @@ static void _clock_viewer_set_current_clock(clock_viewer_s *clock_viewer) return; } + resource_id = clock_viewer_util_pkginfo_get_clock_resource_id(); + if (!resource_id) { + _ERR("resource id is not valid\n"); + return; + } + if (s_info.clock_pkgname) { if (!strcmp(s_info.clock_pkgname, pkgname)) { _WARN("same pkgname(%s), skip!", pkgname); @@ -378,7 +385,7 @@ static void _clock_viewer_set_current_clock(clock_viewer_s *clock_viewer) /* load new clock */ if (ambient_type == CLOCK_VIEWER_AMBIENT_TYPE_MANUAL) { if (clock_viewer_util_pkginfo_is_widget(pkgname)) { - clock_viewer_widget_init(clock_viewer, clock_viewer->window, pkgname); + clock_viewer_widget_init(clock_viewer, clock_viewer->window, pkgname, resource_id); clock_viewer->current_type = CLOCK_VIEWER_TYPE_WIDGET; } else { clock_viewer->current_type = CLOCK_VIEWER_TYPE_MINICTRL; -- cgit v1.2.3