dlog
syspopup-caller
notification
- devman
device-node
libsmack)
#define PREDEF_DEVICE_CHANGED "device_changed"
#define PREDEF_INTERNAL_POWEROFF "internal_poweroff"
+#define PROCESS_GROUP_SET "process_group_set"
+
#define OOMADJ_SU (-17)
#define OOMADJ_INIT (-16)
#define OOMADJ_FOREGRD_LOCKED (-15)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(sysman)
BuildRequires: pkgconfig(tapi)
-BuildRequires: pkgconfig(devman)
BuildRequires: pkgconfig(pmapi)
BuildRequires: pkgconfig(edbus)
BuildRequires: pkgconfig(dlog)
int bat_state = -1;
int ret = -1;
if (bInserted == 1) {
- if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &val) == 0) {
+ if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &val) < 0) {
if (val == 1)
bChargeDeviceInserted = 1;
return 0;
}
} else if (bInserted == 0) {
- if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &val) == 0) {
+ if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &val) < 0) {
if (val == 0 && bChargeDeviceInserted == 1) {
bChargeDeviceInserted = 0;
//low bat popup during charging device removing
{
int val;
PRT_TRACE("jack - earkey changed\n");
-
if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_EARKEY_ONLINE, &val) == 0)
vconf_set_int(VCONFKEY_SYSMAN_EARJACKKEY, val);
}
} else {
new_bat_state = BATTERY_NORMAL;
if (new_bat_capacity == BATTERY_FULL) {
- if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_FULL, &bat_full) < 0) {
- PRT_TRACE_ERR("fail to read charge full from kernel");
- }
+ device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_FULL, &bat_full);
if (bat_full == 1) {
if (vconf_state != VCONFKEY_SYSMAN_BAT_FULL)
ret=vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, VCONFKEY_SYSMAN_BAT_FULL);
{
int bat_percent;
- if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &bat_percent) < 0) {
- PRT_TRACE_ERR("fail to read power capacity from kernel");
- return -1;
- }
+ device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &bat_percent);
return bat_percent;
}
return -1;
}
close(fd);
-
if ( device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_PNP, new_pid) < 0) {
PRT_TRACE_ERR("Write new pid failed");
}
#include <syspopup_caller.h>
#include <sys/reboot.h>
#include <sys/time.h>
-#include <devman.h>
#include <mntent.h>
#include <sys/mount.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
+#include <device-node.h>
#include <sysman.h>
#include "include/ss_data.h"
#define LIMITED_BACKGRD_NUM 15
#define MAX_BACKGRD_OOMADJ (OOMADJ_BACKGRD_UNLOCKED + LIMITED_BACKGRD_NUM)
+#define PROCESS_VIP "process_vip"
+#define PROCESS_PERMANENT "process_permanent"
int get_app_oomadj(int pid, int *oomadj)
{
return ret;
}
+int set_process_group_action(int argc, char **argv)
+{
+ int pid = -1;
+ int ret = -1;
+
+ if (argc != 2)
+ return -1;
+ if ((pid = atoi(argv[0])) < 0)
+ return -1;
+
+ if (strncmp(argv[1], PROCESS_VIP, strlen(PROCESS_VIP)) == 0)
+ ret = device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_VIP, pid);
+ else if (strncmp(argv[1], PROCESS_PERMANENT, strlen(PROCESS_PERMANENT)) == 0)
+ ret = device_set_property(DEVICE_TYPE_PROCESS, PROP_PROCESS_MP_PNP, pid);
+
+ if (ret == 0)
+ PRT_TRACE_ERR("%s : pid %d", argv[1], pid);
+ else
+ PRT_TRACE_ERR("fail to set %s : pid %d",argv[1], pid);
+ return 0;
+}
+
int ss_process_manager_init(void)
{
ss_action_entry_add_internal(PREDEF_FOREGRD, set_foregrd_action, NULL,
ss_action_entry_add_internal(PREDEF_INACTIVE, set_inactive_action, NULL,
NULL);
ss_action_entry_add_internal(OOMADJ_SET, set_oomadj_action, NULL, NULL);
+ ss_action_entry_add_internal(PROCESS_GROUP_SET, set_process_group_action, NULL, NULL);
return 0;
}