Fix Frame Broker 34/230334/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 9 Apr 2020 09:30:05 +0000 (18:30 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 9 Apr 2020 09:30:47 +0000 (18:30 +0900)
- Fixes wrong if statements

Change-Id: I10efa37cc16f50bc32706a7571d127024a1a465d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
frame-broker/src/frame_broker.c
frame-broker/src/frame_context.c

index 30372ac..8e96b77 100644 (file)
@@ -132,18 +132,18 @@ static void __aul_launcher_service_cb(const char *app_id,
        _D("app_id(%s), inst_id(%s), pid(%d), serial(%u)",
                        app_id, inst_id, pid, serial);
 
-       if (broker->pre_context) {
-               __check_pre_context(broker);
+       if (!broker->pre_context) {
+               _W("Previous context is nullptr");
                return;
        }
 
-       if (broker->context) {
-               frame_context_get_pid(broker->context, &ctx_pid);
-               frame_context_get_serial(broker->context, &ctx_serial);
-               if (ctx_pid == pid && ctx_serial == serial) {
-                       _D("Frame context already exists");
-                       return;
-               }
+       __check_pre_context(broker);
+
+       frame_context_get_pid(broker->context, &ctx_pid);
+       frame_context_get_serial(broker->context, &ctx_serial);
+       if (ctx_pid == pid && ctx_serial == serial) {
+               _D("Frame context already exists");
+               return;
        }
 
        ret = frame_context_create(broker, app_id, inst_id, pid, serial,
index d27fd94..62e3303 100644 (file)
@@ -313,6 +313,7 @@ void frame_context_on_create(frame_context_h handle)
        if (handle->state != FRAME_CONTEXT_STATE_NONE)
                return;
 
+       _W("handle(%p)", handle);
        handle->callback.create(handle, handle->user_data);
        handle->state = FRAME_CONTEXT_STATE_CREATED;
 }
@@ -327,6 +328,7 @@ void frame_context_on_resume(frame_context_h handle, frame_h frame)
        frame_context_set_frame(handle, frame);
 
        if (handle->state == FRAME_CONTEXT_STATE_RESUMED) {
+               _W("[__UPDATE__] handle(%p), frame(%p)", handle, frame);
                handle->callback.update(handle, frame, handle->user_data);
                return;
        }
@@ -335,6 +337,7 @@ void frame_context_on_resume(frame_context_h handle, frame_h frame)
                        handle->state != FRAME_CONTEXT_STATE_PAUSED)
                return;
 
+       _W("[__RESUME__] handle(%p), frame(%p)", handle, frame);
        handle->callback.resume(handle, frame, handle->user_data);
        handle->state = FRAME_CONTEXT_STATE_RESUMED;
 }
@@ -349,6 +352,7 @@ void frame_context_on_pause(frame_context_h handle)
        if (handle->state != FRAME_CONTEXT_STATE_RESUMED)
                return;
 
+       _W("handle(%p)", handle);
        handle->callback.pause(handle, handle->user_data);
        handle->state = FRAME_CONTEXT_STATE_PAUSED;
 }
@@ -363,6 +367,7 @@ void frame_context_on_destroy(frame_context_h handle)
        if (handle->state == FRAME_CONTEXT_STATE_NONE)
                return;
 
+       _W("handle(%p)", handle);
        handle->callback.destroy(handle, handle->user_data);
        handle->state = FRAME_CONTEXT_STATE_DESTROYED;
 }
@@ -374,5 +379,6 @@ void frame_context_on_error(frame_context_h handle, frame_context_error_e error)
                return;
        }
 
+       _W("handle(%p), error(%d)", handle, error);
        handle->callback.error(handle, error, handle->user_data);
 }