From 05cc3c02ac406ea3142ffb3d74b1e3d031dc408b Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Thu, 9 Apr 2020 18:30:05 +0900 Subject: [PATCH] Fix Frame Broker - Fixes wrong if statements Change-Id: I10efa37cc16f50bc32706a7571d127024a1a465d Signed-off-by: Hwankyu Jhun --- frame-broker/src/frame_broker.c | 18 +++++++++--------- frame-broker/src/frame_context.c | 6 ++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/frame-broker/src/frame_broker.c b/frame-broker/src/frame_broker.c index 30372acf..8e96b77a 100644 --- a/frame-broker/src/frame_broker.c +++ b/frame-broker/src/frame_broker.c @@ -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, diff --git a/frame-broker/src/frame_context.c b/frame-broker/src/frame_context.c index d27fd94e..62e33036 100644 --- a/frame-broker/src/frame_context.c +++ b/frame-broker/src/frame_context.c @@ -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); } -- 2.34.1