summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2012-11-25 16:14:19 +0530
committerRoman Birg <roman@cyngn.com>2015-10-30 16:08:23 -0700
commitca3ec94baf63e78a551c8f9d441993a79229498e (patch)
tree03661086396b9804765e4a748c6107b1b3f2a5fa /toolbox
parentee3533d78501b868a10c58f029c30db57e409c83 (diff)
downloadsystem_core-ca3ec94baf63e78a551c8f9d441993a79229498e.zip
system_core-ca3ec94baf63e78a551c8f9d441993a79229498e.tar.gz
system_core-ca3ec94baf63e78a551c8f9d441993a79229498e.tar.bz2
toolbox: new applet restart
- stop + start - for the lazy. Change-Id: Ie0ef0e27f5b7819a5575ece6b82c5813f4e38420
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/Android.mk1
-rw-r--r--toolbox/restart.c27
2 files changed, 28 insertions, 0 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index ad99a39..7a0ea10 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -53,6 +53,7 @@ OUR_TOOLS := \
ps \
prlimit \
renice \
+ restart \
sendevent \
start \
stop \
diff --git a/toolbox/restart.c b/toolbox/restart.c
new file mode 100644
index 0000000..9d803de
--- /dev/null
+++ b/toolbox/restart.c
@@ -0,0 +1,27 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <cutils/properties.h>
+
+int restart_main(int argc, char *argv[])
+{
+ char buf[1024];
+
+ if(argc > 1) {
+ property_set("ctl.stop", argv[1]);
+ property_set("ctl.start", argv[1]);
+ } else {
+ /* defaults to stopping and starting the common services */
+ property_set("ctl.stop", "zygote_secondary");
+ property_set("ctl.stop", "zygote");
+ property_set("ctl.stop", "surfaceflinger");
+ property_set("ctl.stop", "netd");
+ property_set("ctl.start", "netd");
+ property_set("ctl.start", "surfaceflinger");
+ property_set("ctl.start", "zygote");
+ property_set("ctl.start", "zygote_secondary");
+ }
+
+ return 0;
+}