blob: a2c9de32b3d0648a6739b5f7a829e24bb015c52a [file] [log] [blame]
George Burgess IV6c168882017-11-04 15:58:58 -07001#!/system/bin/sh
David Su9e365a62019-10-25 14:28:32 -07002
3# `svc wifi` has been migrated to WifiShellCommand,
4# simply perform translation to `cmd wifi set-wifi-enabled` here.
5if [ "x$1" == "xwifi" ]; then
6 # `cmd wifi` by convention uses enabled/disabled
7 # instead of enable/disable
8 if [ "x$2" == "xenable" ]; then
9 exec cmd wifi set-wifi-enabled enabled
10 elif [ "x$2" == "xdisable" ]; then
11 exec cmd wifi set-wifi-enabled disabled
12 else
13 echo "Control the Wi-Fi manager"
14 echo ""
15 echo "usage: svc wifi [enable|disable]"
16 echo " Turn Wi-Fi on or off."
17 echo ""
18 fi
19 exit 1
20fi
21
Shuo Qian0de373a2019-12-20 14:50:05 -080022if [ "x$1" == "xdata" ]; then
23 if [ "x$2" == "xenable" ]; then
24 exec cmd phone data enable
25 elif [ "x$2" == "xdisable" ]; then
26 exec cmd phone data disable
27 else
28 echo "Enable/Disable Mobile Data Connectivity"
29 echo ""
30 echo "usage: svc data [enable|disable]"
31 echo ""
32 fi
33 exit 1
34fi
35
William Escandea9569662022-02-23 15:41:38 +010036# `svc bluetooth` has been migrated to BluetoothShellCommand,
37# simply perform translation to `cmd bluetooth set-bluetooth-enabled` here.
38if [ "x$1" == "xbluetooth" ]; then
39 # `cmd wifi` by convention uses enabled/disabled
40 # instead of enable/disable
41 if [ "x$2" == "xenable" ]; then
42 exec cmd bluetooth_manager enable
43 elif [ "x$2" == "xdisable" ]; then
44 exec cmd bluetooth_manager disable
45 else
46 echo "Control the Bluetooth manager"
47 echo ""
48 echo "usage: svc bluetooth [enable|disable]"
49 echo " Turn Bluetooth on or off."
50 echo ""
51 fi
52 exit 1
53fi
54
Elliott Hughes5a03b692019-05-09 22:01:14 -070055export CLASSPATH=/system/framework/svc.jar
56exec app_process /system/bin com.android.commands.svc.Svc "$@"
David Su9e365a62019-10-25 14:28:32 -070057