From 435fe9bb02f250c5bc617462d82f718b67207774 Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Sat, 19 Jul 2014 00:47:59 -0700 Subject: [PATCH] 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 018c6a57f3ba41b46deb8dc5fe542765e5b78791) Bug: 15855807 Change-Id: I387fe86600f4a2862abc3a05a2ef9a1e7374e21d --- toolbox/start.c | 1 + toolbox/stop.c | 1 + 2 files changed, 2 insertions(+) diff --git a/toolbox/start.c b/toolbox/start.c index 0941e64f4..6c8a3f2b0 100644 --- a/toolbox/start.c +++ b/toolbox/start.c @@ -11,6 +11,7 @@ int start_main(int argc, char *argv[]) property_set("ctl.start", argv[1]); } else { /* defaults to starting the common services stopped by stop.c */ + property_set("ctl.start", "netd"); property_set("ctl.start", "surfaceflinger"); property_set("ctl.start", "zygote"); property_set("ctl.start", "zygote_secondary"); diff --git a/toolbox/stop.c b/toolbox/stop.c index ed9a29333..5e3ce3c8c 100644 --- a/toolbox/stop.c +++ b/toolbox/stop.c @@ -12,6 +12,7 @@ int stop_main(int argc, char *argv[]) property_set("ctl.stop", "zygote_secondary"); property_set("ctl.stop", "zygote"); property_set("ctl.stop", "surfaceflinger"); + property_set("ctl.stop", "netd"); } return 0;