Modify aul_notify_start function 83/317683/2
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 6 Jan 2025 23:33:16 +0000 (08:33 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Mon, 13 Jan 2025 06:41:18 +0000 (06:41 +0000)
The function sends the request with the ID to amd.
amd checks the request ID while registering the process if the caller is
not registered.

Change-Id: I0255fdc13f9ec1244bf53265880296107159efd6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul/status.cc
test/unit_tests/test_status.cc

index 4d419d0cd84cbe682e50bea4162c07ef4fa62be0..88983b30ce93d0d2f40c965f5e24e6ed31c51392 100644 (file)
@@ -338,8 +338,13 @@ extern "C" API int aul_notify_exit(void) {
 }
 
 extern "C" API int aul_notify_start(void) {
+  const char* req_id = getenv("AUL_REQUEST_ID");
+  tizen_base::Bundle b {
+    { AUL_K_REQUEST_ID, std::string(req_id ? req_id : "0") },
+  };
   return AppRequest(APP_NOTIFY_START, getuid())
-      .SendCmdOnly(AUL_SOCK_NOREPLY);
+      .With(std::move(b))
+      .SendSimply(AUL_SOCK_NOREPLY);
 }
 
 extern "C" API const char* aul_app_status_convert_to_string(int status) {
index 75ba2642d52d84605742aca0c253726614ed60cb..562d16215e9681d7a8d28f7bc1dd01c9117d1d82 100644 (file)
@@ -317,7 +317,7 @@ TEST_F(StatusTest, aul_notify_start_P) {
   int ret = aul_notify_start();
   EXPECT_EQ(ret, AUL_R_OK);
   EXPECT_EQ(cmd, APP_NOTIFY_START);
-  EXPECT_EQ(opt, AUL_SOCK_NOREPLY);
+  EXPECT_EQ(opt, AUL_SOCK_BUNDLE | AUL_SOCK_NOREPLY);
 }
 
 TEST_F(StatusTest, aul_app_status_convert_to_string_P) {