[UTC][component-manager][Non-ACR][Update test applications] 75/255675/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 22 Mar 2021 09:39:35 +0000 (18:39 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Mon, 22 Mar 2021 09:42:52 +0000 (09:42 +0000)
This patch uses message-port API instead of app-control API.
If the running component is resumed, the app_control is not delivered.

Frame Component States:
 - https://docs.tizen.org/application/native/guides/applications/media/frame_lifecycle.jpg

Change-Id: I83b9cf1171178c8724b2dded41076bfda78cd6df
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
13 files changed:
src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-aarch64.tpk
src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk
src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk
src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-aarch64.tpk
src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk
src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk
src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-aarch64.tpk
src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk
src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk
src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-aarch64.tpk
src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk
src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk
src/utc/component-manager/utc_component_context_is_terminated.c

index 3d3eadf4742569e9b621aa6708c01e2d99ed073d..5f39e56ef216ead78de2a125c40615ef1fa41dcb 100644 (file)
Binary files a/src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-aarch64.tpk and b/src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-aarch64.tpk differ
index f0f7a68cd5fd22bac8b1ebc7903bbe44f48159ae..c44eeaf6a9cf8469874bd50c9bbba49cf5dc319a 100644 (file)
Binary files a/src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk and b/src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk differ
index dc0c883feca88d817d40c6e02962cebca5488640..b92ea56e256cc4f6b3510fb07f3f6f886594f1da 100644 (file)
Binary files a/src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk and b/src/utc/component-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk differ
index 3d3eadf4742569e9b621aa6708c01e2d99ed073d..5f39e56ef216ead78de2a125c40615ef1fa41dcb 100644 (file)
Binary files a/src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-aarch64.tpk and b/src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-aarch64.tpk differ
index f0f7a68cd5fd22bac8b1ebc7903bbe44f48159ae..c44eeaf6a9cf8469874bd50c9bbba49cf5dc319a 100644 (file)
Binary files a/src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk and b/src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk differ
index dc0c883feca88d817d40c6e02962cebca5488640..b92ea56e256cc4f6b3510fb07f3f6f886594f1da 100644 (file)
Binary files a/src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk and b/src/utc/component-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk differ
index 3d3eadf4742569e9b621aa6708c01e2d99ed073d..5f39e56ef216ead78de2a125c40615ef1fa41dcb 100644 (file)
Binary files a/src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-aarch64.tpk and b/src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-aarch64.tpk differ
index f0f7a68cd5fd22bac8b1ebc7903bbe44f48159ae..c44eeaf6a9cf8469874bd50c9bbba49cf5dc319a 100644 (file)
Binary files a/src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk and b/src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk differ
index dc0c883feca88d817d40c6e02962cebca5488640..b92ea56e256cc4f6b3510fb07f3f6f886594f1da 100644 (file)
Binary files a/src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk and b/src/utc/component-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk differ
index 3d3eadf4742569e9b621aa6708c01e2d99ed073d..5f39e56ef216ead78de2a125c40615ef1fa41dcb 100644 (file)
Binary files a/src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-aarch64.tpk and b/src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-aarch64.tpk differ
index f0f7a68cd5fd22bac8b1ebc7903bbe44f48159ae..c44eeaf6a9cf8469874bd50c9bbba49cf5dc319a 100644 (file)
Binary files a/src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk and b/src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk differ
index dc0c883feca88d817d40c6e02962cebca5488640..b92ea56e256cc4f6b3510fb07f3f6f886594f1da 100644 (file)
Binary files a/src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk and b/src/utc/component-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk differ
index ea588381b8d577ed0674d14c9ecba62e39f56704..b2bfafa7c699db6d5bfe9e07a86f4037f3dd9338 100644 (file)
@@ -15,7 +15,9 @@
  */
 
 #include <app_control.h>
+#include <bundle.h>
 #include <component_manager.h>
+#include <message_port.h>
 
 #include "assert.h"
 #include "tct_app_common.h"
@@ -23,6 +25,7 @@
 #include "utc_common.h"
 
 static component_context_h __component_context;
+static int __local_port_id;
 
 static bool __check_running(void *data)
 {
@@ -50,6 +53,34 @@ static bool __check_not_running(void *data)
        return false;
 }
 
+static int __send_terminate_message(void)
+{
+       bundle *message;
+       int ret;
+
+       message = bundle_create();
+       if (!message) {
+               _E("bundle_create() is failed");
+               return -1;
+       }
+
+       bundle_add_str(message, "extra", "terminate");
+       ret = message_port_send_message("org.example.componentbased",
+                       "frame-component", message);
+       if (ret < 0)
+               _E("message_port_send_message() is failed. error(%d)", ret);
+
+       bundle_free(message);
+
+       return ret;
+}
+
+static void __message_cb(int local_port_id, const char *remote_app_id,
+               const char *remote_port, bool trusted_remote_port,
+               bundle *message, void *user_data)
+{
+}
+
 void utc_component_context_is_terminated_p_startup(void)
 {
        int ret;
@@ -70,10 +101,14 @@ void utc_component_context_is_terminated_p_startup(void)
        if (ret != COMPONENT_MANAGER_ERROR_NONE)
                _E("Failed to create component context. error(%d)", ret);
 
-       ret = common_send_launch_request("org.example.componentbased",
-                       "org.example.frame-component", "terminate");
+       if (__local_port_id == 0) {
+               __local_port_id = message_port_register_local_port("NativeTCT",
+                               __message_cb, NULL);
+       }
+
+       ret = __send_terminate_message();
        if (ret < 0) {
-               _E("Failed to send launch request");
+               _E("Failed to send terminate message");
                return;
        }
 
@@ -82,6 +117,11 @@ void utc_component_context_is_terminated_p_startup(void)
 
 void utc_component_context_is_terminated_p_cleanup(void)
 {
+       if (__local_port_id != 0) {
+               message_port_unregister_local_port(__local_port_id);
+               __local_port_id = 0;
+       }
+
        component_context_destroy(__component_context);
 }