Revert "Revert "Remove deviced_conf_set_mempolicy_bypid and deviced_conf_set_mempolicy."" 82/171882/1 accepted/tizen/unified/20180308.070205 submit/tizen/20180308.024030
authorHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 8 Mar 2018 02:42:57 +0000 (11:42 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 8 Mar 2018 02:43:03 +0000 (11:43 +0900)
This reverts commit 932451c3313518a0033aa9169ee9df54ecee56b9.

Change-Id: Ibc79de3bccdf864037914486d0f11f59f5693a19
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/deviced/dd-deviced.h [changed mode: 0644->0755]
src/libdeviced/CMakeLists.txt [changed mode: 0644->0755]
src/libdeviced/deviced-conf.c [deleted file]

old mode 100644 (file)
new mode 100755 (executable)
index 7bb3a63..e9d3f98
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 8bc9e5c..55a60c5
@@ -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 (file)
index d6e8bc5..0000000
+++ /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);
-}