diff options
author | Sunil Ravi <sunilravi@google.com> | 2019-10-25 14:27:49 -0700 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2019-10-28 05:26:40 +0000 |
commit | 18b0feceb73b1465635b0153e4cf88eb51ce4614 (patch) | |
tree | 87e92e7c32e2f3d0a1dc892c8ad520ecdab3cb41 /service | |
parent | 218c8fd51fdbf115c5cc5298f755c91d0db9f504 (diff) |
Change WIFI_FEATURE_XXX type from int to long
This change is to avoid issues in assigning signed integer
feature (WIFI_FEATURE_DPP) to long featureSet. The
assignement was resulting in large, signed integer.
Bug: 143363031
Test: atest com.android.wifi.server
Test: Wifi ON/OFF, Connect and data transfer
Test: Added logs and verified feature set saved in iface.
Change-Id: I130351037cc87a2c333282b6ba2351f081c53bc0
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/SupplicantStaIfaceHal.java | 4 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiVendorHal.java | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java index 8db806e59..0a01852ff 100644 --- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java +++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java @@ -2604,10 +2604,10 @@ public class SupplicantStaIfaceHal { * This is a v1.2+ HAL feature. * On error, or if these features are not supported, 0 is returned. */ - public int getAdvancedKeyMgmtCapabilities(@NonNull String ifaceName) { + public long getAdvancedKeyMgmtCapabilities(@NonNull String ifaceName) { final String methodStr = "getAdvancedKeyMgmtCapabilities"; - int advancedCapabilities = 0; + long advancedCapabilities = 0; int keyMgmtCapabilities = getKeyMgmtCapabilities(ifaceName); if ((keyMgmtCapabilities & android.hardware.wifi.supplicant.V1_2.ISupplicantStaNetwork diff --git a/service/java/com/android/server/wifi/WifiVendorHal.java b/service/java/com/android/server/wifi/WifiVendorHal.java index a1d98061b..ea8c7688f 100644 --- a/service/java/com/android/server/wifi/WifiVendorHal.java +++ b/service/java/com/android/server/wifi/WifiVendorHal.java @@ -1068,7 +1068,7 @@ public class WifiVendorHal { /** * Translation table used by getSupportedFeatureSet for translating IWifiChip caps for V1.1 */ - private static final int[][] sChipFeatureCapabilityTranslation = { + private static final long[][] sChipFeatureCapabilityTranslation = { {WifiManager.WIFI_FEATURE_TX_POWER_LIMIT, android.hardware.wifi.V1_1.IWifiChip.ChipCapabilityMask.SET_TX_POWER_LIMIT }, @@ -1135,7 +1135,7 @@ public class WifiVendorHal { /** * Translation table used by getSupportedFeatureSet for translating IWifiStaIface caps */ - private static final int[][] sStaFeatureCapabilityTranslation = { + private static final long[][] sStaFeatureCapabilityTranslation = { {WifiManager.WIFI_FEATURE_INFRA_5G, IWifiStaIface.StaIfaceCapabilityMask.STA_5G }, @@ -1184,8 +1184,8 @@ public class WifiVendorHal { * @return bitmask defined by WifiManager.WIFI_FEATURE_* */ @VisibleForTesting - int wifiFeatureMaskFromStaCapabilities(int capabilities) { - int features = 0; + long wifiFeatureMaskFromStaCapabilities(int capabilities) { + long features = 0; for (int i = 0; i < sStaFeatureCapabilityTranslation.length; i++) { if ((capabilities & sStaFeatureCapabilityTranslation[i][1]) != 0) { features |= sStaFeatureCapabilityTranslation[i][0]; |