Shuo Qian 0de373a192 Forward svc data to "cmd phone data" in TelephonyShellCommand
Bug: 145553588
Test: adb shell commands; manual
Change-Id: I687635ff78439dd446df538312c4811ef8073ea3
2019-12-20 16:54:12 -08:00

39 lines
1.0 KiB
Bash
Executable File

#!/system/bin/sh
# `svc wifi` has been migrated to WifiShellCommand,
# simply perform translation to `cmd wifi set-wifi-enabled` here.
if [ "x$1" == "xwifi" ]; then
# `cmd wifi` by convention uses enabled/disabled
# instead of enable/disable
if [ "x$2" == "xenable" ]; then
exec cmd wifi set-wifi-enabled enabled
elif [ "x$2" == "xdisable" ]; then
exec cmd wifi set-wifi-enabled disabled
else
echo "Control the Wi-Fi manager"
echo ""
echo "usage: svc wifi [enable|disable]"
echo " Turn Wi-Fi on or off."
echo ""
fi
exit 1
fi
if [ "x$1" == "xdata" ]; then
if [ "x$2" == "xenable" ]; then
exec cmd phone data enable
elif [ "x$2" == "xdisable" ]; then
exec cmd phone data disable
else
echo "Enable/Disable Mobile Data Connectivity"
echo ""
echo "usage: svc data [enable|disable]"
echo ""
fi
exit 1
fi
export CLASSPATH=/system/framework/svc.jar
exec app_process /system/bin com.android.commands.svc.Svc "$@"