summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2024-02-01 14:07:47 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2024-02-01 14:07:47 +0900
commitb5e8b597a96ae3ef16192095b0d21e7c459328f8 (patch)
treefbc91b8790847ebe89aca842fddebf6d3b41b002
parent2a1bcab67b4bebe21de28a8398b8f0aa3f123082 (diff)
downloadaul-1-b5e8b597a96ae3ef16192095b0d21e7c459328f8.tar.gz
aul-1-b5e8b597a96ae3ef16192095b0d21e7c459328f8.tar.bz2
aul-1-b5e8b597a96ae3ef16192095b0d21e7c459328f8.zip
Remove unncessary dependencies
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>
-rw-r--r--CMakeLists.txt1
-rw-r--r--packaging/aul.spec1
-rw-r--r--src/aul/CMakeLists.txt2
-rw-r--r--src/aul/aul_sock.cc49
-rw-r--r--src/aul/aul_svc.cc1
-rw-r--r--src/aul/aul_util.c60
-rw-r--r--src/aul/aul_util.h15
-rw-r--r--test/unit_tests/CMakeLists.txt1
8 files changed, 1 insertions, 129 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95a204cc..73d81941 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/packaging/aul.spec b/packaging/aul.spec
index 6c82e5da..b58a72ae 100644
--- a/packaging/aul.spec
+++ b/packaging/aul.spec
@@ -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)
diff --git a/src/aul/CMakeLists.txt b/src/aul/CMakeLists.txt
index 83490013..c4e8f07b 100644
--- a/src/aul/CMakeLists.txt
+++ b/src/aul/CMakeLists.txt
@@ -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
diff --git a/src/aul/aul_sock.cc b/src/aul/aul_sock.cc
index 88007fa4..a6a1ba33 100644
--- a/src/aul/aul_sock.cc
+++ b/src/aul/aul_sock.cc
@@ -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)
diff --git a/src/aul/aul_svc.cc b/src/aul/aul_svc.cc
index 76eb24df..3089226a 100644
--- a/src/aul/aul_svc.cc
+++ b/src/aul/aul_svc.cc
@@ -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
index 67907264..00000000
--- a/src/aul/aul_util.c
+++ /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;
-}
diff --git a/src/aul/aul_util.h b/src/aul/aul_util.h
index 98854156..d6154ef6 100644
--- a/src/aul/aul_util.h
+++ b/src/aul/aul_util.h
@@ -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
diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt
index d0e5e557..5c15dfd5 100644
--- a/test/unit_tests/CMakeLists.txt
+++ b/test/unit_tests/CMakeLists.txt
@@ -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