diff options
| -rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 6bf7bfb9b4a1..a37de00ce7de 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -52,12 +52,14 @@ import android.os.Messenger; import android.os.RemoteException; import android.os.ServiceManager; import android.os.WorkSource; +import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.util.SparseArray; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.util.ArrayUtils; import com.android.internal.util.AsyncChannel; import com.android.internal.util.Protocol; import com.android.server.net.NetworkPinner; @@ -1821,6 +1823,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (config == null) return; throw new RemoteException("Wifi service is not running"); } if (!iWifiManager.addOrUpdatePasspointConfiguration( @@ -1849,6 +1852,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (TextUtils.isEmpty(fqdn)) return; throw new RemoteException("Wifi service is not running"); } if (!iWifiManager.removePasspointConfiguration( @@ -1899,6 +1903,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (bssid == 0L || TextUtils.isEmpty(fileName)) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.queryPasspointIcon(bssid, fileName); @@ -1928,6 +1933,8 @@ public class WifiManager { * @param holdoff hold off time in milliseconds * @param ess set if the hold off pertains to an ESS rather than a BSS * @hide + * + * TODO (140167680): This needs to be removed, the implementation is empty! */ public void deauthenticateNetwork(long holdoff, boolean ess) { try { @@ -2504,6 +2511,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (TextUtils.isEmpty(country)) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.setCountryCode(country); @@ -2692,6 +2700,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (TextUtils.isEmpty(ifaceName) || mode == IFACE_IP_MODE_UNSPECIFIED) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.updateInterfaceIpState(ifaceName, mode); @@ -3044,6 +3053,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (remoteIPAddress == null || !enable) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.enableTdls(remoteIPAddress.getHostAddress(), enable); @@ -3062,6 +3072,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (TextUtils.isEmpty(remoteMacAddress) || !enable) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.enableTdlsWithMacAddress(remoteMacAddress, enable); @@ -3956,7 +3967,7 @@ public class WifiManager { android.Manifest.permission.NETWORK_STACK }) public void disableEphemeralNetwork(String SSID) { - if (SSID == null) throw new IllegalArgumentException("SSID cannot be null"); + if (TextUtils.isEmpty(SSID)) throw new IllegalArgumentException("SSID cannot be null"); try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { @@ -4495,6 +4506,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (verbose == 0) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.enableVerboseLogging(verbose); @@ -4581,6 +4593,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (enabled) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.enableWifiConnectivityManager(enabled); @@ -4611,6 +4624,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (ArrayUtils.isEmpty(data)) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.restoreBackupData(data); @@ -4631,6 +4645,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (ArrayUtils.isEmpty(supplicantData) && ArrayUtils.isEmpty(ipConfigData)) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.restoreSupplicantBackupData(supplicantData, ipConfigData); @@ -4937,6 +4952,7 @@ public class WifiManager { try { IWifiManager iWifiManager = getIWifiManager(); if (iWifiManager == null) { + if (state == DEVICE_MOBILITY_STATE_UNKNOWN) return; throw new RemoteException("Wifi service is not running"); } iWifiManager.setDeviceMobilityState(state); |