summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2018-02-28 15:34:02 +0900
committerlokilee73 <changjoo.lee@samsung.com>2018-02-28 16:27:26 +0900
commitf0696d6bf5a3ed911b7e5790d8ab8e986178f752 (patch)
tree25f38b79d0843c1ba99a1bdbc227d020024d5030
parentb1408e55ceb693acab3b806b373b1ced6110c9d1 (diff)
downloaddeviced-f0696d6bf5a3ed911b7e5790d8ab8e986178f752.tar.gz
deviced-f0696d6bf5a3ed911b7e5790d8ab8e986178f752.tar.bz2
deviced-f0696d6bf5a3ed911b7e5790d8ab8e986178f752.zip
Remove deviced_conf_set_mempolicy_bypid and deviced_conf_set_mempolicy.
Because those functions are moved to resourced Change-Id: Ifaa91fda36a7fd2994147e425dbc62843246a71a Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rwxr-xr-x[-rw-r--r--]src/deviced/dd-deviced.h26
-rwxr-xr-x[-rw-r--r--]src/libdeviced/CMakeLists.txt1
-rw-r--r--src/libdeviced/deviced-conf.c104
3 files changed, 0 insertions, 131 deletions
diff --git a/src/deviced/dd-deviced.h b/src/deviced/dd-deviced.h
index 7bb3a635..e9d3f98d 100644..100755
--- a/src/deviced/dd-deviced.h
+++ b/src/deviced/dd-deviced.h
@@ -95,32 +95,6 @@ int deviced_get_apppath(pid_t pid, char *app_path, size_t app_path_size);
/* sysconf */
/**
- * @fn int deviced_conf_set_mempolicy(enum mem_policy mempol)
- * @brief This API is used to set the policy of the current process when the phone has low available memory.
- * @param[in] mempol oom adjust value which you want to set
- * @return 0 on success, -1 if failed.
- * @see deviced_conf_set_mempolicy_bypid()
- * @retval -1 operation error
- * @retval -EBADMSG - dbus error (in case of any error on the bus)
- * @retval -EINVAL no mandatory parameters
- * @retval -ESRCH incorrect sender process id
- */
-int deviced_conf_set_mempolicy(enum mem_policy mempol);
-
-/**
- * @fn int deviced_conf_set_mempolicy_bypid(pid_t pid, enum mem_policy mempol)
- * @brief This API is used to set the policy of the given process when the phone has low available memory.
- * @param[in] pid process id which you want to set
- * @param[in] mempol oom adjust value which you want to set
- * @return 0 on success, -1 if failed.
- * @retval -1 operation error
- * @retval -EBADMSG - dbus error (in case of any error on the bus)
- * @retval -EINVAL no mandatory parameters
- * @retval -ESRCH incorrect sender process id
- */
-int deviced_conf_set_mempolicy_bypid(pid_t pid, enum mem_policy mempol);
-
-/**
* @fn int deviced_set_timezone(char *tzpath_str)
* @brief This API sets system timezone.
* @param[in] tzpath_str path to timezone definition file
diff --git a/src/libdeviced/CMakeLists.txt b/src/libdeviced/CMakeLists.txt
index 8bc9e5c6..55a60c5a 100644..100755
--- a/src/libdeviced/CMakeLists.txt
+++ b/src/libdeviced/CMakeLists.txt
@@ -9,7 +9,6 @@ SET(LIBDEVICED_SRCS
mmc.c
storage.c
usbhost.c
- deviced-conf.c
deviced-noti.c
deviced-util.c
)
diff --git a/src/libdeviced/deviced-conf.c b/src/libdeviced/deviced-conf.c
deleted file mode 100644
index d6e8bc51..00000000
--- a/src/libdeviced/deviced-conf.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <errno.h>
-
-#include "log.h"
-#include "deviced-priv.h"
-#include "dd-deviced.h"
-#include "dbus.h"
-#include "score-defines.h"
-
-#define PERMANENT_DIR "/tmp/permanent"
-#define VIP_DIR "/tmp/vip"
-
-#define OOMADJ_SET "oomadj_set"
-#define PROCESS_GROUP_SET "process_group_set"
-#define PROCESS_VIP "process_vip"
-#define PROCESS_PERMANENT "process_permanent"
-
-enum mp_entry_type {
- MP_VIP,
- MP_PERMANENT,
- MP_NONE
-};
-
-int util_oomadj_set(int pid, int oomadj_val)
-{
- GVariant *msg;
- char buf1[SYSTEM_NOTI_MAXARG];
- char buf2[SYSTEM_NOTI_MAXARG];
- int val;
-
- snprintf(buf1, sizeof(buf1), "%d", pid);
- snprintf(buf2, sizeof(buf2), "%d", oomadj_val);
-
- msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
- DEVICED_PATH_PROCESS,
- DEVICED_INTERFACE_PROCESS,
- OOMADJ_SET,
- g_variant_new("(siss)", OOMADJ_SET, 2, buf1, buf2));
- if (!msg)
- return -EBADMSG;
-
- if (!dh_get_param_from_var(msg, "(i)", &val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
- val = -EBADMSG;
- goto out;
- }
-
- _D("%s-%s : %d", DEVICED_INTERFACE_PROCESS, OOMADJ_SET, val);
-
-out:
- g_variant_unref(msg);
- return val;
-}
-
-API int deviced_conf_set_mempolicy_bypid(int pid, enum mem_policy mempol)
-{
- if (pid < 1)
- return -1;
-
- int oomadj_val = 0;
-
- switch (mempol) {
- case OOM_LIKELY:
- oomadj_val = OOMADJ_BACKGRD_UNLOCKED;
- break;
- case OOM_IGNORE:
- oomadj_val = OOMADJ_SU;
- break;
- default:
- return -1;
- }
-
- return util_oomadj_set(pid, oomadj_val);
-}
-
-API int deviced_conf_set_mempolicy(enum mem_policy mempol)
-{
- return deviced_conf_set_mempolicy_bypid(getpid(), mempol);
-}