| | | |
Offset 68, 14 lines modified | Offset 68, 15 lines modified |
68 | ····public·static·final·int·WIFI_SCAN_RESULTS_AVAILABLE·=·0; | 68 | ····public·static·final·int·WIFI_SCAN_RESULTS_AVAILABLE·=·0; |
69 | ····public·static·final·int·WIFI_SCAN_THRESHOLD_NUM_SCANS·=·1; | 69 | ····public·static·final·int·WIFI_SCAN_THRESHOLD_NUM_SCANS·=·1; |
70 | ····public·static·final·int·WIFI_SCAN_THRESHOLD_PERCENT·=·2; | 70 | ····public·static·final·int·WIFI_SCAN_THRESHOLD_PERCENT·=·2; |
71 | ····private·final·Handler·mHandler; | 71 | ····private·final·Handler·mHandler; |
72 | ····private·final·HostapdHal·mHostapdHal; | 72 | ····private·final·HostapdHal·mHostapdHal; |
73 | ····private·final·WifiNative$IfaceManager·mIfaceMgr; | 73 | ····private·final·WifiNative$IfaceManager·mIfaceMgr; |
74 | ····private·boolean·mIsEnhancedOpenSupported; | 74 | ····private·boolean·mIsEnhancedOpenSupported; |
| 75 | ····private·boolean·mIsEnhancedOpenSupportedInitialized; |
75 | ····private·final·Object·mLock; | 76 | ····private·final·Object·mLock; |
76 | ····private·NetdWrapper·mNetdWrapper; | 77 | ····private·NetdWrapper·mNetdWrapper; |
77 | ····private·final·PropertyService·mPropertyService; | 78 | ····private·final·PropertyService·mPropertyService; |
78 | ····private·final·Random·mRandom; | 79 | ····private·final·Random·mRandom; |
79 | ····private·HashSet·mStatusListeners; | 80 | ····private·HashSet·mStatusListeners; |
80 | ····private·final·SupplicantStaIfaceHal·mSupplicantStaIfaceHal; | 81 | ····private·final·SupplicantStaIfaceHal·mSupplicantStaIfaceHal; |
81 | ····private·boolean·mVerboseLoggingEnabled; | 82 | ····private·boolean·mVerboseLoggingEnabled; |
Offset 83, 18 lines modified | Offset 84, 18 lines modified |
83 | ····private·final·WifiInjector·mWifiInjector; | 84 | ····private·final·WifiInjector·mWifiInjector; |
84 | ····private·final·WifiMetrics·mWifiMetrics; | 85 | ····private·final·WifiMetrics·mWifiMetrics; |
85 | ····private·final·WifiMonitor·mWifiMonitor; | 86 | ····private·final·WifiMonitor·mWifiMonitor; |
86 | ····private·final·WifiVendorHal·mWifiVendorHal; | 87 | ····private·final·WifiVendorHal·mWifiVendorHal; |
87 | ···· | 88 | ···· |
88 | ····public·WifiNative(final·WifiVendorHal·mWifiVendorHal,·final·SupplicantStaIfaceHal·mSupplicantStaIfaceHal,·final·HostapdHal·mHostapdHal,·final·WifiNl80211Manager·mWifiCondManager,·final·WifiMonitor·mWifiMonitor,·final·PropertyService·mPropertyService,·final·WifiMetrics·mWifiMetrics,·final·Handler·mHandler,·final·Random·mRandom,·final·WifiInjector·mWifiInjector)·{ | 89 | ····public·WifiNative(final·WifiVendorHal·mWifiVendorHal,·final·SupplicantStaIfaceHal·mSupplicantStaIfaceHal,·final·HostapdHal·mHostapdHal,·final·WifiNl80211Manager·mWifiCondManager,·final·WifiMonitor·mWifiMonitor,·final·PropertyService·mPropertyService,·final·WifiMetrics·mWifiMetrics,·final·Handler·mHandler,·final·Random·mRandom,·final·WifiInjector·mWifiInjector)·{ |
89 | ········this.mVerboseLoggingEnabled·=·false; | 90 | ········this.mVerboseLoggingEnabled·=·false; |
90 | ········this.mIsEnhancedOpenSupported·=·false; | |
91 | ········this.mLock·=·new·Object(); | 91 | ········this.mLock·=·new·Object(); |
92 | ········this.mIfaceMgr·=·new·WifiNative$IfaceManager((WifiNative$1)null); | 92 | ········this.mIfaceMgr·=·new·WifiNative$IfaceManager((WifiNative$1)null); |
93 | ········this.mStatusListeners·=·new·HashSet(); | 93 | ········this.mStatusListeners·=·new·HashSet(); |
| 94 | ········this.mIsEnhancedOpenSupportedInitialized·=·false; |
94 | ········this.mWifiVendorHal·=·mWifiVendorHal; | 95 | ········this.mWifiVendorHal·=·mWifiVendorHal; |
95 | ········this.mSupplicantStaIfaceHal·=·mSupplicantStaIfaceHal; | 96 | ········this.mSupplicantStaIfaceHal·=·mSupplicantStaIfaceHal; |
96 | ········this.mHostapdHal·=·mHostapdHal; | 97 | ········this.mHostapdHal·=·mHostapdHal; |
97 | ········this.mWifiCondManager·=·mWifiCondManager; | 98 | ········this.mWifiCondManager·=·mWifiCondManager; |
98 | ········this.mWifiMonitor·=·mWifiMonitor; | 99 | ········this.mWifiMonitor·=·mWifiMonitor; |
99 | ········this.mPropertyService·=·mPropertyService; | 100 | ········this.mPropertyService·=·mPropertyService; |
100 | ········this.mWifiMetrics·=·mWifiMetrics; | 101 | ········this.mWifiMetrics·=·mWifiMetrics; |
Offset 137, 15 lines modified | Offset 138, 15 lines modified |
137 | ················sb.append(fromByteArray); | 138 | ················sb.append(fromByteArray); |
138 | ················Log.e((String)e,·sb.toString()); | 139 | ················Log.e((String)e,·sb.toString()); |
139 | ············} | 140 | ············} |
140 | ············else·{ | 141 | ············else·{ |
141 | ················Object·string·=·bssid.toString(); | 142 | ················Object·string·=·bssid.toString(); |
142 | ················final·ScanResult$InformationElement[]·informationElements·=·InformationElementUtil.parseInformationElements(nativeScanResult.getInformationElements()); | 143 | ················final·ScanResult$InformationElement[]·informationElements·=·InformationElementUtil.parseInformationElements(nativeScanResult.getInformationElements()); |
143 | ················final·InformationElementUtil$Capabilities·informationElementUtil$Capabilities·=·new·InformationElementUtil$Capabilities(); | 144 | ················final·InformationElementUtil$Capabilities·informationElementUtil$Capabilities·=·new·InformationElementUtil$Capabilities(); |
144 | ················informationElementUtil$Capabilities.from(informationElements,·nativeScanResult.getCapabilities(),·this.mIsEnhancedOpenSupported); | 145 | ················informationElementUtil$Capabilities.from(informationElements,·nativeScanResult.getCapabilities(),·this.isEnhancedOpenSupported()); |
145 | ················final·String·generateCapabilitiesString·=·informationElementUtil$Capabilities.generateCapabilitiesString(); | 146 | ················final·String·generateCapabilitiesString·=·informationElementUtil$Capabilities.generateCapabilitiesString(); |
146 | ················try·{ | 147 | ················try·{ |
147 | ····················final·NetworkDetail·networkDetail·=·new·NetworkDetail((String)string,·informationElements,·(List)null,·nativeScanResult.getFrequencyMhz()); | 148 | ····················final·NetworkDetail·networkDetail·=·new·NetworkDetail((String)string,·informationElements,·(List)null,·nativeScanResult.getFrequencyMhz()); |
148 | ····················e·=·new·ScanDetail(networkDetail,·fromByteArray,·(String)string,·generateCapabilitiesString,·nativeScanResult.getSignalMbm()·/·100,·nativeScanResult.getFrequencyMhz(),·nativeScanResult.getTsf(),·informationElements,·(List)null,·nativeScanResult.getInformationElements()); | 149 | ····················e·=·new·ScanDetail(networkDetail,·fromByteArray,·(String)string,·generateCapabilitiesString,·nativeScanResult.getSignalMbm()·/·100,·nativeScanResult.getFrequencyMhz(),·nativeScanResult.getTsf(),·informationElements,·(List)null,·nativeScanResult.getInformationElements()); |
149 | ····················final·ScanResult·scanResult·=·((ScanDetail)e).getScanResult(); | 150 | ····················final·ScanResult·scanResult·=·((ScanDetail)e).getScanResult(); |
150 | ····················scanResult.setWifiStandard(wifiModeToWifiStandard(networkDetail.getWifiMode())); | 151 | ····················scanResult.setWifiStandard(wifiModeToWifiStandard(networkDetail.getWifiMode())); |
151 | ····················scanResult.radioChainInfos·=·new·ScanResult$RadioChainInfo[nativeScanResult.getRadioChainInfos().size()]; | 152 | ····················scanResult.radioChainInfos·=·new·ScanResult$RadioChainInfo[nativeScanResult.getRadioChainInfos().size()]; |
Offset 238, 14 lines modified | Offset 239, 31 lines modified |
238 | ········} | 239 | ········} |
239 | ········catch·(IllegalStateException·ex)·{ | 240 | ········catch·(IllegalStateException·ex)·{ |
240 | ············s·=·"WifiNative"; | 241 | ············s·=·"WifiNative"; |
241 | ············Log.e(s,·"Unable·to·change·interface·settings",·(Throwable)ex); | 242 | ············Log.e(s,·"Unable·to·change·interface·settings",·(Throwable)ex); |
242 | ········} | 243 | ········} |
243 | ····} | 244 | ····} |
244 | ···· | 245 | ···· |
| 246 | ····private·boolean·isEnhancedOpenSupported()·{ |
| 247 | ········if·(this.mIsEnhancedOpenSupportedInitialized)·{ |
| 248 | ············return·this.mIsEnhancedOpenSupported; |
| 249 | ········} |
| 250 | ········final·String·clientInterfaceName·=·this.getClientInterfaceName(); |
| 251 | ········boolean·mIsEnhancedOpenSupported·=·false; |
| 252 | ········if·(clientInterfaceName·==·null)·{ |
| 253 | ············return·false; |
| 254 | ········} |
| 255 | ········final·boolean·mIsEnhancedOpenSupportedInitialized·=·true; |
| 256 | ········this.mIsEnhancedOpenSupportedInitialized·=·mIsEnhancedOpenSupportedInitialized; |
| 257 | ········if·((this.getSupportedFeatureSet(clientInterfaceName)·&·0x20000000L)·!=·0x0L)·{ |
| 258 | ············mIsEnhancedOpenSupported·=·mIsEnhancedOpenSupportedInitialized; |
| 259 | ········} |
| 260 | ········return·this.mIsEnhancedOpenSupported·=·mIsEnhancedOpenSupported; |
| 261 | ····} |
| 262 | ···· |
245 | ····private·void·onClientInterfaceForConnectivityDestroyed(final·WifiNative$Iface·obj)·{ | 263 | ····private·void·onClientInterfaceForConnectivityDestroyed(final·WifiNative$Iface·obj)·{ |
246 | ········synchronized·(this.mLock)·{ | 264 | ········synchronized·(this.mLock)·{ |
247 | ············this.mWifiMonitor.stopMonitoring(obj.name); | 265 | ············this.mWifiMonitor.stopMonitoring(obj.name); |
248 | ············if·(!this.unregisterNetworkObserver(obj.networkObserver))·{ | 266 | ············if·(!this.unregisterNetworkObserver(obj.networkObserver))·{ |
249 | ················final·String·s·=·"WifiNative"; | 267 | ················final·String·s·=·"WifiNative"; |
250 | ················final·StringBuilder·sb·=·new·StringBuilder(); | 268 | ················final·StringBuilder·sb·=·new·StringBuilder(); |
251 | ················sb.append("Failed·to·unregister·network·observer·on·"); | 269 | ················sb.append("Failed·to·unregister·network·observer·on·"); |
Offset 1148, 17 lines modified | Offset 1166, 15 lines modified |
1148 | ················return·null; | 1166 | ················return·null; |
1149 | ············} | 1167 | ············} |
1150 | ············if·(!this.startSupplicant())·{ | 1168 | ············if·(!this.startSupplicant())·{ |
1151 | ················Log.e("WifiNative",·"Failed·to·start·supplicant"); | 1169 | ················Log.e("WifiNative",·"Failed·to·start·supplicant"); |
1152 | ················this.mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToSupplicant(); | 1170 | ················this.mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToSupplicant(); |
1153 | ················return·null; | 1171 | ················return·null; |
1154 | ············} | 1172 | ············} |
1155 | ············final·WifiNative$IfaceManager·mIfaceMgr·=·this.mIfaceMgr; | |
1156 | ············int·mIsEnhancedOpenSupported·=·1; | |
1157 | ············final·WifiNative$Iface·access$2100·=·WifiNative$IfaceManager.access$2100(mIfaceMgr,·mIsEnhancedOpenSupported); | 1173 | ············final·WifiNative$Iface·access$2100·=·WifiNative$IfaceManager.access$2100(this.mIfaceMgr,·1); |
1158 | ············if·(access$2100·==·null)·{ | 1174 | ············if·(access$2100·==·null)·{ |
1159 | ················Log.e("WifiNative",·"Failed·to·allocate·new·STA·iface"); | 1175 | ················Log.e("WifiNative",·"Failed·to·allocate·new·STA·iface"); |
1160 | ················return·null; | 1176 | ················return·null; |
1161 | ············} | 1177 | ············} |
1162 | ············access$2100.externalListener·=·externalListener; | 1178 | ············access$2100.externalListener·=·externalListener; |
1163 | ············final·String·staIface·=·this.createStaIface(access$2100); | 1179 | ············final·String·staIface·=·this.createStaIface(access$2100); |
1164 | ············access$2100.name·=·staIface; | 1180 | ············access$2100.name·=·staIface; |
Offset 1203, 20 lines modified | Offset 1219, 15 lines modified |
1203 | ············this.onInterfaceStateChanged(access$2100,·this.isInterfaceUp(access$2100.name)); | 1219 | ············this.onInterfaceStateChanged(access$2100,·this.isInterfaceUp(access$2100.name)); |
1204 | ············this.initializeNwParamsForClientInterface(access$2100.name); | 1220 | ············this.initializeNwParamsForClientInterface(access$2100.name); |
1205 | ············final·String·s4·=·"WifiNative"; | 1221 | ············final·String·s4·=·"WifiNative"; |
1206 | ············final·StringBuilder·sb4·=·new·StringBuilder(); | 1222 | ············final·StringBuilder·sb4·=·new·StringBuilder(); |
1207 | ············sb4.append("Successfully·setup·"); | 1223 | ············sb4.append("Successfully·setup·"); |
1208 | ············sb4.append(access$2100); | 1224 | ············sb4.append(access$2100); |
1209 | ············Log.i(s4,·sb4.toString()); | 1225 | ············Log.i(s4,·sb4.toString()); |
1210 | ············final·long·supportedFeatureSetInternal·=·this.getSupportedFeatureSetInternal(access$2100.name); | |
1211 | ············access$2100.featureSet·=·supportedFeatureSetInternal; | 1226 | ············access$2100.featureSet·=·this.getSupportedFeatureSetInternal(access$2100.name); |
1212 | ············if·((supportedFeatureSetInternal·&·0x20000000L)·==·0x0L)·{ | |
1213 | ················mIsEnhancedOpenSupported·=·0; | |
1214 | ············} | |
1215 | ············this.mIsEnhancedOpenSupported·=·(mIsEnhancedOpenSupported·!=·0); | |
1216 | ············return·access$2100.name; | 1227 | ············return·access$2100.name; |
1217 | ········} | 1228 | ········} |
1218 | ····} | 1229 | ····} |
1219 | ···· | 1230 | ···· |
1220 | ····public·String·setupInterfaceForClientInScanMode(final·WifiNative$InterfaceCallback·externalListener)·{ | 1231 | ····public·String·setupInterfaceForClientInScanMode(final·WifiNative$InterfaceCallback·externalListener)·{ |
1221 | ········synchronized·(this.mLock)·{ | 1232 | ········synchronized·(this.mLock)·{ |
1222 | ············if·(!this.startHal())·{ | 1233 | ············if·(!this.startHal())·{ |
Offset 1481, 15 lines modified | Offset 1492, 14 lines modified |
1481 | ····public·int·stopSendingOffloadedPacket(final·String·s,·final·int·n)·{ | 1492 | ····public·int·stopSendingOffloadedPacket(final·String·s,·final·int·n)·{ |
1482 | ········return·this.mWifiVendorHal.stopSendingOffloadedPacket(s,·n); | 1493 | ········return·this.mWifiVendorHal.stopSendingOffloadedPacket(s,·n); |
1483 | ····} | 1494 | ····} |
1484 | ···· | 1495 | ···· |
1485 | ····public·boolean·switchClientInterfaceToConnectivityMode(String·s)·{ | 1496 | ····public·boolean·switchClientInterfaceToConnectivityMode(String·s)·{ |
1486 | ········synchronized·(this.mLock)·{ | 1497 | ········synchronized·(this.mLock)·{ |
1487 | ············final·WifiNative$Iface·access$1600·=·WifiNative$IfaceManager.access$1600(this.mIfaceMgr,·s); | 1498 | ············final·WifiNative$Iface·access$1600·=·WifiNative$IfaceManager.access$1600(this.mIfaceMgr,·s); |
1488 | ············boolean·mIsEnhancedOpenSupported·=·false; | |
1489 | ············if·(access$1600·==·null)·{ | 1499 | ············if·(access$1600·==·null)·{ |
1490 | ················final·String·s2·=·"WifiNative"; | 1500 | ················final·String·s2·=·"WifiNative"; |
1491 | ················final·StringBuilder·sb·=·new·StringBuilder(); | 1501 | ················final·StringBuilder·sb·=·new·StringBuilder(); |
1492 | ················sb.append("Trying·to·switch·to·connectivity·mode·on·an·invalid·iface="); | 1502 | ················sb.append("Trying·to·switch·to·connectivity·mode·on·an·invalid·iface="); |
1493 | ················sb.append(s); | 1503 | ················sb.append(s); |
1494 | ················s·=·sb.toString(); | 1504 | ················s·=·sb.toString(); |
1495 | ················Log.e(s2,·s); | 1505 | ················Log.e(s2,·s); |
Offset 1523, 20 lines modified | Offset 1533, 15 lines modified |
1523 | ················s·=·access$1600.name; | 1533 | ················s·=·access$1600.name; |
1524 | ················this.teardownInterface(s); | 1534 | ················this.teardownInterface(s); |
1525 | ················this.mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToSupplicant(); | 1535 | ················this.mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToSupplicant(); |
1526 | ················return·false; | 1536 | ················return·false; |
1527 | ············} | 1537 | ············} |
1528 | ············access$1600.type·=·(type2·?·1·:·0); | 1538 | ············access$1600.type·=·(type2·?·1·:·0); |
1529 | ············s·=·access$1600.name; | 1539 | ············s·=·access$1600.name; |
1530 | ············final·long·supportedFeatureSetInternal·=·this.getSupportedFeatureSetInternal(s); | |
1531 | ············access$1600.featureSet·=·supportedFeatureSetInternal; | 1540 | ············access$1600.featureSet·=·this.getSupportedFeatureSetInternal(s); |
1532 | ············if·((supportedFeatureSetInternal·&·0x20000000L)·!=·0x0L)·{ | |
1533 | ················mIsEnhancedOpenSupported·=·type2; | |
1534 | ············} | |
1535 | ············this.mIsEnhancedOpenSupported·=·mIsEnhancedOpenSupported; | |
1536 | ············final·String·s4·=·"WifiNative"; | 1541 | ············final·String·s4·=·"WifiNative"; |
1537 | ············final·StringBuilder·sb4·=·new·StringBuilder(); | 1542 | ············final·StringBuilder·sb4·=·new·StringBuilder(); |
1538 | ············sb4.append("Successfully·switched·to·connectivity·mode·on·iface="); | 1543 | ············sb4.append("Successfully·switched·to·connectivity·mode·on·iface="); |
1539 | ············sb4.append(access$1600); | 1544 | ············sb4.append(access$1600); |
1540 | ············s·=·sb4.toString(); | 1545 | ············s·=·sb4.toString(); |
1541 | ············Log.i(s4,·s); | 1546 | ············Log.i(s4,·s); |
1542 | ············return·type2; | 1547 | ············return·type2; |