Fix the bug of visibility state update code
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 10 Apr 2015 16:14:16 +0000 (01:14 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Fri, 10 Apr 2015 16:15:11 +0000 (01:15 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: Iab49e48f3ebea5babe242f0656fb0fa859668707

src/server.c
src/slave_life.c

index 651a896..3249b2e 100644 (file)
@@ -7874,12 +7874,6 @@ static struct packet *slave_hello_sync_prepare(pid_t pid, int handle, const stru
                        goto out;
                }
 
-               /**
-                * @note
-                * To send the pause/resume event to the provider, reverse set its state from here
-                */
-               slave_set_state(slave, xmonitor_is_paused() ? SLAVE_RESUMED : SLAVE_PAUSED);
-
                DbgPrint("Update handle for %s (%d)\n", pkgname, handle);
                slave_rpc_update_handle(slave, handle, 1);
        } else {
@@ -8126,18 +8120,13 @@ static struct packet *slave_hello_sync(pid_t pid, int handle, const struct packe
                                goto out;
                        }
 
+                       slave_set_state(slave, SLAVE_REQUEST_TO_LAUNCH);
                        slave_set_pid(slave, pid);
                        slave_set_valid(slave);
 
                        if (handle >= 0) {
                                /**
                                 * @note
-                                * To send the pause/resume event to the provider, reverse set its state from here
-                                */
-                               slave_set_state(slave, xmonitor_is_paused() ? SLAVE_RESUMED : SLAVE_PAUSED);
-
-                               /**
-                                * @note
                                 * In this case, there could not be exists any pended packets.
                                 * But we tried to clear them for a case!
                                 */
@@ -8245,12 +8234,6 @@ static struct packet *slave_hello_sync(pid_t pid, int handle, const struct packe
                }
 
                if (handle >= 0) {
-                       /**
-                        * @note
-                        * To send the pause/resume event to the provider, reverse set its state from here
-                        */
-                       slave_set_state(slave, xmonitor_is_paused() ? SLAVE_RESUMED : SLAVE_PAUSED);
-
                        slave_rpc_update_handle(slave, handle, 1);
 
                        /**
index 7d6d3ac..d02f253 100644 (file)
@@ -1695,12 +1695,13 @@ HAPI int slave_resume(struct slave_node *slave)
 
        switch (slave->state) {
        case SLAVE_REQUEST_TO_DISCONNECT:
-       case SLAVE_REQUEST_TO_LAUNCH:
        case SLAVE_REQUEST_TO_TERMINATE:
        case SLAVE_TERMINATED:
+               ErrPrint("Slave state[%d]\n", slave->state);
                return WIDGET_ERROR_INVALID_PARAMETER;
        case SLAVE_RESUMED:
        case SLAVE_REQUEST_TO_RESUME:
+               ErrPrint("Slave state[%d]\n", slave->state);
                return WIDGET_ERROR_NONE;
        default:
                break;
@@ -1726,12 +1727,13 @@ HAPI int slave_pause(struct slave_node *slave)
 
        switch (slave->state) {
        case SLAVE_REQUEST_TO_DISCONNECT:
-       case SLAVE_REQUEST_TO_LAUNCH:
        case SLAVE_REQUEST_TO_TERMINATE:
        case SLAVE_TERMINATED:
+               ErrPrint("Slave state[%d]\n", slave->state);
                return WIDGET_ERROR_INVALID_PARAMETER;
        case SLAVE_PAUSED:
        case SLAVE_REQUEST_TO_PAUSE:
+               ErrPrint("Slave state[%d]\n", slave->state);
                return WIDGET_ERROR_NONE;
        default:
                break;