platform_system_core/toolbox/stop.c
Sreeram Ramachandran 435fe9bb02 Stop and start netd explicitly for "adb shell stop/start". DO NOT MERGE
netd is supposed to be restarted when the zygote is restarted (see the
"onrestart" section for "service zygote" in init.zygote*.rc). But this
only works if you send a restart command (say via "ctl.restart").

"stop && start" != "restart". It seems ingrained in developers to do
"stop && start", so we don't have much hope of convincing everyone to
switch to "adb shell restart", even if we did add such a toolbox command.

(cherry picked from commit 018c6a57f3)

Bug: 15855807
Change-Id: I387fe86600f4a2862abc3a05a2ef9a1e7374e21d
2014-07-22 22:43:42 +00:00

19 lines
456 B
C

#include <stdio.h>
#include <string.h>
#include <cutils/properties.h>
int stop_main(int argc, char *argv[])
{
if(argc > 1) {
property_set("ctl.stop", argv[1]);
} else{
/* defaults to stopping the common services */
property_set("ctl.stop", "zygote_secondary");
property_set("ctl.stop", "zygote");
property_set("ctl.stop", "surfaceflinger");
property_set("ctl.stop", "netd");
}
return 0;
}