Remove unncessary dependencies 82/305382/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 1 Feb 2024 05:07:47 +0000 (14:07 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 1 Feb 2024 05:07:47 +0000 (14:07 +0900)
The dependency of the capi-system-info library is removed from the aul library.
The dependency of the iniparser library is removed from the aul library.
Currently, the aul socket does not use socket timeout feature.
The feature will be removed after this patch is applied.

Change-Id: I444cd42ee53b2838d1f3e3ee593cd067ef2e22e4
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
CMakeLists.txt
packaging/aul.spec
src/aul/CMakeLists.txt
src/aul/aul_sock.cc
src/aul/aul_svc.cc
src/aul/aul_util.c [deleted file]
src/aul/aul_util.h
test/unit_tests/CMakeLists.txt

index 95a204c..73d8194 100644 (file)
@@ -51,7 +51,6 @@ PKG_CHECK_MODULES(DLOG_DEPS REQUIRED dlog)
 PKG_CHECK_MODULES(GIO_DEPS REQUIRED gio-2.0)
 PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
 PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock)
-PKG_CHECK_MODULES(INIPARSER_DEPS REQUIRED iniparser)
 PKG_CHECK_MODULES(LIBSMACK_DEPS REQUIRED libsmack)
 PKG_CHECK_MODULES(LIBTZPLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config)
 PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0)
index 6c82e5d..b58a72a 100644 (file)
@@ -26,7 +26,6 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gmock)
-BuildRequires:  pkgconfig(iniparser)
 BuildRequires:  pkgconfig(libsmack)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(libxml-2.0)
index 8349001..c4e8f07 100644 (file)
@@ -39,12 +39,10 @@ SET_TARGET_PROPERTIES(${TARGET_AUL} PROPERTIES VERSION ${FULLVER})
 
 APPLY_PKG_CONFIG(${TARGET_AUL} PUBLIC
   BUNDLE_DEPS
-  CAPI_SYSTEM_INFO_DEPS
   CAPI_SYSTEM_RESOURCE_DEPS
   DLOG_DEPS
   GIO_DEPS
   GLIB_DEPS
-  INIPARSER_DEPS
   LIBSMACK_DEPS
   LIBTZPLATFORM_CONFIG_DEPS
   PARCEL_DEPS
index 88007fa..a6a1ba3 100644 (file)
@@ -28,7 +28,6 @@
 #include <sys/types.h>
 #include <tzplatform_config.h>
 #include <unistd.h>
-#include <vconf.h>
 
 #include "aul/aul_api.h"
 #include "aul/aul_util.h"
@@ -44,7 +43,6 @@ namespace {
 
 constexpr const int MAX_NR_OF_DESCRIPTORS = 2;
 constexpr const int MAX_PAYLOAD_SIZE = 1024 * 1024 * 1;
-constexpr const char PATH_AUL_SOCKET_TIMEOUT[] = "/run/aul/.socket_timeout";
 constexpr const char PATH_AMD_SOCK[] = "/run/aul/daemons/.amd-sock";
 
 constexpr unsigned int SOCKET_TIMEOUT_MIN = 5000U;
@@ -61,55 +59,13 @@ class SocketTimeout {
  public:
   SocketTimeout() = default;
 
-  ~SocketTimeout() {
-    if (initialized_)
-      vconf_ignore_key_changed(VCONFKEY_AUL_SOCKET_TIMEOUT, VconfCb);
-  }
+  ~SocketTimeout() = default;
 
   timeval GetTimeval() const {
     return time_val_;
   }
 
-  bool IsInitialized() const {
-    return initialized_;
-  }
-
-  void Init() {
-    if (access(PATH_AUL_SOCKET_TIMEOUT, F_OK) != 0) {
-      initialized_ = true;
-      return;
-    }
-
-    double timeout = 5.2f;
-    int ret = vconf_get_dbl(VCONFKEY_AUL_SOCKET_TIMEOUT, &timeout);
-    if (ret != VCONF_OK)
-      _E("vconf_get_dbl() is failed. error(%d)", ret);
-
-    ret = vconf_notify_key_changed(VCONFKEY_AUL_SOCKET_TIMEOUT, VconfCb, this);
-    if (ret != VCONF_OK)
-      _E("vconf_notify_key_changed() is failed. error(%d)", ret);
-
-    SetTimeout(timeout);
-    initialized_ = true;
-  }
-
- private:
-  static void VconfCb(keynode_t* node, void* user_data) {
-    auto* h = static_cast<SocketTimeout*>(user_data);
-    double timeout = vconf_keynode_get_dbl(node);
-    h->SetTimeout(timeout);
-  }
-
-  void SetTimeout(double timeout) {
-    char buf[12];
-    snprintf(buf, sizeof(buf), "%.3f", timeout);
-    gchar* ptr = nullptr;
-    time_val_.tv_sec = g_ascii_strtoll(buf, &ptr, 10);
-    time_val_.tv_usec = g_ascii_strtoll(ptr + 1, &ptr, 10) * 1000;
-  }
-
  private:
-  bool initialized_ = false;
   timeval time_val_ = { 5, 200 * 1000 };
 };
 
@@ -433,9 +389,6 @@ extern "C" API int aul_sock_set_sock_option(int fd, int cli) {
     return ret;
 
   if (cli) {
-    if (TIZEN_FEATURE_SOCKET_TIMEOUT && !socket_timeout.IsInitialized())
-      socket_timeout.Init();
-
     auto timeout = socket_timeout.GetTimeval();
     ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
     if (ret != 0)
index 76eb24d..3089226 100644 (file)
@@ -19,7 +19,6 @@
 #include <bundle_internal.h>
 #include <dlfcn.h>
 #include <glib.h>
-#include <iniparser.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/aul/aul_util.c b/src/aul/aul_util.c
deleted file mode 100644 (file)
index 6790726..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#define _GNU_SOURCE
-#include <stdlib.h>
-#include <system_info.h>
-#include "aul_util.h"
-
-tizen_profile_t _get_tizen_profile(void)
-{
-       static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
-       char *profile_name = NULL;
-
-       if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
-               return profile;
-
-       system_info_get_platform_string("http://tizen.org/feature/profile",
-                       &profile_name);
-       if (profile_name == NULL)
-               return profile;
-
-       switch (*profile_name) {
-       case 'm':
-       case 'M':
-               profile = TIZEN_PROFILE_MOBILE;
-               break;
-       case 'w':
-       case 'W':
-               profile = TIZEN_PROFILE_WEARABLE;
-               break;
-       case 't':
-       case 'T':
-               profile = TIZEN_PROFILE_TV;
-               break;
-       case 'i':
-       case 'I':
-               profile = TIZEN_PROFILE_IVI;
-               break;
-       default: /* common or unknown ==> ALL ARE COMMON. */
-               profile = TIZEN_PROFILE_COMMON;
-               break;
-       }
-       free(profile_name);
-
-       return profile;
-}
index 9885415..d6154ef 100644 (file)
@@ -49,21 +49,6 @@ extern "C" {
 #define REGULAR_UID_MIN 5000
 #define MAX_RUNNING_INSTANCE 10000
 
-typedef enum {
-       TIZEN_PROFILE_UNKNOWN = 0,
-       TIZEN_PROFILE_MOBILE = 0x1,
-       TIZEN_PROFILE_WEARABLE = 0x2,
-       TIZEN_PROFILE_TV = 0x4,
-       TIZEN_PROFILE_IVI = 0x8,
-       TIZEN_PROFILE_COMMON = 0x10,
-} tizen_profile_t;
-
-tizen_profile_t _get_tizen_profile(void);
-
-#define TIZEN_FEATURE_SOCKET_TIMEOUT (_get_tizen_profile() & TIZEN_PROFILE_TV)
-#define TIZEN_FEATURE_SHARE_PANEL (_get_tizen_profile() & TIZEN_PROFILE_MOBILE)
-#define TIZEN_FEATURE_APPSVC_ALIAS (!(_get_tizen_profile() & TIZEN_PROFILE_TV))
-
 #ifdef __cplusplus
 }
 #endif
index d0e5e55..5c15dfd 100644 (file)
@@ -21,7 +21,6 @@ APPLY_PKG_CONFIG(${TARGET_AUL_UNIT_TESTS} PUBLIC
   DLOG_DEPS
   GIO_DEPS
   GLIB_DEPS
-  INIPARSER_DEPS
   LIBSMACK_DEPS
   LIBTZPLATFORM_CONFIG_DEPS
   LIBXML_DEPS