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
This commit is contained in:
Wink Saville 2010-10-03 13:30:11 -07:00
parent 4cfef735d5
commit cfa0d84393
2 changed files with 6 additions and 2 deletions

View file

@ -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);
}

View file

@ -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)) {