Merge "Add null check for Wi-Fi command"

am: 43ee2ac140

Change-Id: Ideddbcd85dc15012f405138c358f3dd8c516eef5
This commit is contained in:
Takashi Furukawa
2017-08-08 18:14:53 +00:00
committed by android-build-merger

View File

@@ -51,6 +51,10 @@ public class WifiCommand extends Svc.Command {
if (validCommand) {
IWifiManager wifiMgr
= IWifiManager.Stub.asInterface(ServiceManager.getService(Context.WIFI_SERVICE));
if (wifiMgr == null) {
System.err.println("Wi-Fi service is not ready");
return;
}
try {
wifiMgr.setWifiEnabled("com.android.shell", flag);
}