Care the case of no registered event handler.
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 15 Jul 2013 03:47:25 +0000 (12:47 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 15 Jul 2013 03:47:25 +0000 (12:47 +0900)
If a provider developer didn't register the buffer type event handler,
accessibility should send back its status to the client.

If it doesn't send it, the client will be stuck for waiting it.

Change-Id: I46ad23e5ec18e8cd38856fbfc61b4b122eaf080a

packaging/libprovider.spec
src/provider_buffer.c

index a5c5162..631084c 100644 (file)
@@ -1,6 +1,6 @@
 Name: libprovider
 Summary: Library for developing the livebox service provider.
-Version: 0.9.5
+Version: 0.9.6
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
index c45c76b..3554432 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <dlog.h>
 #include <livebox-errno.h>
+#include <livebox-service.h>
 
 #include "dlist.h"
 #include "util.h"
@@ -1019,6 +1020,9 @@ struct packet *provider_buffer_pd_access_action_up(pid_t pid, int handle, const
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_ACTION_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1055,6 +1059,9 @@ struct packet *provider_buffer_pd_access_action_down(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_ACTION_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1091,6 +1098,9 @@ struct packet *provider_buffer_pd_access_scroll_down(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_SCROLL_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1127,6 +1137,9 @@ struct packet *provider_buffer_pd_access_scroll_move(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_SCROLL_MOVE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1163,6 +1176,9 @@ struct packet *provider_buffer_pd_access_scroll_up(pid_t pid, int handle, const
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_SCROLL_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1199,6 +1215,9 @@ struct packet *provider_buffer_pd_access_unhighlight(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_UNHIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1235,6 +1254,9 @@ struct packet *provider_buffer_pd_access_hl(pid_t pid, int handle, const struct
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_HIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1271,6 +1293,9 @@ struct packet *provider_buffer_pd_access_hl_prev(pid_t pid, int handle, const st
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_HIGHLIGHT_PREV, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1307,6 +1332,9 @@ struct packet *provider_buffer_pd_access_hl_next(pid_t pid, int handle, const st
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_HIGHLIGHT_NEXT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1343,6 +1371,9 @@ struct packet *provider_buffer_pd_access_activate(pid_t pid, int handle, const s
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_ACTIVATE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1379,6 +1410,9 @@ struct packet *provider_buffer_lb_access_unhighlight(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_UNHIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1415,6 +1449,9 @@ struct packet *provider_buffer_lb_access_hl(pid_t pid, int handle, const struct
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_HIGHLIGHT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1451,6 +1488,9 @@ struct packet *provider_buffer_lb_access_hl_prev(pid_t pid, int handle, const st
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_HIGHLIGHT_PREV, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1487,6 +1527,9 @@ struct packet *provider_buffer_lb_access_hl_next(pid_t pid, int handle, const st
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_HIGHLIGHT_NEXT, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1523,6 +1566,9 @@ struct packet *provider_buffer_lb_access_action_up(pid_t pid, int handle, const
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_ACTION_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1559,6 +1605,9 @@ struct packet *provider_buffer_lb_access_action_down(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_ACTION_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1595,6 +1644,9 @@ struct packet *provider_buffer_lb_access_scroll_down(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_SCROLL_DOWN, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1631,6 +1683,9 @@ struct packet *provider_buffer_lb_access_scroll_move(pid_t pid, int handle, cons
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_SCROLL_MOVE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1667,6 +1722,9 @@ struct packet *provider_buffer_lb_access_scroll_up(pid_t pid, int handle, const
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_SCROLL_UP, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out:
@@ -1703,6 +1761,9 @@ struct packet *provider_buffer_lb_access_activate(pid_t pid, int handle, const s
                        ErrPrint("Failed to get buffer size[%s:%s]\n", pkgname, id);
 
                (void)info->handler(info, BUFFER_EVENT_ACTIVATE, timestamp, (double)x / (double)w, (double)y / (double)h, info->data);
+       } else {
+               /* Event handler is not ready */
+               (void)provider_send_access_status(pkgname, id, LB_ACCESS_STATUS_ERROR);
        }
 
 out: