George Burgess IV | 6c16888 | 2017-11-04 15:58:58 -0700 | [diff] [blame] | 1 | #!/system/bin/sh |
David Su | 9e365a6 | 2019-10-25 14:28:32 -0700 | [diff] [blame] | 2 | |
| 3 | # `svc wifi` has been migrated to WifiShellCommand, |
| 4 | # simply perform translation to `cmd wifi set-wifi-enabled` here. |
| 5 | if [ "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 |
| 20 | fi |
| 21 | |
Shuo Qian | 0de373a | 2019-12-20 14:50:05 -0800 | [diff] [blame] | 22 | if [ "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 |
| 34 | fi |
| 35 | |
William Escande | a956966 | 2022-02-23 15:41:38 +0100 | [diff] [blame] | 36 | # `svc bluetooth` has been migrated to BluetoothShellCommand, |
| 37 | # simply perform translation to `cmd bluetooth set-bluetooth-enabled` here. |
| 38 | if [ "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 |
| 53 | fi |
| 54 | |
Elliott Hughes | 5a03b69 | 2019-05-09 22:01:14 -0700 | [diff] [blame] | 55 | export CLASSPATH=/system/framework/svc.jar |
| 56 | exec app_process /system/bin com.android.commands.svc.Svc "$@" |
David Su | 9e365a6 | 2019-10-25 14:28:32 -0700 | [diff] [blame] | 57 | |