1#!/system/bin/sh
2
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
22if [ "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
36# `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
55export CLASSPATH=/system/framework/svc.jar
56exec app_process /system/bin com.android.commands.svc.Svc "$@"
57
58