diff options
author | Roshan Pius <rpius@google.com> | 2018-02-15 15:52:40 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2018-03-07 10:00:22 -0800 |
commit | 4d2109e282e5ff427c64788dae814baccb542fae (patch) | |
tree | 6404adadad4b3cb2af1cadc137379efdf1b8ffc2 /service | |
parent | 271fee2404caf4ef62a0ec17afbab24cfa0a895e (diff) |
WificondControl: Always check for existing ifaces
Couple of methods in WificondControl are missing checks to ensure
if the iface specified exists or not. Adding them.
Bug: 73496702
Test: Unit tests
Test: Ran WifiManagerTest & WifiSoftApTest ACTS tests locally.
Change-Id: Ib1f49af3ba5bba4d8dc8b9ca07a1a3ee727b529e
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WificondControl.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WificondControl.java b/service/java/com/android/server/wifi/WificondControl.java index faee2f286..a0953e439 100644 --- a/service/java/com/android/server/wifi/WificondControl.java +++ b/service/java/com/android/server/wifi/WificondControl.java @@ -275,7 +275,10 @@ public class WificondControl implements IBinder.DeathRecipient { * @return Returns true on success. */ public boolean tearDownClientInterface(@NonNull String ifaceName) { - boolean success; + if (getClientInterface(ifaceName) == null) { + Log.e(TAG, "No valid wificond client interface handler"); + return false; + } try { IWifiScannerImpl scannerImpl = mWificondScanners.get(ifaceName); if (scannerImpl != null) { @@ -287,6 +290,7 @@ public class WificondControl implements IBinder.DeathRecipient { return false; } + boolean success; try { success = mWificond.tearDownClientInterface(ifaceName); } catch (RemoteException e1) { @@ -341,6 +345,10 @@ public class WificondControl implements IBinder.DeathRecipient { * @return Returns true on success. */ public boolean tearDownSoftApInterface(@NonNull String ifaceName) { + if (getApInterface(ifaceName) == null) { + Log.e(TAG, "No valid wificond ap interface handler"); + return false; + } boolean success; try { success = mWificond.tearDownApInterface(ifaceName); |