From cfa0d8439384a1aaa53d31fb720c234cabf796ee Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Sun, 3 Oct 2010 13:30:11 -0700 Subject: [PATCH] Allow AID_RADIO to restart the ril-daemon. This enhances robustness by allowing the Telephony Framework to restart ril-daemon if it notices some catastrophic failure. Added setprop ctl.restart. Added ril-daemon to setprop control_perms and allow users/groups with the AID_RADIO ID to control it. Change-Id: I195abdd754a731ce0b77e8f71ab47fde8c3e7977 --- init/init.c | 3 +++ init/property_service.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/init/init.c b/init/init.c index 709cc4016..cd129c3e0 100755 --- a/init/init.c +++ b/init/init.c @@ -384,6 +384,9 @@ void handle_control_message(const char *msg, const char *arg) msg_start(arg); } else if (!strcmp(msg,"stop")) { msg_stop(arg); + } else if (!strcmp(msg,"restart")) { + msg_stop(arg); + msg_start(arg); } else { ERROR("unknown control msg '%s'\n", msg); } diff --git a/init/property_service.c b/init/property_service.c index d8fea56e0..788252b58 100644 --- a/init/property_service.c +++ b/init/property_service.c @@ -95,6 +95,7 @@ struct { unsigned int gid; } control_perms[] = { { "dumpstate",AID_SHELL, AID_LOG }, + { "ril-daemon",AID_RADIO, AID_RADIO }, {NULL, 0, 0 } }; @@ -397,8 +398,8 @@ void handle_property_set_fd() if (check_control_perms(msg.value, cr.uid, cr.gid)) { handle_control_message((char*) msg.name + 4, (char*) msg.value); } else { - ERROR("sys_prop: Unable to %s service ctl [%s] uid: %d pid:%d\n", - msg.name + 4, msg.value, cr.uid, cr.pid); + ERROR("sys_prop: Unable to %s service ctl [%s] uid:%d gid:%d pid:%d\n", + msg.name + 4, msg.value, cr.uid, cr.gid, cr.pid); } } else { if (check_perms(msg.name, cr.uid, cr.gid)) {