diff options
author | Hai Shalom <haishalom@google.com> | 2019-04-01 16:34:38 -0700 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2019-04-01 16:34:38 -0700 |
commit | 88c106453369d39e73207673458d1142d521abde (patch) | |
tree | 864199b434b012365060418eea221000d896aabd /service | |
parent | bf7988d06f74cbd59a5365432b1dd0a1773597ca (diff) |
[WifiNative] Add missing sync in new getSupportedFeatureSet API
Add missing sync in new getSupportedFeatureSet API.
atest WifiNativeInterfaceManagementTest
Test: atest com.android.server.wifi
Bug: 129550653
Change-Id: I0a81dda2c00cff62e886aefb123d9edfedbfebdd
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiNative.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java index 550fc5a31..3e5dc3c79 100644 --- a/service/java/com/android/server/wifi/WifiNative.java +++ b/service/java/com/android/server/wifi/WifiNative.java @@ -2626,14 +2626,15 @@ public class WifiNative { * @return bitmask defined by WifiManager.WIFI_FEATURE_* */ public long getSupportedFeatureSet(@NonNull String ifaceName) { - Iface iface = mIfaceMgr.getIface(ifaceName); + synchronized (mLock) { + Iface iface = mIfaceMgr.getIface(ifaceName); + if (iface == null) { + Log.e(TAG, "Could not get Iface object for interface " + ifaceName); + return 0; + } - if (iface == null) { - Log.e(TAG, "Could not get Iface object for interface " + ifaceName); - return 0; + return iface.featureSet; } - - return iface.featureSet; } /** |