Merge "Add null check for Wi-Fi command" am: 43ee2ac140
am: 51e24de109
Change-Id: I9c79eadbf827f9f8cb17c69e704c25e5225c2bc5
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user